First Last Prev Next    No search results available      Search page      Enter new bug
Bug#: 130103
Alias:
Product:
Component:
Status: RESOLVED
Resolution: FIXED
Assigned To: Gentoo Catalyst Developers <catalyst@gentoo.org>
Hardware:
OS:
Version:
Priority:
Severity:
Reporter: Jonas Bernoulli <jonas@artavatar.org>
Add CC:
CC:
URL:
Summary:
Status Whiteboard:
Keywords:

Filename Description Type Creator Created Size Actions
catalyst_support.py.diff cleanup of parse_spec() patch Andrew Gaffney 2006-04-15 16:59 0000 2.98 KB Details | Diff
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 130103 depends on: Show dependency tree
Bug 130103 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-15 16:00 0000
if a spec file ends with a comment and the last character isnt a newline,
catalyst takes the line as an option:

!!! catalyst: Argument "# this is a comment" not recognized.


steps to reproduce:
create a spec file with a comment at the end that doesnt end with a newline.

workaround:
add a newline if your file ends with a comment.

affected versions:
i have only tried 2.0_rc41

------- Comment #1 From Andrew Gaffney 2006-04-15 16:59:06 0000 -------
Created an attachment (id=84747) [edit]
cleanup of parse_spec()

This patch cleans up some horribly ugly python code and fixes this bug. I have
done some limited testing of the code, and it seems to work fine.

>>> import catalyst_support
>>> foo = ["livecd/use: a b c\n", "    d e f\n", "  g h i\n", "livecd/foo: bar\n", "   baz\n", "# this is a comment"]
>>> catalyst_support.parse_spec(foo)
{'livecd/foo': ['bar', 'baz'], 'livecd/use': ['a', 'b', 'c', 'd', 'e', 'f',
'g', 'h', 'i']}

------- Comment #2 From Andrew Gaffney 2006-04-15 17:01:18 0000 -------
I also tested that it preserves the old "single value is a string, multiple
values is a list" behavior.

>>> import catalyst_support
>>> foo = ["livecd/use: a b c\n", "    d e f\n", "  g   h i\n", "livecd/foo: bar\n", "   baz\n", "livecd/bar:    baz\n", "# this is a comment"]
>>> catalyst_support.parse_spec(foo)
{'livecd/foo': ['bar', 'baz'], 'livecd/use': ['a', 'b', 'c', 'd', 'e', 'f',
'g', 'h', 'i'], 'livecd/bar': 'baz'}

------- Comment #3 From Andrew Gaffney 2006-04-17 08:20:29 0000 -------
And if you don't want to use the entire cleanup patch, this particular bug can
be fixed with just a small part of it:

-       trailing_comment=re.compile("#.*\n")
+       trailing_comment=re.compile("#.*$")

------- Comment #4 From Chris Gianelloni (RETIRED) 2006-04-18 13:59:35 0000 -------
I've added Andrew's patch to CVS and I'll resolve this after the next catalyst
release.

------- Comment #5 From Chris Gianelloni (RETIRED) 2006-04-18 17:18:18 0000 -------
Fixed in 2.0_rc42!

Thanks for the patch, Andrew.

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