Bug 116365

Summary: save_y2logs saves in a different directory
Product: [openSUSE] SUSE Linux 10.1 Reporter: Volker Kuhlmann <bugz57>
Component: YaST2Assignee: Stefan Hundhammer <shundhammer>
Status: VERIFIED FIXED QA Contact: Klaus Kämpf <kkaempf>
Severity: Minor    
Priority: P5 - None CC: bugz57, suse-beta
Version: Beta 8   
Target Milestone: ---   
Hardware: PC   
OS: All   
Whiteboard:
Found By: Other Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: patch fixing the described problems in save_y2logs
new patch, additionally fixed quoting of $1 / $TARGET
save_y2logs with improvements mentioned
save_y2logs with improvements mentioned

Description Volker Kuhlmann 2005-09-10 23:17:25 UTC
The command 
  cd /root/save_logs 
  save_y2logs save_y2logs.tar.gz 
 
fails to create the tar file in the current directory as specified, because it 
changes current directory to /var/log before opening the output file. The fix 
is simple. 
 
Also, the name of save_y2logs is badly chosen, when all I remember is that it 
had to do with yast, and type yast<tab>, I don't find the script.
Comment 1 Christian Boltz 2005-11-06 20:25:44 UTC
An average user who can't interpret the script (especially the "cd /var/log") will never find the y2logs and think the script is totally broken.

One more problem:
"save_y2logs --help" creates a tgz file named --help :-/

I'll append a patch that fixes the two problems
- tarball is now created in the current directory
- --help is supported (to be honest, -anything shows the help ;-)
Comment 2 Christian Boltz 2005-11-06 20:27:51 UTC
Created attachment 56559 [details]
patch fixing the described problems in save_y2logs
Comment 3 Christian Boltz 2006-01-22 22:54:52 UTC
Created attachment 64430 [details]
new patch, additionally fixed quoting of $1 / $TARGET
Comment 4 Christian Boltz 2006-01-22 22:56:54 UTC
save_y2logs is still buggy in 10.1 beta1.

Please apply the patch I provided.
Comment 5 Christian Boltz 2006-03-26 16:31:51 UTC
Unfortunately not fixed in beta8 :-(

Stefan, is there a special reason why you don't apply the patch provided here? If yes, tell me, and I'll (try to ;-) offer a new one that matches your needs better.
Comment 6 Stefan Hundhammer 2006-04-05 13:15:43 UTC
That patch did not do what we need. It would always include the entire path of all files, which is a pain to use when unpacking that archive (you'd get a directory tree ./var/log/YaST2 every time, forcing you to "cd" into that entire subtree).

I changed the script to do what we really want, at the same time adding support for .tar.bz2 archives as well (and additionally checking that one of .tgz, .tar.gz, .tar.bz2 is used).
Comment 7 Stefan Hundhammer 2006-04-05 13:16:37 UTC
Created attachment 76651 [details]
save_y2logs with improvements mentioned
Comment 8 Stefan Hundhammer 2006-04-05 13:23:42 UTC
Created attachment 76653 [details]
save_y2logs with improvements mentioned
Comment 9 Christian Boltz 2006-04-06 20:05:06 UTC
Just tested the fixed/improved script - everything works as expected.
(BTW: didn't know "tar --directory" yet ;-)

Thanks for fixing this!
Comment 10 Volker Kuhlmann 2008-03-15 22:19:23 UTC
The script is buggy as in it doesn't use array variables for file lists, which is potentially fatal as the file lists are generated with ls. If there's interest I'll change it to using arrays.

Closing as the original problem is fixed.