summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2006-03-05 19:45:23 +0000
committerZac Medico <zmedico@gentoo.org>2006-03-05 19:45:23 +0000
commit62705448fcd0b6b9ef793372dce2ceda0c3a3eb2 (patch)
treec0645b49052489826acc2e38312e93d994ed59f4
parent21d84f731674d5b41b8e66b37855acd1007c53d3 (diff)
downloadportage-62705448fcd0b6b9ef793372dce2ceda0c3a3eb2.tar.gz
portage-62705448fcd0b6b9ef793372dce2ceda0c3a3eb2.tar.bz2
portage-62705448fcd0b6b9ef793372dce2ceda0c3a3eb2.zip
Remove the leading / from PRIVATE_PATH (var/lib/portage) for better cooperation with os.path.join (see bug #124471).
svn path=/main/trunk/; revision=2815
-rw-r--r--pym/portage.py10
-rw-r--r--pym/portage_checksum.py2
-rw-r--r--pym/portage_const.py6
3 files changed, 9 insertions, 9 deletions
diff --git a/pym/portage.py b/pym/portage.py
index 10c793f27..e68a6d048 100644
--- a/pym/portage.py
+++ b/pym/portage.py
@@ -6049,11 +6049,11 @@ class dblink:
if cfgfiledict.has_key("IGNORE"):
del cfgfiledict["IGNORE"]
- # XXXX: HACK! PathSpec is very necessary here.
- if not os.path.exists(destroot+PRIVATE_PATH):
- os.makedirs(destroot+PRIVATE_PATH)
- os.chown(destroot+PRIVATE_PATH,os.getuid(),portage_gid)
- os.chmod(destroot+PRIVATE_PATH,02770)
+ my_private_path = os.path.join(destroot, PRIVATE_PATH)
+ if not os.path.exists(my_private_path):
+ os.makedirs(my_private_path)
+ os.chown(my_private_path, os.getuid(), portage_gid)
+ os.chmod(my_private_path, 02770)
mylock = portage_locks.lockfile(destroot+CONFIG_MEMORY_FILE)
writedict(cfgfiledict,destroot+CONFIG_MEMORY_FILE)
diff --git a/pym/portage_checksum.py b/pym/portage_checksum.py
index 2dd447df2..8196628ca 100644
--- a/pym/portage_checksum.py
+++ b/pym/portage_checksum.py
@@ -120,7 +120,7 @@ def pyhash(filename, hashobject):
def perform_checksum(filename, hash_function=md5hash, calc_prelink=0):
myfilename = filename[:]
- prelink_tmpfile = PRIVATE_PATH+"/prelink-checksum.tmp."+str(os.getpid())
+ prelink_tmpfile = os.path.join("/", PRIVATE_PATH, "prelink-checksum.tmp." + str(os.getpid()))
mylock = None
if calc_prelink and prelink_capable:
diff --git a/pym/portage_const.py b/pym/portage_const.py
index 2a36c82f9..1b5459f45 100644
--- a/pym/portage_const.py
+++ b/pym/portage_const.py
@@ -9,7 +9,7 @@
# ===========================================================================
VDB_PATH = "var/db/pkg"
-PRIVATE_PATH = "/var/lib/portage"
+PRIVATE_PATH = "var/lib/portage"
CACHE_PATH = "/var/cache/edb"
DEPCACHE_PATH = CACHE_PATH+"/dep"
@@ -29,7 +29,7 @@ BASH_BINARY = "/bin/bash"
MOVE_BINARY = "/bin/mv"
PRELINK_BINARY = "/usr/sbin/prelink"
-WORLD_FILE = PRIVATE_PATH+"/world"
+WORLD_FILE = "/" + PRIVATE_PATH + "/world"
MAKE_CONF_FILE = "/etc/make.conf"
MAKE_DEFAULTS_FILE = PROFILE_PATH + "/make.defaults"
DEPRECATED_PROFILE_FILE = PROFILE_PATH+"/deprecated"
@@ -37,7 +37,7 @@ USER_VIRTUALS_FILE = USER_CONFIG_PATH+"/virtuals"
EBUILD_SH_ENV_FILE = USER_CONFIG_PATH+"/bashrc"
INVALID_ENV_FILE = "/etc/spork/is/not/valid/profile.env"
CUSTOM_MIRRORS_FILE = USER_CONFIG_PATH+"/mirrors"
-CONFIG_MEMORY_FILE = PRIVATE_PATH + "/config"
+CONFIG_MEMORY_FILE = "/" + PRIVATE_PATH + "/config"
INCREMENTALS=["USE","USE_EXPAND","USE_EXPAND_HIDDEN","FEATURES","ACCEPT_KEYWORDS","ACCEPT_LICENSE","CONFIG_PROTECT_MASK","CONFIG_PROTECT","PRELINK_PATH","PRELINK_PATH_MASK"]
STICKIES=["KEYWORDS_ACCEPT","USE","CFLAGS","CXXFLAGS","MAKEOPTS","EXTRA_ECONF","EXTRA_EINSTALL","EXTRA_EMAKE"]