[gobolinux-devel] Dangerous changes in UpdateRecipeStore
Jonas Karlsson
jonka750 at student.liu.se
Thu Aug 16 16:05:53 UTC 2007
I don't know what happened (well I do, but I'm still pretty chocked), but I nearly had a wipeout with PutRecipe! Luckily I was looking with half an eye when I saw lots of "normal" files, text files, documents, images, logs etc, scroll by and once in a while intermixed with a message that said "rm: cannot remove `foo': Is a directory". Can anyone guess how frenetically I started to press ctrl-c? :D
It was the section below, from UpdateRecipeStore, that was responsible:
# Loop 2: remove revision tarballs which doesn't exist anymore in the svn.
cd $compileLocalStore
for i in *
do
svn_dir=$compileLocalRevisions/`echo $i | sed 's,\(.*\)--\(.*\)--recipe.tar.bz2,\1/\2,g'`
[ -d "$svn_dir" ] || { echo $i; rm $i; };
done
$compileLocalStore is defined in DevelScripts/CompileSubversion.conf but that isn't applied unless one has run 'UpdateSettings DevelScripts' after updated from the cvs repo. Just how often do _you_ run UpdateSettings after having done a 'cvs up' on any tools? Changes like these should either come with a *big* warning or have a fallback if some variable is undefined. Now '*' in the for loop expanded to everything in that users home directory, as 'cd' without arguments goes there. Fortunatly I never user my superuser account for anything useful and superuser is the only one that can commit recipes, due to permission bugs. So nothing important was lost, but I still count this as a close call.
--
/Jonas
PS. Remember to run UpdateSettings if you track cvs!
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
More information about the gobolinux-devel
mailing list