First Last Prev Next    No search results available      Search page      Enter new bug
Bug#: 131190
Alias:
Product:
Component:
Status: RESOLVED
Resolution: FIXED
Assigned To: Gentoo Catalyst Developers <catalyst@gentoo.org>
Hardware:
OS:
Version:
Priority:
Severity:
Reporter: Alvin Lee <liyiming@ict.ac.cn>
Add CC:
CC:
URL:
Summary:
Status Whiteboard:
Keywords:

Filename Description Type Creator Created Size Actions
cat2.patch slight change to parse_spec patch Andrew Gaffney 2006-04-25 07:12 0000 736 bytes Details | Diff
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 131190 depends on: Show dependency tree
Bug 131190 blocks:
Votes: 0    Show votes for this bug    Vote for this bug

Additional Comments: (this is where you put emerge --info)


Not eligible to see or edit group visibility for this bug.






View Bug Activity   |   Format For Printing   |   XML   |   Clone This Bug


Description:   Opened: 2006-04-24 23:52 0000
/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.

------- Comment #1 From Andrew Gaffney 2006-04-25 05:15:01 0000 -------
Please use 'diff -au' to generate a patch.

------- Comment #2 From Alvin Lee 2006-04-25 05:41:38 0000 -------
--- 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

------- Comment #3 From Andrew Gaffney 2006-04-25 07:10:26 0000 -------
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.

------- Comment #4 From Andrew Gaffney 2006-04-25 07:12:29 0000 -------
Created an attachment (id=85459) [edit]
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.

------- Comment #5 From Alvin Lee 2006-04-25 08:05:36 0000 -------
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.
^^

------- Comment #6 From Chris Gianelloni (RETIRED) 2006-04-25 08:21:53 0000 -------
This patch has been added now.  Thanks, Andrew!

------- Comment #7 From Chris Gianelloni (RETIRED) 2006-05-01 12:57:52 0000 -------
Fixed in 2.0_rc45

First Last Prev Next    No search results available      Search page      Enter new bug