i try to create a stage1 using this specfile: subarch: i686 version_stamp: artavatar.a target: stage1 rel_type: default profile: default-linux/x86/2006.0/artavatar.a snapshot: 20060504 source_subpath: gentoo/stage3-i686-2006.0 but catalyst2 (2.0_rc45) failes to cleanup some folders in sequence "clean". is `rm' called without options -rf? Running action sequence: clean <...> rm: cannot remove `./tmp/default/stage1-i686-artavatar.a': Is a directory rm: cannot remove `./tmp/portage/portage/profiles/default-linux/x86/2006.0/artavatar.a': Is a directory rm: cannot remove `./tmp/portage/portage/profiles/default-linux/x86/2006.0/artavatar.a/artavatar.server.a': Is a directory rm: cannot remove `./packages/default/stage1-i686-artavatar.a': Is a directory rm: cannot remove `./sources/portageconfs/artavatar.a': Is a directory rm: cannot remove `./snapshot_cache/20060504/portage/profiles/default-linux/x86/2006.0/artavatar.a': Is a directory rm: cannot remove `./snapshot_cache/20060504/portage/profiles/default-linux/x86/2006.0/artavatar.a/artavatar.server.a': Is a directory rm: cannot remove `./kerncache/default/stage1-i686-artavatar.a': Is a directory !!! catalyst: clean script failed. Catalyst aborting....
this is the function in question i believe: (starting line 930 in /usr/lib/catalyst2/modules/generic_stage_target.py) def clean(self): print self.settings["cleanables"] if self.settings.has_key("AUTORESUME") \ and os.path.exists(self.settings["autoresume_path"]+"clean"): print "Resume point detected, skipping clean operation..." else: for x in self.settings["cleanables"]: print "Cleaning chroot: "+x+"... " cmd("rm -rf "+self.settings["destpath"]+x,"Couldn't clean "+x,env=self.env) <...> if os.path.exists(self.settings["controller_file"]): cmd("/bin/bash "+self.settings["controller_file"]+" clean","clean script failed.",env=self.env) touch(self.settings["autoresume_path"]+"clean") and this is the line where folder/files get removed: cmd("rm -rf "+self.settings["destpath"]+x,"Couldn't clean "+x,env=self.env) this seams okay (should be able to remove folders). but i do not understand why "Couldn't clean filename" is never displayed on errors but only the errormessage from rm itself. i am currently trying to create a stage4 for which will take some time to see if i get the same errors for other stages than stage1. i have added "print self.settings["cleanables"]" to the function above to see if this list is corrupted and will post its output once everything is compiled.
['/etc/resolv.conf', '/var/tmp/*', '/tmp/*', '/root/*', '/usr/portage', '/usr/share/gettext', '/usr/lib/python2.2/test', '/usr/lib/python2.2/encodings', '/usr/lib/python2.2/email', '/usr/lib/python2.2/lib-tk', '/usr/lib/python2.3/test', '/usr/lib/python2.3/encodings', '/usr/lib/python2.3/email', '/usr/lib/python2.3/lib-tk', '/usr/lib/python2.4/test', '/usr/lib/python2.4/encodings', '/usr/lib/python2.4/email', '/usr/lib/python2.4/lib-tk', '/usr/share/zoneinfo']
okay i have tracked down the problem: using .a as a versioning string is a really bad idea. in /usr/lib/catalyst2/targets/stage1/stage1-controller.sh these lines are causing the problem: # Cleanup all .a files except libgcc.a, *_nonshared.a and # /usr/lib/portage/bin/*.a find -iname "*.a" | grep -v 'libgcc.a' | grep -v 'nonshared.a' | \ grep -v '/usr/lib/portage/bin/' | grep -v 'libgcc_eh.a' | xargs \ rm -f now that i know about this limitation i will adobt to a different naming convention. while it might be likely that nobody else runs into this problem it is still possible. so i was wondering if it was eighter possible to warn users when they append .a to ... well anything. or limit the command above to only clean files ending with .a from certain directories.
I changed the find to: find -type f -iname "*.a" This will cause it to only actually find files which end in .a, and it will skip any directories.
Fixed in 2.0_rc46...