Merged from trunk -r13200:13232
authorFabian Groffen <grobian@gentoo.org>
Fri, 27 Mar 2009 12:03:02 +0000 (12:03 -0000)
committerFabian Groffen <grobian@gentoo.org>
Fri, 27 Mar 2009 12:03:02 +0000 (12:03 -0000)
   | 13201   | For consistency in output with other helpers, check for file |
   | zmedico | existence before calling install.                            |

   | 13202   | When copying symlink targets to temp files, use a private    |
   | zmedico | temp dir inside $T instead of using $T directly.             |

   | 13222   | In dyn_unpack(), don't force a new unpack when the ebuild    |
   | zmedico | mtime is newer than $WORKDIR, since that may be too touchy.  |
   |         | The user can easily call the clean phase explicitly if they  |
   |         | really want it.                                              |

   | 13224   | In portdbapi.findname2(), move some of the path joining out  |
   | zmedico | of the loop.                                                 |

   | 13226   | Inside config.setcpv(), don't clear out                      |
   | zmedico | self.configdict['pkg'] entirely since some values need to be |
   |         | reused sometimes.                                            |

   | 13227   | In config.setcpv(), make sure the current args are really    |
   | zmedico | identical to the previous args before returning early.       |

   | 13230   | Fix typo in comment.                                         |
   | zmedico |                                                              |

   | 13232   | Make the argument hash in config.setcpv() a little stronger. |
   | zmedico |                                                              |

svn path=/main/branches/prefix/; revision=13236

bin/ebuild-helpers/doexe
bin/ebuild.sh
pym/portage/__init__.py
pym/portage/dbapi/porttree.py

index fbbf543d7f3b745ffccfb0b9d798361054bf49cd..8fe25c9bf87649b41a1f3c38224f33e567a5b770 100755 (executable)
@@ -14,23 +14,30 @@ if [[ ! -d ${ED}${_E_EXEDESTTREE_} ]] ; then
        install -d "${ED}${_E_EXEDESTTREE_}"
 fi
 
+TMP=$T/.doexe_tmp
+mkdir "$TMP"
+
 ret=0
 
 for x in "$@" ; do
        if [ -L "${x}" ] ; then
-               cp "${x}" "${T}"
-               mysrc="$T/${x##*/}"
+               cp "$x" "$TMP"
+               mysrc=$TMP/${x##*/}
        elif [ -d "${x}" ] ; then
                vecho "doexe: warning, skipping directory ${x}"
                continue
        else
                mysrc="${x}"
        fi
-       if ! install $EXEOPTIONS "$mysrc" "$ED$_E_EXEDESTTREE_" ; then
+       if [ -e "$mysrc" ] ; then
+               install $EXEOPTIONS "$mysrc" "$ED$_E_EXEDESTTREE_"
+       else
                echo "!!! ${0##*/}: $mysrc does not exist" 1>&2
                false
        fi
        ((ret+=$?))
 done
 
+rm -rf "$TMP"
+
 exit $ret
index 281d4a4c77226bb9ba6425e491fd3379716eec4a..7b938b913efebc7c850f2172d713b756be0223d3 100755 (executable)
@@ -665,10 +665,7 @@ dyn_unpack() {
                                break
                        fi
                done
-               if [ "${EBUILD}" -nt "${WORKDIR}" ] && ! hasq keepwork ${FEATURES} ; then
-                       vecho ">>> ${EBUILD} has been updated; recreating WORKDIR..."
-                       newstuff="yes"
-               elif [ ! -f "${PORTAGE_BUILDDIR}/.unpacked" ]; then
+               if [ ! -f "${PORTAGE_BUILDDIR}/.unpacked" ] ; then
                        vecho ">>> Not marked as unpacked; recreating WORKDIR..."
                        newstuff="yes"
                fi
index 711f0b256b39a5774712bc00acaef0421cdddcc5..17d3732365ad0af27b05d402d01340218017a600 100644 (file)
@@ -1158,6 +1158,7 @@ class config(object):
 
                self.locked   = 0
                self.mycpv    = None
+               self._setcpv_args_hash = None
                self.puse     = []
                self.modifiedkeys = []
                self.uvlist = []
@@ -1211,6 +1212,7 @@ class config(object):
                        self.make_defaults_use = copy.deepcopy(clone.make_defaults_use)
                        self.pkgprofileuse = copy.deepcopy(clone.pkgprofileuse)
                        self.mycpv    = copy.deepcopy(clone.mycpv)
+                       self._setcpv_args_hash = copy.deepcopy(clone._setcpv_args_hash)
 
                        self.configlist = copy.deepcopy(clone.configlist)
                        self.lookuplist = self.configlist[:]
@@ -2104,9 +2106,14 @@ class config(object):
                        pkg = mycpv
                        mycpv = pkg.cpv
                        mydb = pkg.metadata
+                       args_hash = (mycpv, id(pkg))
+               else:
+                       args_hash = (mycpv, id(mydb))
 
-               if self.mycpv == mycpv:
+               if args_hash == self._setcpv_args_hash:
                        return
+               self._setcpv_args_hash = args_hash
+
                has_changed = False
                self.mycpv = mycpv
                cat, pf = catsplit(mycpv)
@@ -2117,16 +2124,23 @@ class config(object):
                env_configdict = self.configdict["env"]
                pkg_configdict = self.configdict["pkg"]
                previous_iuse = pkg_configdict.get("IUSE")
-               pkg_configdict.clear()
+
+               aux_keys = [k for k in auxdbkeys \
+                       if not k.startswith("UNUSED_")]
+               aux_keys.append("repository")
+
+               # Discard any existing metadata from the previous package, but
+               # preserve things like USE_EXPAND values and PORTAGE_USE which
+               # might be reused.
+               for k in aux_keys:
+                       pkg_configdict.pop(k, None)
+
                pkg_configdict["CATEGORY"] = cat
                pkg_configdict["PF"] = pf
                if mydb:
                        if not hasattr(mydb, "aux_get"):
                                pkg_configdict.update(mydb)
                        else:
-                               aux_keys = [k for k in auxdbkeys \
-                                       if not k.startswith("UNUSED_")]
-                               aux_keys.append("repository")
                                for k, v in izip(aux_keys, mydb.aux_get(self.mycpv, aux_keys)):
                                        pkg_configdict[k] = v
                        repository = pkg_configdict.pop("repository", None)
@@ -5078,7 +5092,7 @@ def eapi_is_supported(eapi):
 
 # Generally, it's best not to assume that cache entries for unsupported EAPIs
 # can be validated. However, the current package manager specification does not
-# guarantee that that the EAPI can be parsed without sourcing the ebuild, so
+# guarantee that the EAPI can be parsed without sourcing the ebuild, so
 # it's too costly to discard existing cache entries for unsupported EAPIs.
 # Therefore, by default, assume that cache entries for unsupported EAPIs can be
 # validated. If FEATURES=parse-eapi-* is enabled, this assumption is discarded
index 126d3606c5cc91c29614dc80069f57f716e499e4..c94a2965d0fe87e4d249496225203a9582eec8b1 100644 (file)
@@ -279,11 +279,14 @@ class portdbapi(dbapi):
                else:
                        mytrees = self.porttrees[:]
                        mytrees.reverse()
+
+               relative_path = os.path.join(mysplit[0], psplit[0],
+                       mysplit[1] + ".ebuild")
+
                if 'parse-eapi-glep-55' in self.doebuild_settings.features:
                        glep55_startswith = '%s.ebuild-' % mysplit[1]
                        for x in mytrees:
-                               filename = os.path.join(x, mysplit[0], psplit[0],
-                                       mysplit[1] + ".ebuild")
+                               filename = x + os.sep + relative_path
                                if os.access(filename, os.R_OK):
                                        return (filename, x)
 
@@ -297,7 +300,7 @@ class portdbapi(dbapi):
                                                return (os.path.join(pkgdir, y), x)
                else:
                        for x in mytrees:
-                               file=x+"/"+mysplit[0]+"/"+psplit[0]+"/"+mysplit[1]+".ebuild"
+                               file = x + os.sep + relative_path
                                if os.access(file, os.R_OK):
                                        return[file, x]
                return None, 0