summaryrefslogtreecommitdiffstats
path: root/pym
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2006-03-06 00:38:34 +0000
committerZac Medico <zmedico@gentoo.org>2006-03-06 00:38:34 +0000
commitbaaedc7906ce2ab15fbf69900b45b46590b40346 (patch)
tree5f819ea381b5739e7af40979e858bf10f26f07ed /pym
parent5e2a21a7ee17f96501c46eff41b5b9ed09a55a12 (diff)
downloadportage-baaedc7906ce2ab15fbf69900b45b46590b40346.tar.gz
portage-baaedc7906ce2ab15fbf69900b45b46590b40346.tar.bz2
portage-baaedc7906ce2ab15fbf69900b45b46590b40346.zip
Remove the leading / from WORLD_FILE for better cooperation with os.path.join (see bug #124471).
svn path=/main/trunk/; revision=2818
Diffstat (limited to 'pym')
-rw-r--r--pym/portage.py18
-rw-r--r--pym/portage_const.py2
2 files changed, 10 insertions, 10 deletions
diff --git a/pym/portage.py b/pym/portage.py
index 850800f89..f2bf9d6d6 100644
--- a/pym/portage.py
+++ b/pym/portage.py
@@ -5797,7 +5797,7 @@ class dblink:
# New code to remove stuff from the world and virtuals files when unmerged.
if trimworld:
- worldlist=grabfile(self.myroot+WORLD_FILE)
+ worldlist = grabfile(os.path.join(self.myroot, WORLD_FILE))
mykey=cpv_getkey(self.mycpv)
newworldlist=[]
for x in worldlist:
@@ -5820,13 +5820,13 @@ class dblink:
# (spanky noticed bug)
# XXX: dumb question, but abstracting the root uid might be wise/useful for
# 2nd pkg manager installation setups.
- if not os.path.exists(os.path.dirname(self.myroot+WORLD_FILE)):
- pdir = os.path.dirname(self.myroot + WORLD_FILE)
- os.makedirs(pdir, mode=0755)
- os.chown(pdir, 0, portage_gid)
- os.chmod(pdir, 02770)
+ my_private_path = os.path.join(self.myroot, PRIVATE_PATH)
+ if not os.path.exists(my_private_path):
+ os.makedirs(my_private_path, mode=0755)
+ os.chown(my_private_path, 0, portage_gid)
+ os.chmod(my_private_path, 02770)
- write_atomic(os.path.join(self.myroot, WORLD_FILE.lstrip(os.sep)),
+ write_atomic(os.path.join(self.myroot, WORLD_FILE),
"\n".join(newworldlist))
#do original postrm
@@ -6811,7 +6811,7 @@ def update_config_files(update_iter):
if file_contents.has_key(x):
del file_contents[x]
continue
- worldlist = grabfile(WORLD_FILE)
+ worldlist = grabfile(os.path.join("/", WORLD_FILE))
for update_cmd in update_iter:
if update_cmd[0] == "move":
@@ -6834,7 +6834,7 @@ def update_config_files(update_iter):
sys.stdout.write("p")
sys.stdout.flush()
- write_atomic(WORLD_FILE,"\n".join(worldlist))
+ write_atomic(os.path.join("/", WORLD_FILE), "\n".join(worldlist))
for x in update_files:
mydblink = dblink('','','/',settings)
diff --git a/pym/portage_const.py b/pym/portage_const.py
index c3c768620..99082a77c 100644
--- a/pym/portage_const.py
+++ b/pym/portage_const.py
@@ -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"