Gentoo Archives: gentoo-commits

From: "Fabian Groffen (grobian)" <grobian@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] portage r14195 - in main/branches/prefix: bin pym/_emerge pym/portage pym/portage/dbapi pym/portage/sets
Date: Sat, 05 Sep 2009 11:00:24
Message-Id: E1Mjt0H-00067E-DH@stork.gentoo.org
1 Author: grobian
2 Date: 2009-09-05 11:00:20 +0000 (Sat, 05 Sep 2009)
3 New Revision: 14195
4
5 Modified:
6 main/branches/prefix/bin/archive-conf
7 main/branches/prefix/bin/ebuild
8 main/branches/prefix/bin/regenworld
9 main/branches/prefix/pym/_emerge/BlockerCache.py
10 main/branches/prefix/pym/_emerge/actions.py
11 main/branches/prefix/pym/portage/__init__.py
12 main/branches/prefix/pym/portage/dbapi/bintree.py
13 main/branches/prefix/pym/portage/dbapi/vartree.py
14 main/branches/prefix/pym/portage/glsa.py
15 main/branches/prefix/pym/portage/sets/files.py
16 Log:
17 Merged from trunk -r14186:14191
18
19 | 14187 | Fix usage of VDB_PATH |
20 | grobian | |
21
22 | 14188 | consistently use CACHE_PATH with target_root, this commit |
23 | grobian | needs a separate soon to be done commit of |
24 | | pym/portage/const.py to work correctly |
25
26 | 14189 | PRIVATE_PATH has no leading slash (like all other uses of |
27 | grobian | this var assume) |
28
29 | 14190 | add note that this file does not seem to deal with ROOT at |
30 | grobian | all |
31
32 | 14191 | DEPRECATED_PROFILE_FILE is derived from PROFILE_PATH which |
33 | grobian | has no leading slash |
34
35
36 Modified: main/branches/prefix/bin/archive-conf
37 ===================================================================
38 --- main/branches/prefix/bin/archive-conf 2009-09-05 10:55:47 UTC (rev 14194)
39 +++ main/branches/prefix/bin/archive-conf 2009-09-05 11:00:20 UTC (rev 14195)
40 @@ -56,7 +56,7 @@
41 md5_match_hash[conf] = ''
42
43 # Find all the CONTENT files in VDB_PATH.
44 - content_files += os.popen(FIND_EXTANT_CONTENTS % (portage.root+portage.VDB_PATH)).readlines()
45 + content_files += os.popen(FIND_EXTANT_CONTENTS % (os.path.join(portage.root, portage.VDB_PATH))).readlines()
46
47 # Search for the saved md5 checksum of all the specified config files
48 # and see if the current file is unmodified or not.
49
50 Modified: main/branches/prefix/bin/ebuild
51 ===================================================================
52 --- main/branches/prefix/bin/ebuild 2009-09-05 10:55:47 UTC (rev 14194)
53 +++ main/branches/prefix/bin/ebuild 2009-09-05 11:00:20 UTC (rev 14195)
54 @@ -137,7 +137,7 @@
55 print "!!! %s does not follow correct package syntax." % (cpv)
56 sys.exit(1)
57
58 -if ebuild.startswith(portage.root + portage.const.VDB_PATH):
59 +if ebuild.startswith(os.path.join(portage.root, portage.const.VDB_PATH)):
60 mytree = "vartree"
61
62 portage_ebuild = portage.db[portage.root][mytree].dbapi.findname(cpv)
63
64 Modified: main/branches/prefix/bin/regenworld
65 ===================================================================
66 --- main/branches/prefix/bin/regenworld 2009-09-05 10:55:47 UTC (rev 14194)
67 +++ main/branches/prefix/bin/regenworld 2009-09-05 11:00:20 UTC (rev 14195)
68 @@ -3,6 +3,8 @@
69 # Distributed under the terms of the GNU General Public License v2
70 # $Id$
71
72 +# NOTE: this file does not respect ROOT
73 +
74 import sys
75 # for an explanation on this logic, see pym/_emerge/__init__.py
76 from os import environ as ose
77
78 Modified: main/branches/prefix/pym/_emerge/BlockerCache.py
79 ===================================================================
80 --- main/branches/prefix/pym/_emerge/BlockerCache.py 2009-09-05 10:55:47 UTC (rev 14194)
81 +++ main/branches/prefix/pym/_emerge/BlockerCache.py 2009-09-05 11:00:20 UTC (rev 14195)
82 @@ -37,7 +37,7 @@
83 self._vardb = vardb
84 self._virtuals = vardb.settings.getvirtuals()
85 self._cache_filename = os.path.join(myroot,
86 - portage.CACHE_PATH.lstrip(os.path.sep), "vdb_blockers.pickle")
87 + portage.CACHE_PATH, "vdb_blockers.pickle")
88 self._cache_version = "1"
89 self._cache_data = None
90 self._modified = set()
91
92 Modified: main/branches/prefix/pym/_emerge/actions.py
93 ===================================================================
94 --- main/branches/prefix/pym/_emerge/actions.py 2009-09-05 10:55:47 UTC (rev 14194)
95 +++ main/branches/prefix/pym/_emerge/actions.py 2009-09-05 11:00:20 UTC (rev 14195)
96 @@ -2642,7 +2642,7 @@
97 settings = trees[myroot]["vartree"].settings
98 break
99
100 - mtimedbfile = os.path.join("/", portage.CACHE_PATH.lstrip(os.path.sep), "mtimedb")
101 + mtimedbfile = os.path.join(os.path.sep, settings['ROOT'], portage.CACHE_PATH, "mtimedb")
102 mtimedb = portage.MtimeDB(mtimedbfile)
103 portage.output._init(config_root=settings['PORTAGE_CONFIGROOT'])
104 return settings, trees, mtimedb
105
106 Modified: main/branches/prefix/pym/portage/__init__.py
107 ===================================================================
108 --- main/branches/prefix/pym/portage/__init__.py 2009-09-05 10:55:47 UTC (rev 14194)
109 +++ main/branches/prefix/pym/portage/__init__.py 2009-09-05 11:00:20 UTC (rev 14195)
110 @@ -2213,12 +2213,12 @@
111 if not os.access(self["ROOT"] + EPREFIX_LSTRIP, os.W_OK):
112 return
113
114 - # gid, mode, mask, preserve_perms
115 + # gid, mode, mask, preserve_perms
116 dir_mode_map = {
117 - EPREFIX_LSTRIP+"/tmp" : ( -1, 01777, 0, True),
118 - EPREFIX_LSTRIP+"/var/tmp" : ( -1, 01777, 0, True),
119 - EPREFIX_LSTRIP+"/"+PRIVATE_PATH :(portage_gid, 02750, 02, False),
120 - CACHE_PATH.lstrip(os.path.sep) : (portage_gid, 0755, 02, False)
121 + EPREFIX_LSTRIP+"/tmp" : ( -1, 01777, 0, True),
122 + EPREFIX_LSTRIP+"/var/tmp" : ( -1, 01777, 0, True),
123 + EPREFIX_LSTRIP+"/"+PRIVATE_PATH : (portage_gid, 02750, 02, False),
124 + CACHE_PATH : (portage_gid, 0755, 02, False)
125 }
126
127 for mypath, (gid, mode, modemask, preserve_perms) \
128 @@ -8533,7 +8533,7 @@
129 if settings is not None:
130 config_root = settings["PORTAGE_CONFIGROOT"]
131 deprecated_profile_file = os.path.join(config_root,
132 - DEPRECATED_PROFILE_FILE.lstrip(os.sep))
133 + DEPRECATED_PROFILE_FILE)
134 if not os.access(deprecated_profile_file, os.R_OK):
135 return False
136 dcontent = codecs.open(_unicode_encode(deprecated_profile_file,
137 @@ -8873,8 +8873,8 @@
138 def _get_target(self):
139 global mtimedb, mtimedbfile, _mtimedb_initialized
140 if not _mtimedb_initialized:
141 - mtimedbfile = os.path.join("/",
142 - CACHE_PATH.lstrip(os.path.sep), "mtimedb")
143 + mtimedbfile = os.path.join(os.path.sep,
144 + CACHE_PATH, "mtimedb")
145 mtimedb = MtimeDB(mtimedbfile)
146 _mtimedb_initialized = True
147 name = object.__getattribute__(self, '_name')
148
149 Modified: main/branches/prefix/pym/portage/dbapi/bintree.py
150 ===================================================================
151 --- main/branches/prefix/pym/portage/dbapi/bintree.py 2009-09-05 10:55:47 UTC (rev 14194)
152 +++ main/branches/prefix/pym/portage/dbapi/bintree.py 2009-09-05 11:00:20 UTC (rev 14195)
153 @@ -663,7 +663,7 @@
154 from portage.const import CACHE_PATH
155 from urlparse import urlparse
156 urldata = urlparse(base_url)
157 - pkgindex_file = os.path.join(CACHE_PATH, "binhost",
158 + pkgindex_file = os.path.join(self.settings["ROOT"], CACHE_PATH, "binhost",
159 urldata[1] + urldata[2], "Packages")
160 pkgindex = self._new_pkgindex()
161 try:
162
163 Modified: main/branches/prefix/pym/portage/dbapi/vartree.py
164 ===================================================================
165 --- main/branches/prefix/pym/portage/dbapi/vartree.py 2009-09-05 10:55:47 UTC (rev 14194)
166 +++ main/branches/prefix/pym/portage/dbapi/vartree.py 2009-09-05 11:00:20 UTC (rev 14195)
167 @@ -1522,9 +1522,9 @@
168 "repository", "RESTRICT" , "SLOT", "USE"])
169 self._aux_cache_obj = None
170 self._aux_cache_filename = os.path.join(self.root,
171 - CACHE_PATH.lstrip(os.path.sep), "vdb_metadata.pickle")
172 + CACHE_PATH, "vdb_metadata.pickle")
173 self._counter_path = os.path.join(root,
174 - CACHE_PATH.lstrip(os.path.sep), "counter")
175 + CACHE_PATH, "counter")
176
177 try:
178 self.plib_registry = PreservedLibsRegistry(self.root,
179 @@ -1785,7 +1785,7 @@
180 return list(self._iter_match(mydep,
181 self.cp_list(mydep.cp, use_cache=use_cache)))
182 try:
183 - curmtime = os.stat(self.root+VDB_PATH+"/"+mycat).st_mtime
184 + curmtime = os.stat(os.path.join(self.root, VDB_PATH, mycat)).st_mtime
185 except (IOError, OSError):
186 curmtime=0
187
188
189 Modified: main/branches/prefix/pym/portage/glsa.py
190 ===================================================================
191 --- main/branches/prefix/pym/portage/glsa.py 2009-09-05 10:55:47 UTC (rev 14194)
192 +++ main/branches/prefix/pym/portage/glsa.py 2009-09-05 11:00:20 UTC (rev 14195)
193 @@ -33,7 +33,7 @@
194 @rtype: list
195 @return: list of glsa IDs
196 """
197 - return grabfile(os.path.join(os.sep, settings["ROOT"], CACHE_PATH.lstrip(os.sep), "glsa"))
198 + return grabfile(os.path.join(os.sep, settings["ROOT"], CACHE_PATH, "glsa"))
199
200
201 # TODO: use the textwrap module instead
202 @@ -655,7 +655,7 @@
203 if not self.isApplied():
204 checkfile = codecs.open(
205 _unicode_encode(os.path.join(os.sep, self.config["ROOT"],
206 - CACHE_PATH.lstrip(os.sep), "glsa"),
207 + CACHE_PATH, "glsa"),
208 encoding=_encodings['fs'], errors='strict'),
209 mode='a+', encoding=_encodings['content'], errors='strict')
210 checkfile.write(self.nr+"\n")
211
212 Modified: main/branches/prefix/pym/portage/sets/files.py
213 ===================================================================
214 --- main/branches/prefix/pym/portage/sets/files.py 2009-09-05 10:55:47 UTC (rev 14194)
215 +++ main/branches/prefix/pym/portage/sets/files.py 2009-09-05 11:00:20 UTC (rev 14195)
216 @@ -212,11 +212,11 @@
217 # most attributes exist twice as atoms and non-atoms are stored in
218 # separate files
219 self._lock = None
220 - self._filename = os.path.join(os.sep, root, EPREFIX_LSTRIP, PRIVATE_PATH.lstrip(os.sep), "world")
221 + self._filename = os.path.join(os.sep, root, EPREFIX_LSTRIP, PRIVATE_PATH, "world")
222 self.loader = ItemFileLoader(self._filename, self._validate)
223 self._mtime = None
224
225 - self._filename2 = os.path.join(os.sep, root, EPREFIX_LSTRIP, PRIVATE_PATH.lstrip(os.sep), "world_sets")
226 + self._filename2 = os.path.join(os.sep, root, EPREFIX_LSTRIP, PRIVATE_PATH, "world_sets")
227 self.loader2 = ItemFileLoader(self._filename2, self._validate2)
228 self._mtime2 = None