Bug 104800

Summary: pin and copying ARCHIVES.gz when an old one exists.
Product: [openSUSE] SUSE LINUX 10.0 Reporter: Christian Boltz <suse-beta>
Component: ConsoleAppsAssignee: Martin Lasarsch <martin.lasarsch>
Status: RESOLVED FIXED QA Contact: E-mail List <qa-bugs>
Severity: Normal    
Priority: P5 - None    
Version: Beta 1   
Target Milestone: ---   
Hardware: Other   
OS: All   
Whiteboard:
Found By: Other Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description Christian Boltz 2005-08-15 20:17:10 UTC
The way pin handles the copying the ARCHIVES.gz shows some regressions 
compared to 9.3. For example, it does not prompt for the root password to copy 
ARCHIVES.gz, but shows "permission denied" instead. 
 
I'll show some common cases for the first time pin is run on 10.0 after an 
upgrade: 
 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
calling pin as user: 
 
# pin some.file 
 
 no file ARCHIVES_10.0.gz found 
 
 please insert CD1/DVD in your CD-ROM/DVD drive / bitte CD1/DVD einlegen 
 
 please eject all medias from other drives / bitte entfernen Sie andere Medien 
aus den Laufwerken. 
 
 
 press enter to continue - Bitte enter druecken 
 
 
 please wait / bitte warten 
 
/usr/bin/pin: line 121: hwinfo: command not found 
 no SUSE CD/DVD found, please copy ARCHIVES.gz manually to /var/lib/pin/ 
 
 keine SUSE CD/DVD gefunden, bitte ARCHIVES.gz manuell nach /var/lib/pin 
kopieren 
 
 
--> the "hwinfo: command not found" message will confuse users. 
Hint: call hwinfo with the full path -> "/usr/sbin/hwinfo" instead of just 
"hwinfo". It seems to work as non-root also. 
 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
 
calling pin as user again, this time setting PATH so that hwinfo can be found: 
 
# PATH=/usr/sbin:$PATH 
# pin some.file 
 
 
 no file ARCHIVES_10.0.gz found 
 
 please insert CD1/DVD in your CD-ROM/DVD drive / bitte CD1/DVD einlegen 
 
 please eject all medias from other drives / bitte entfernen Sie andere Medien 
aus den Laufwerken. 
 
 
 press enter to continue - Bitte enter druecken 
 
 
 please wait / bitte warten 
 
 
 copy ARCHIVES.gz to /var/lib/pin/... 
 
cp: cannot create regular file `/var/lib/pin/ARCHIVES_10.0.gz': Permission 
denied 
 
 error, could not make link 
 press return to delete old ARCHIVES.gz 
 
rm: cannot remove `/var/lib/pin/ARCHIVES.gz': Permission denied 
 
 no file ARCHIVES_10.0.gz found 
 
 please insert CD1/DVD in your CD-ROM/DVD drive / bitte CD1/DVD einlegen 
 
 please eject all medias from other drives / bitte entfernen Sie andere Medien 
aus den Laufwerken. 
 
 
 press enter to continue - Bitte enter druecken 
 
 
 please wait / bitte warten 
 
 
 copy ARCHIVES.gz to /var/lib/pin/... 
 
cp: cannot create regular file `/var/lib/pin/ARCHIVES_10.0.gz': Permission 
denied 
 
 error, could not make link 
 press return to delete old ARCHIVES.gz 
 
rm: cannot remove `/var/lib/pin/ARCHIVES.gz': Permission denied 
 
 grepping /var/lib/pin/ARCHIVES.gz ... please wait 
 
 
 
--> Please note that pin grepped the _old_ ARCHIVES.gz (because it could not 
copy the new one) 
 
--> Also note that pin did not ask for the root password and showed several 
"permission denied" messages. 
 
--> An average newbie ;-) will not know that he has to run pin as root the 
first time to avoid the "permission denied" messages. 
 
Hint: "if [ ! -r "$GREP_FILE" ] ; then" (line 153) does not work as expected 
if an old ARCHIVES.gz exists and skips the root test. 
 
 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
calling pin as root (using su -) 
 
# pin some.file 
 
 no file ARCHIVES_10.0.gz found 
 
 please insert CD1/DVD in your CD-ROM/DVD drive / bitte CD1/DVD einlegen 
 
 please eject all medias from other drives / bitte entfernen Sie andere Medien 
aus den Laufwerken. 
 
 
 press enter to continue - Bitte enter druecken 
 
 
 please wait / bitte warten 
 
 
 copy ARCHIVES.gz to /var/lib/pin/... 
 
 
 error, could not make link 
 press return to delete old ARCHIVES.gz 
 
 
 grepping /var/lib/pin/ARCHIVES.gz ... please wait 
 
 
--> Finally, it worked as root. But: 
 
Please note that /var/lib/pin/ARCHIVES.gz was a symlink before (at least on my 
system ;-)  - there shouldn't be a error messsage that pin could not delete 
ARCHIVES.gz in this case.  
Hint:  test -L /var/lib/pin/ARCHIVES.gz && rm /var/lib/pin/ARCHIVES.gz 
before creating the new symlink. 
 
Also, please let pin check if it is running as non-root (and ask for root 
password if necessary) when trying to upgrade the ARCHIVES.gz. 
 
One more thing, even if it's not a bug: 
Getting the right CDROM/DVD drive seems to be a little adventure using hwinfo. 
Are you sure you don't want to use my solution (checking all directories 
in /media for ARCHIVES.gz and maybe a SUSE-specific file which is also there 
in every release)?
Comment 1 Martin Lasarsch 2005-08-22 15:34:18 UTC
you are right ... 
 
i tested now: 
 
- fresh, no ARCHIVES.gz in /var/lib/pin/ ,works as root and user. file will be 
copied, link will be created. 
 
- ARCHIVES.gz in dir, it will moved to ARCHIVES_old_backup.gz and new 
ARCHIVES.gz link to used version will created, works as root and user. 
 
- ARCHIVES_9.3.gz in dir (something which is not 10) (root/user) 
 
- link ARCHIVES.gz to ARCHIVES_9.3.gz (root/user) 
 
hwinfo: yeah, might be, but it works. 
 
pin needs now a cleanup, i just wanted it to be in before deadline. 
 
Comment 2 Martin Lasarsch 2005-09-05 13:14:17 UTC
should be all fixed, please reopen if you still find errors, thanks!