Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 298141 - Sets still come from /etc/portage no matter what is defined for PORTAGE_CONFIGROOT
Summary: Sets still come from /etc/portage no matter what is defined for PORTAGE_CONFI...
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core - Configuration (show other bugs)
Hardware: All Linux
: High minor (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords: InVCS
: 266132 (view as bug list)
Depends on:
Blocks: 144480
  Show dependency tree
 
Reported: 2009-12-23 22:04 UTC by Martin Gysel (bearsh)
Modified: 2015-10-23 01:31 UTC (History)
2 users (show)

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


Attachments
add fallback value to parser for PORTAGE_CONFIGROOT (sets__init__.patch,406 bytes, patch)
2009-12-24 00:35 UTC, Martin Gysel (bearsh)
Details | Diff
add PORTAGE_CONFIGROOT placeholder which gets expanded by the parser (sets.conf.patch,388 bytes, patch)
2009-12-24 00:37 UTC, Martin Gysel (bearsh)
Details | Diff
sets.conf.patch (sets.conf.patch,388 bytes, patch)
2009-12-24 02:26 UTC, Jacob Godserv
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Gysel (bearsh) 2009-12-23 22:04:18 UTC
If I define PORTAGE_CONFIGROOT e.g. for cross-compiling I'm not able to put sets into ${PORTAGE_CONFIGROOT}/etc/portage/sets, sets are always taken from /etc/portage/sets

Reproducible: Always

Steps to Reproduce:
1. use PORTAGE_CONFIGROOT with emerge @some_set

Actual Results:  
only looks for sets in /etc/portage

Expected Results:  
use sets in ${PORTAGE_CONFIGROOT}/etc/portage/sets

example:
(neuvoo) gorilla / # ls /usr/armv7a-unknown-linux-gnueabi/etc/portage/sets/
cc_libs  x11_proto
(neuvoo) gorilla / # ls /etc/portage/sets/
cc_libs
(neuvoo) gorilla / # emerge-armv7a-unknown-linux-gnueabi --list-sets
cc_libs
downgrade
installed
live-rebuild
module-rebuild
preserved-rebuild
security
selected
system
unavailable
world
(neuvoo) gorilla / #
Comment 1 Martin Gysel (bearsh) 2009-12-24 00:35:58 UTC
Created attachment 214004 [details, diff]
add fallback value to parser for PORTAGE_CONFIGROOT
Comment 2 Martin Gysel (bearsh) 2009-12-24 00:37:56 UTC
Created attachment 214005 [details, diff]
add PORTAGE_CONFIGROOT placeholder which gets expanded by the parser
Comment 3 Martin Gysel (bearsh) 2009-12-24 00:40:20 UTC
Using patches from comment 1 and 2 portage also scans sets in PORTAGE_CONFIGROOT. this means there are now the sets from /etc/portage/sets AND ${PORTAGE_CONFIGROOT}/etc/portage/sets
maybe there's another solution to prevent this behavior
Comment 4 Jacob Godserv 2009-12-24 02:26:45 UTC
Created attachment 214009 [details, diff]
sets.conf.patch

A fixed sets.conf.patch file. The previous one had "setc" instead of "/etc".
Comment 5 Jacob Godserv 2009-12-24 02:43:48 UTC
The issue of portage still looking to real root appears to me an issue of portage not using PORTAGE_CONFIGROOT for all portage paths, just for /etc.

Even then, PORTAGE_CONFIGROOT isn't always set to the environment variable. The function load_default_config, under portage/_sets/__init__.py in portage v2.1.6.13, is called twice, the first time honoring the user's PORTAGE_CONFIGROOT, and the second not.
Comment 6 Jacob Godserv 2009-12-24 02:47:59 UTC
If I modify the load_default_config function like this:
--- begin ---
def load_default_config(settings, trees):
        setconfigpaths = [os.path.join(GLOBAL_CONFIG_PATH, "sets.conf")]
        setconfigpaths.append(os.path.join(settings["PORTDIR"], "sets.conf"))
        setconfigpaths += [os.path.join(x, "sets.conf") for x in settings["PORTDIR_OVERLAY"].split()]
        setconfigpaths.append(os.path.join(settings["PORTAGE_CONFIGROOT"],
                USER_CONFIG_PATH.lstrip(os.path.sep), "sets.conf"))
        print("PORTAGE_CONFIGROOT: " + settings["PORTAGE_CONFIGROOT"]) # addition
        for path in setconfigpaths: # addition
                print (path) # addition
        return SetConfig(setconfigpaths, settings, trees)
--- end ---

I get the following output using portage v2.1.6.13: 

--- begin ---
 $ sudo PORTAGE_CONFIGROOT=~/test/ ROOT=~/test/ emerge -pv portage
PORTAGE_CONFIGROOT: /home/jacob/test/
/usr/share/portage/config/sets.conf
/usr/portage/sets.conf
/home/jacob/test/etc/portage/sets.conf
PORTAGE_CONFIGROOT: /
/usr/share/portage/config/sets.conf
/usr/portage/sets.conf
/usr/local/portage/layman/sunrise/sets.conf
/usr/local/portage/layman/gnome/sets.conf
/usr/local/portage/sets.conf
/etc/portage/sets.conf

These are the packages that would be merged, in order:

[...snip...]
--- end ---
Comment 7 Martin Gysel (bearsh) 2009-12-24 08:59:13 UTC
(In reply to comment #4)
> Created an attachment (id=214009) [details]
> sets.conf.patch
> 
> A fixed sets.conf.patch file. The previous one had "setc" instead of "/etc".
> 
what's wrong with my patch? according to http://docs.python.org/library/configparser.html the placeholder ist '%(bar)s' which then gets replaced to foo. in our case, foo is PORTAGE_CONFIGROOT var in portage which afaik should end with '/'
%(PORTAGE_CONFIGROOT)setc/portage/sets/ -> e.g. /usr/armv7a-unknown-linux-gnueabi/etc/portage/sets/
anyway, thx for your great help digging through portage!
Comment 8 Jacob Godserv 2010-01-21 23:49:20 UTC
Comment on attachment 214009 [details, diff]
sets.conf.patch

Sorry, I was mistaken about those corrections I applied.
Comment 9 Zac Medico gentoo-dev 2010-01-31 22:22:08 UTC
(In reply to comment #1)
> Created an attachment (id=214004) [details]
> add fallback value to parser for PORTAGE_CONFIGROOT
(In reply to comment #2)
> Created an attachment (id=214005) [details]
> add PORTAGE_CONFIGROOT placeholder which gets expanded by the parser

Thanks, that's in svn r15307.
Comment 10 Zac Medico gentoo-dev 2010-03-03 11:17:36 UTC
This is fixed in 2.2_rc64.
Comment 11 Zac Medico gentoo-dev 2010-11-26 21:18:33 UTC
*** Bug 266132 has been marked as a duplicate of this bug. ***