Summary: | portageq-2.2.1 portageq ignores eroot parameter | ||
---|---|---|---|
Product: | Portage Development | Reporter: | Andrey <ahipp0> |
Component: | Core - External Interaction | Assignee: | Portage team <dev-portage> |
Status: | UNCONFIRMED --- | ||
Severity: | normal | CC: | ahipp0, maffblaster, redlizard |
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Attachments: | A simple fix (or a workaround) to reload portage settings. |
Description
Andrey
2013-10-22 15:21:59 UTC
My git bisect result: c9f6aa9f0151adb3c86706eaef1914cdbdcf2b6d is the first bad commit commit c9f6aa9f0151adb3c86706eaef1914cdbdcf2b6d Author: Ruud Koolen <redlizard@redlizard.nl> Date: Mon Jun 17 09:21:41 2013 +0200 Add cross-prefix support (In reply to Andrey Hippo from comment #1) > My git bisect result: > c9f6aa9f0151adb3c86706eaef1914cdbdcf2b6d is the first bad commit > commit c9f6aa9f0151adb3c86706eaef1914cdbdcf2b6d > Author: Ruud Koolen <redlizard@redlizard.nl> > Date: Mon Jun 17 09:21:41 2013 +0200 > > Add cross-prefix support I suppose, the bad change is diff --git a/bin/portageq b/bin/portageq index c88ee88..1ae1fe1 100755 --- a/bin/portageq +++ b/bin/portageq @@ -1232,7 +1232,7 @@ def main(argv): sys.stderr.write("Run portageq with --help for info\n") sys.stderr.flush() sys.exit(os.EX_USAGE) - eprefix = portage.const.EPREFIX + eprefix = portage.settings["EPREFIX"] eroot = portage.util.normalize_path(argv[2]) if eprefix: While looking harmless, it actually makes portage.settings[] (see [1]) accessed before the following ROOT adjustment (see [2]): os.environ["ROOT"] = root This, in turn, makes portage.settings['EROOT'], called afterwards (see [3]), return (cached) EROOT value as of before os.environ["ROOT"] adjustment ([2]). 1314 eprefix = portage.settings["EPREFIX"] # <---------- 1 1315 eroot = portage.util.normalize_path(argv[2]) 1316 1317 if eprefix: ... 1325 root = eroot[:1-len(eprefix)] 1326 else: 1327 root = eroot 1328 1329 os.environ["ROOT"] = root # <---------------------- 2 1330 1331 args = argv[2:] 1332 1333 try: 1334 if uses_eroot: 1335 args[0] = portage.settings['EROOT'] # <---- 3 1336 retval = function(args) Created attachment 361694 [details, diff]
A simple fix (or a workaround) to reload portage settings.
|