Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 131504 - Insufficent parsing of make.conf by parse_makeconf function.
Summary: Insufficent parsing of make.conf by parse_makeconf function.
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Hosted Projects
Classification: Unclassified
Component: Catalyst (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Catalyst Developers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-04-27 13:11 UTC by Alex Unigovsky
Modified: 2007-10-12 00:08 UTC (History)
0 users

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


Attachments
catalyst-misc_enhancements.patch (catalyst-misc_enhancements.patch,4.39 KB, patch)
2007-09-18 18:28 UTC, Chris Gianelloni (RETIRED)
Details | Diff
try pkgcore and portage config parsing (catalyst.patch,1.64 KB, patch)
2007-09-25 22:01 UTC, Andrew Gaffney (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Unigovsky 2006-04-27 13:11:41 UTC
Using catalyst 2.0 rc44.
If variables in make.conf are written as:

VAR="\
 flag1 flag2 flag3 \
 -flag4 -flag5 \
"

then function "parse_makeconf" in file /usr/lib/catalyst2/modules/catalyst_support.py chokes. This is legal shell syntax, but it is not caught by regexp. Maybe if the regexp could be made multiline, then it would work. But I'm not a python expert.
Comment 1 Andrew Gaffney (RETIRED) gentoo-dev 2007-08-13 20:38:15 UTC
As far as I can tell, parse_makeconf is only used for reading the make.conf generated by catalyst itself. Since catalyst doesn't create multi-line entries in make.conf, the current function is sufficient. It can probably be made multi-line relatively easily, but it'd get done faster if you submitted a patch.

The fact that this bug has gone 16 months without being touched shows that nobody else is sticking multi-line entries in make.conf in their stage tarballs by hand like you are.
Comment 2 Chris Gianelloni (RETIRED) gentoo-dev 2007-09-18 18:26:08 UTC
OK.  I was checking back over the mailing list and noticed that Charles Duffy <cduffy@spamcop.net> had created his own catalyst patch which resolved this.

Now, the only real issue with it is that it would fail on a non-Gentoo machine.  I am attaching the patch to this bug, but it will need to be adjusted to determine whether or not the portage_util stuff is even available, and to fall back to the old parser if it isn't.  This should keep compatibility, even in the lowest of stages.  Of course, if portage isn't available, we might have other issues, especially when we start looking into non-portage package manager support.
Comment 3 Chris Gianelloni (RETIRED) gentoo-dev 2007-09-18 18:28:08 UTC
Created attachment 131229 [details, diff]
catalyst-misc_enhancements.patch

Unfortunately, this patch adds additional features that I'm not very interested in supporting, just yet, but it will work for most uses.
Comment 4 Andrew Gaffney (RETIRED) gentoo-dev 2007-09-25 22:01:09 UTC
Created attachment 131900 [details, diff]
try pkgcore and portage config parsing

This patch first tries the snakeoil.fileutils.read_bash_dict() function from pkgcore, then portage_util.getconfig() from portage, and then the internal parse_makeconf() function. The first 2 work fine on my system make.conf with both multi-line vars and a sourced file. The fallback functionality seems to work just fine. This can be run on a system with pkgcore, portage, or a non-Gentoo system with neither. Of course, catalyst itself can't yet :)
Comment 5 Andrew Gaffney (RETIRED) gentoo-dev 2007-09-25 22:01:50 UTC
Err, s/paludis/portage/ in that patch description.
Comment 6 Andrew Gaffney (RETIRED) gentoo-dev 2007-09-25 22:29:36 UTC
My patch is in SVN and will be released in 2.0.5
Comment 7 Chris Gianelloni (RETIRED) gentoo-dev 2007-10-12 00:08:13 UTC
This should be fixed in 2.0.5_pre4.  Please test this version of catalyst (or newer) and report back if it does not work.

Thanks