there are 3 places that have "/var/db/pkg" hardcoded instead of using VDB_PATH: /usr/lib/portage/pym/portage_contents.py:153: for x in os.listdir("/var/db/pkg"): /usr/lib/portage/pym/portage_contents.py:154: for y in os.listdir("/var/db/pkg/"+x): /usr/lib/portage/pym/portage_contents.py:155: c_path = "/var/db/pkg/"+x+"/"+y+"/CONTENTS" I'd like that fixed so I can store remote dbs on a local machine and test against it for security updates. on other note, what are the chances of getting VDB_PATH an enviornment setting?
you cant simply change it to VDB_PATH ... it has to contain the root logic as well besides, that code is only found in the test() function ... it isnt actually used when doing an `emerge` or something ...
(In reply to comment #0) > I'd like that fixed so I can store remote dbs on a local machine and test > against it for security updates. That is a very sweet idea. > on other note, what are the chances of getting VDB_PATH an enviornment setting? You could try todo something like this which is probably painfully quite slow. Index: pym/portage_const.py =================================================================== --- pym/portage_const.py (revision 3055) +++ pym/portage_const.py (working copy) @@ -7,8 +7,11 @@ # =========================================================================== # START OF CONSTANTS -- START OF CONSTANTS -- START OF CONSTANTS -- START OF # =========================================================================== +import os +VDB_PATH = os.getenv("VDB_PATH") +if VDB_PATH == None: + VDB_PATH = "var/db/pkg" -VDB_PATH = "var/db/pkg" PRIVATE_PATH = "var/lib/portage" CACHE_PATH = "/var/cache/edb" DEPCACHE_PATH = CACHE_PATH+"/dep" --------- Or allow the name var/db/pkg to be used and just use ROOT=/somepath/REMOTE_HOST glsa-check -v -l affected where the vdb is $ROOT/var/db/pkg
ok, my bad for not checking what it was used for - but sure, I'm all for adding the ROOT as well. and, there are two occurances which use VDB_PATH without root: (those are for the counter) /usr/lib/portage/pym/portage.py:4452: counter=long(commands.getoutput("for FILE in $(find /"+VDB_PATH+" -type f -name COUNTER); do echo $(<${FILE}); done | sort -n | tail -n1 | tr -d '\n'")) /usr/lib/portage/pym/portage.py:4463: counter=long(commands.getoutput("for FILE in $(find /"+VDB_PATH+" -type f -name COUNTER); do echo $(<${FILE}); done | sort -n | tail -n1 | tr -d '\n'"))
solar,thanks for the guidance I got the pesky little bug that prevented: ROOT=/somepath/REMOTE_HOST glsa-check -v -l affected from working. below it is the patch that fixes it. I can't connect to freenode now for some reason, but here's what I got. I don't know what's the overall meaning of it, and if it can screw things up under certain conditions, but it made ROOT=/remote emerge -va world work as well. comments please? --- portage.py.orig 2006-04-08 23:10:08.000000000 +0300 +++ portage.py 2006-04-08 23:11:15.000000000 +0300 @@ -7210,7 +7210,7 @@ vkeysplit=x.split("/") if not virts_p.has_key(vkeysplit[1]): virts_p[vkeysplit[1]]=virts[x] - db["/"]={"virtuals":virts,"vartree":vartree("/",virts)} + db["/"]={"virtuals":virts,"vartree":vartree(root,virts)} if root!="/": virts=mysettings.getvirtuals(root) db[root]={"virtuals":virts,"vartree":vartree(root,virts)}
oh, there's another ref to /var/db/pkg, line 1111 in portage 2.0.54: self.loadVirtuals('/') and it should be self.loadVirtuals(root). still there's something that hardcodes '/' as root, fetching "PROVIDE" from /var/db/pkg. I'll try to nail that one as well.
as far as /etc/* goes there's already bug 40302
(In reply to comment #5) > still there's something that hardcodes '/' as root, fetching "PROVIDE" from > /var/db/pkg. That sounds like bug 129054. The only VDB_PATH I could find wasn't yet relative to $ROOT was in the COUNTER rengeneration logic and that is fixed in svn r3644.
(In reply to comment #7) > That sounds like bug 129054. Pardon, I meant to say bug 131319 of course.
This has been released in 2.1.1_pre1-r3.