Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 132180 - catalyst2 failes to clean folders in sequence clean
Summary: catalyst2 failes to clean folders in sequence clean
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Hosted Projects
Classification: Unclassified
Component: Catalyst (show other bugs)
Hardware: All Linux
: High minor (vote)
Assignee: Gentoo Catalyst Developers
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks:
 
Reported: 2006-05-03 16:13 UTC by Jonas Bernoulli
Modified: 2006-05-25 09:31 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jonas Bernoulli 2006-05-03 16:13:22 UTC
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....
Comment 1 Jonas Bernoulli 2006-05-04 04:01:19 UTC
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.
Comment 2 Jonas Bernoulli 2006-05-09 07:48:19 UTC
['/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']
Comment 3 Jonas Bernoulli 2006-05-09 07:56:49 UTC
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.
Comment 4 Chris Gianelloni (RETIRED) gentoo-dev 2006-05-23 13:00:12 UTC
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.
Comment 5 Chris Gianelloni (RETIRED) gentoo-dev 2006-05-25 09:31:53 UTC
Fixed in 2.0_rc46...