FS#6553 - makepkg3 rm -rf $HOME

Attached to Project: Pacman
Opened by Julien MISCHKOWITZ (wain) - Thursday, 08 March 2007, 12:50 GMT
Last edited by Dan McGee (toofishes) - Friday, 09 March 2007, 04:36 GMT
Task Type Bug Report
Category
Status Closed
Assigned To Dan McGee (toofishes)
Architecture not specified
Severity Critical
Priority Normal
Reported Version 0.7.2 Gimmick
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Thanks to "sudo makepkg -C", my $HOME was deleted !

line 491
if [ -n "$SRCDEST" ]; then
msg "Cleaning up source files from the cache."
rm -rf "$SRCDEST"/*

=> if SRCDEST is not set in makepkg.conf, it seems to be set to $startdir (pwd) at line 409.

Not cool, I have lost many data ...
This task depends upon

This task blocks these from closing
 FS#6316 - Pacman 3 release bugcatcher 
Closed by  Dan McGee (toofishes)
Wednesday, 21 March 2007, 02:27 GMT
Reason for closing:  Fixed
Additional comments about closing:  All set in CVS.
Comment by Dan McGee (toofishes) - Friday, 09 March 2007, 04:39 GMT
Wow, I am really sorry about this, we haven't really tested the makepkg -C operation ever. It is due to the switch from non-configurable to configurable source cache location, done mainly to allow source to still be cached in a common location without having to build as root.

Here is the patch I just committed to CVS:
http://www.archlinux.org/pipermail/pacman-dev/2007-March/002118.html

FYI: the reason it is set to 'pwd' by default is to enable source to be cached in the build directory if the variable is not defined. Unfortunately, this backfired on us when a non-PKGBUILD operation was used.

Once again- I know saying sorry can't bring back your data, but this was a bit of an oversight on our part.
Comment by Roman Kyrylych (Romashka) - Monday, 12 March 2007, 00:09 GMT
Bad. :(
wain, you can try to recover your data with anyfs and anyfs-tools from community.
Comment by Dan McGee (toofishes) - Wednesday, 14 March 2007, 14:17 GMT
This is fixed in the now released RC2. Has anyone tried it (besides me) so we can mark it as closed? It now prompts you before deleting anything (and prints the cache path location), so it is much safer than before.
Comment by Julien MISCHKOWITZ (wain) - Wednesday, 14 March 2007, 23:09 GMT
Somethin is missing:
@@ -503,7 +503,7 @@
- "No files have been removed."
+ msg "No files have been removed."


what about cleaning $SRCDEST + /var/cache/pacman/src/ ?
Comment by Dan McGee (toofishes) - Wednesday, 14 March 2007, 23:23 GMT
/var/cache/pacman/src/ is no longer used unless you specify it as $SRCDEST. That path should almost be deprecated as it requires you to build as root unless you change permissions on the folder. If you have done this, then it should be specified as $SRCDEST anyway.

This feature is almost unnecessary anyway as all it does is rm the contents of the directory.

Loading...