Gentoo Archives: gentoo-commits

From: "Fabian Groffen (grobian)" <grobian@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] portage r13236 - in main/branches/prefix: bin bin/ebuild-helpers pym/portage pym/portage/dbapi
Date: Fri, 27 Mar 2009 12:03:06
Message-Id: E1LnAm7-00035O-BY@stork.gentoo.org
1 Author: grobian
2 Date: 2009-03-27 12:03:02 +0000 (Fri, 27 Mar 2009)
3 New Revision: 13236
4
5 Modified:
6 main/branches/prefix/bin/ebuild-helpers/doexe
7 main/branches/prefix/bin/ebuild.sh
8 main/branches/prefix/pym/portage/__init__.py
9 main/branches/prefix/pym/portage/dbapi/porttree.py
10 Log:
11 Merged from trunk -r13200:13232
12
13 | 13201 | For consistency in output with other helpers, check for file |
14 | zmedico | existence before calling install. |
15
16 | 13202 | When copying symlink targets to temp files, use a private |
17 | zmedico | temp dir inside $T instead of using $T directly. |
18
19 | 13222 | In dyn_unpack(), don't force a new unpack when the ebuild |
20 | zmedico | mtime is newer than $WORKDIR, since that may be too touchy. |
21 | | The user can easily call the clean phase explicitly if they |
22 | | really want it. |
23
24 | 13224 | In portdbapi.findname2(), move some of the path joining out |
25 | zmedico | of the loop. |
26
27 | 13226 | Inside config.setcpv(), don't clear out |
28 | zmedico | self.configdict['pkg'] entirely since some values need to be |
29 | | reused sometimes. |
30
31 | 13227 | In config.setcpv(), make sure the current args are really |
32 | zmedico | identical to the previous args before returning early. |
33
34 | 13230 | Fix typo in comment. |
35 | zmedico | |
36
37 | 13232 | Make the argument hash in config.setcpv() a little stronger. |
38 | zmedico | |
39
40
41 Modified: main/branches/prefix/bin/ebuild-helpers/doexe
42 ===================================================================
43 --- main/branches/prefix/bin/ebuild-helpers/doexe 2009-03-27 11:45:43 UTC (rev 13235)
44 +++ main/branches/prefix/bin/ebuild-helpers/doexe 2009-03-27 12:03:02 UTC (rev 13236)
45 @@ -14,23 +14,30 @@
46 install -d "${ED}${_E_EXEDESTTREE_}"
47 fi
48
49 +TMP=$T/.doexe_tmp
50 +mkdir "$TMP"
51 +
52 ret=0
53
54 for x in "$@" ; do
55 if [ -L "${x}" ] ; then
56 - cp "${x}" "${T}"
57 - mysrc="$T/${x##*/}"
58 + cp "$x" "$TMP"
59 + mysrc=$TMP/${x##*/}
60 elif [ -d "${x}" ] ; then
61 vecho "doexe: warning, skipping directory ${x}"
62 continue
63 else
64 mysrc="${x}"
65 fi
66 - if ! install $EXEOPTIONS "$mysrc" "$ED$_E_EXEDESTTREE_" ; then
67 + if [ -e "$mysrc" ] ; then
68 + install $EXEOPTIONS "$mysrc" "$ED$_E_EXEDESTTREE_"
69 + else
70 echo "!!! ${0##*/}: $mysrc does not exist" 1>&2
71 false
72 fi
73 ((ret+=$?))
74 done
75
76 +rm -rf "$TMP"
77 +
78 exit $ret
79
80 Modified: main/branches/prefix/bin/ebuild.sh
81 ===================================================================
82 --- main/branches/prefix/bin/ebuild.sh 2009-03-27 11:45:43 UTC (rev 13235)
83 +++ main/branches/prefix/bin/ebuild.sh 2009-03-27 12:03:02 UTC (rev 13236)
84 @@ -665,10 +665,7 @@
85 break
86 fi
87 done
88 - if [ "${EBUILD}" -nt "${WORKDIR}" ] && ! hasq keepwork ${FEATURES} ; then
89 - vecho ">>> ${EBUILD} has been updated; recreating WORKDIR..."
90 - newstuff="yes"
91 - elif [ ! -f "${PORTAGE_BUILDDIR}/.unpacked" ]; then
92 + if [ ! -f "${PORTAGE_BUILDDIR}/.unpacked" ] ; then
93 vecho ">>> Not marked as unpacked; recreating WORKDIR..."
94 newstuff="yes"
95 fi
96
97 Modified: main/branches/prefix/pym/portage/__init__.py
98 ===================================================================
99 --- main/branches/prefix/pym/portage/__init__.py 2009-03-27 11:45:43 UTC (rev 13235)
100 +++ main/branches/prefix/pym/portage/__init__.py 2009-03-27 12:03:02 UTC (rev 13236)
101 @@ -1158,6 +1158,7 @@
102
103 self.locked = 0
104 self.mycpv = None
105 + self._setcpv_args_hash = None
106 self.puse = []
107 self.modifiedkeys = []
108 self.uvlist = []
109 @@ -1211,6 +1212,7 @@
110 self.make_defaults_use = copy.deepcopy(clone.make_defaults_use)
111 self.pkgprofileuse = copy.deepcopy(clone.pkgprofileuse)
112 self.mycpv = copy.deepcopy(clone.mycpv)
113 + self._setcpv_args_hash = copy.deepcopy(clone._setcpv_args_hash)
114
115 self.configlist = copy.deepcopy(clone.configlist)
116 self.lookuplist = self.configlist[:]
117 @@ -2104,9 +2106,14 @@
118 pkg = mycpv
119 mycpv = pkg.cpv
120 mydb = pkg.metadata
121 + args_hash = (mycpv, id(pkg))
122 + else:
123 + args_hash = (mycpv, id(mydb))
124
125 - if self.mycpv == mycpv:
126 + if args_hash == self._setcpv_args_hash:
127 return
128 + self._setcpv_args_hash = args_hash
129 +
130 has_changed = False
131 self.mycpv = mycpv
132 cat, pf = catsplit(mycpv)
133 @@ -2117,16 +2124,23 @@
134 env_configdict = self.configdict["env"]
135 pkg_configdict = self.configdict["pkg"]
136 previous_iuse = pkg_configdict.get("IUSE")
137 - pkg_configdict.clear()
138 +
139 + aux_keys = [k for k in auxdbkeys \
140 + if not k.startswith("UNUSED_")]
141 + aux_keys.append("repository")
142 +
143 + # Discard any existing metadata from the previous package, but
144 + # preserve things like USE_EXPAND values and PORTAGE_USE which
145 + # might be reused.
146 + for k in aux_keys:
147 + pkg_configdict.pop(k, None)
148 +
149 pkg_configdict["CATEGORY"] = cat
150 pkg_configdict["PF"] = pf
151 if mydb:
152 if not hasattr(mydb, "aux_get"):
153 pkg_configdict.update(mydb)
154 else:
155 - aux_keys = [k for k in auxdbkeys \
156 - if not k.startswith("UNUSED_")]
157 - aux_keys.append("repository")
158 for k, v in izip(aux_keys, mydb.aux_get(self.mycpv, aux_keys)):
159 pkg_configdict[k] = v
160 repository = pkg_configdict.pop("repository", None)
161 @@ -5078,7 +5092,7 @@
162
163 # Generally, it's best not to assume that cache entries for unsupported EAPIs
164 # can be validated. However, the current package manager specification does not
165 -# guarantee that that the EAPI can be parsed without sourcing the ebuild, so
166 +# guarantee that the EAPI can be parsed without sourcing the ebuild, so
167 # it's too costly to discard existing cache entries for unsupported EAPIs.
168 # Therefore, by default, assume that cache entries for unsupported EAPIs can be
169 # validated. If FEATURES=parse-eapi-* is enabled, this assumption is discarded
170
171 Modified: main/branches/prefix/pym/portage/dbapi/porttree.py
172 ===================================================================
173 --- main/branches/prefix/pym/portage/dbapi/porttree.py 2009-03-27 11:45:43 UTC (rev 13235)
174 +++ main/branches/prefix/pym/portage/dbapi/porttree.py 2009-03-27 12:03:02 UTC (rev 13236)
175 @@ -279,11 +279,14 @@
176 else:
177 mytrees = self.porttrees[:]
178 mytrees.reverse()
179 +
180 + relative_path = os.path.join(mysplit[0], psplit[0],
181 + mysplit[1] + ".ebuild")
182 +
183 if 'parse-eapi-glep-55' in self.doebuild_settings.features:
184 glep55_startswith = '%s.ebuild-' % mysplit[1]
185 for x in mytrees:
186 - filename = os.path.join(x, mysplit[0], psplit[0],
187 - mysplit[1] + ".ebuild")
188 + filename = x + os.sep + relative_path
189 if os.access(filename, os.R_OK):
190 return (filename, x)
191
192 @@ -297,7 +300,7 @@
193 return (os.path.join(pkgdir, y), x)
194 else:
195 for x in mytrees:
196 - file=x+"/"+mysplit[0]+"/"+psplit[0]+"/"+mysplit[1]+".ebuild"
197 + file = x + os.sep + relative_path
198 if os.access(file, os.R_OK):
199 return[file, x]
200 return None, 0