Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 158755 - infinite loop in g-cpan
Summary: infinite loop in g-cpan
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Third-Party Tools (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Perl team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-12-21 11:30 UTC by Marcel Greter
Modified: 2007-01-03 05:26 UTC (History)
1 user (show)

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


Attachments
Patch for /usr/lib/perl5/vendor_perl/5.8.8/Gentoo/Config.pm (Config.pm.patch,1.21 KB, patch)
2006-12-21 11:34 UTC, Marcel Greter
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Marcel Greter 2006-12-21 11:30:08 UTC
g-cpan or precisely /usr/lib/perl5/vendor_perl/5.8.8/Gentoo/Config.pm does not like the fallowing configuration in my /etc/make.conf. I do it this way, so I can easily switch them on and off. IMO it's absolutely OK to make it so (at least for portage)!?

PORTDIR_OVERLAY=""
PORTDIR_OVERLAY="${PORTDIR_OVERLAY} /opt/portage"
PORTDIR_OVERLAY="${PORTDIR_OVERLAY} /usr/local/portage"

The method getValue of the Gentoo::Config module has a problem with the selfreference to the variable, because of the while condition in which the getParamFromFile function is called. Since the condition is checking for more variables to substitute and the function call always will return another one, the whole script stays in an endless loop.

A attach a patch in which I added a hash to use as a cache for the return values of getParamFromFile (could also use Memoize; not necessary for the fix). The selfreferences will be resolved by getParamFromFile itself (by remembering the previous value of the param and replacing variable occurences to the same param with the previous value).

Installed Versions:
sys-apps/portage-2.1.1-r2
app-portage/g-cpan-0.14.0
dev-lang/perl-5.8.8-r2

Also tried it with:
app-portage/g-cpan-0.14.1_rc1

Hope the Patch is Helpfull!
best wishes and happy xmas,
Greter Marcel (marcel.greter@crevis.ch)
Comment 1 Marcel Greter 2006-12-21 11:34:06 UTC
Created attachment 104529 [details, diff]
Patch for /usr/lib/perl5/vendor_perl/5.8.8/Gentoo/Config.pm

Here comes the patch file. I hope it's ok that I've added perl@gentoo.org to receive a CC.
Comment 2 Michael Cummings (RETIRED) gentoo-dev 2006-12-23 07:50:33 UTC
Actually took a different approach to this problem in svn utilizing Shell::EnvImporter to bypass Gentoo::Config completely (and just treat make.conf and make.globals like bash env scripts to import) which fixes this bug and a few others (like "source /my/particular/setttings" lines - yeah, people will do anything ;). I'll leave this open for now, but I'm personally leaning towards the Shell::Env approach since it bypasses any sort of munging all together (at least on our part).
Comment 3 Michael Cummings (RETIRED) gentoo-dev 2007-01-03 05:26:55 UTC
0.15_rc1 is in the tree and contains fixes that cover this bug.