/usr/lib/catalyst2/modules/catalyst_support.py 588,589d587 < elif len(cur_array) != 1: < myspec[cur_array[0]] = cur_array[1:] 591,592c589,595 < print "\n\tWARNING: No value set for key: "+cur_array[0] < print "\tdeleting key: "+cur_array[0]+"\n" --- > myspec[cur_array[0]] = cur_array[1:] > for x in myspec: > # Delete empty key pair > if not myspec[x]: > print "\n\tWARNING: No value set for key: "+x > print "\tdeleting key: "+x+"\n" > del myspec[x] I did not find any erro in these codes,but I really can not build my target by these codes with no erro message. It's very strange that an exception occured in del myspec[x] phase. I do not know why , but after having changed these codes like above my catalyst can work well again. So I think it may be a bug only in some special environment and unfortunately I got it.
Please use 'diff -au' to generate a patch.
--- catalyst_support.py 2006-04-25 14:53:06.000000000 +0800 +++ catalyst_support.py.change 2006-04-25 14:55:33.000000000 +0800 @@ -585,14 +585,11 @@ if len(cur_array) == 2: myspec[cur_array[0]] = cur_array[1] + elif len(cur_array) != 1: + myspec[cur_array[0]] = cur_array[1:] else: - myspec[cur_array[0]] = cur_array[1:] - for x in myspec: - # Delete empty key pair - if not myspec[x]: - print "\n\tWARNING: No value set for key: "+x - print "\tdeleting key: "+x+"\n" - del myspec[x] + print "\n\tWARNING: No value set for key: "+cur_array[0] + print "\tdeleting key: "+cur_array[0]+"\n" #print myspec return myspec
Let me guess. You were getting a traceback with "RuntimeError: dictionary changed size during iteration". The only time this code should have caused a problem is if you have a malformed spec file, for example: livecd/foo: livecd/bar: a b c I'm attaching a patch that should fix this properly.
Created attachment 85459 [details, diff] slight change to parse_spec The original version used 'for x in myspec.keys()' but I changed it to 'for x in myspec', but it apparently used .keys() for a good reason. The former returns a list of keys. The latter creates an interator and goes over the keys. The iterator gets very unhappy when one of the keys it's currently dealing with disappears.
yeah!Thank you for your comment which make me know what's wrong with these codes, I have just learned python for a shot time and I did not know the difference between "for x in myspec.keys()" and "for x in myspec". In fact these days I devote to using catalyst to produce my own livecd , so I have changed some codes of catalys and defined some new variables in spec file. These actions cause some problems which do not appear in common sense. ^^
This patch has been added now. Thanks, Andrew!
Fixed in 2.0_rc45