Merged from trunk -r12384:12389
authorFabian Groffen <grobian@gentoo.org>
Thu, 8 Jan 2009 20:13:34 +0000 (20:13 -0000)
committerFabian Groffen <grobian@gentoo.org>
Thu, 8 Jan 2009 20:13:34 +0000 (20:13 -0000)
   | 12385   | Bug #252354 - Ensure that hardlinked files are not processed |
   | zmedico | multiple times when necessary.                               |

   | 12386   | Fix quoting for variable assignment with eval, from previous |
   | zmedico | commit.                                                      |

   | 12387   | For completeness, ensure that any INODE_* are unset before   |
   | zmedico | beginning.                                                   |

   | 12388   | Bug #254114 - Fix ValueError triggered by missing COUNTER.   |
   | zmedico | Also, fix broken mtime check inside FakeVartree._sync().     |

   | 12389   | Bug #250469 - Fix unpack() so that deb2targz is called in a  |
   | zmedico | way such that $DISTDIR write access is not required.         |

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

bin/ebuild.sh
bin/prepstrip
pym/_emerge/__init__.py

index a7442cbc31a9bb28a51d7d965833531a5f645e29..64250ccf99d38b84c67fec25739c843303083267 100755 (executable)
@@ -406,10 +406,24 @@ unpack() {
                                # that reason.  We just make sure on AIX `deb2targz` is
                                # installed.
                                if type -P deb2targz > /dev/null; then
-                                       deb2targz "${srcdir}/${x}" || die "$myfail"
-                                       mv "${srcdir}/${x/.deb/.tar.gz}" data.tar.gz
+                                       y=${x##*/}
+                                       local created_symlink=0
+                                       if [ ! "$srcdir$x" -ef "$y" ] ; then
+                                               # deb2targz always extracts into the same directory as
+                                               # the source file, so create a symlink in the current
+                                               # working directory if necessary.
+                                               ln -sf "$srcdir$x" "$y" || die "$myfail"
+                                               created_symlink=1
+                                       fi
+                                       deb2targz "$y" || die "$myfail"
+                                       if [ $created_symlink = 1 ] ; then
+                                               # Clean up the symlink so the ebuild
+                                               # doesn't inadvertently install it.
+                                               rm -f "$y"
+                                       fi
+                                       mv -f "${y%.deb}".tar.gz data.tar.gz || die "$myfail"
                                else
-                                       ar x "${srcdir}/${x}" || die "$myfail"
+                                       ar x "$srcdir$x" || die "$myfail"
                                fi
                                ;;
                        lzma)
index 7cbab9ac65adf067c2865718148a7c4ae64f60d6..49c886cb8b7d2ac970adf6c0b0966c2860e993b5 100755 (executable)
@@ -30,12 +30,24 @@ if hasq installsources ${FEATURES} && ! type -P debugedit >/dev/null ; then
        ewarn "be found. This feature will not work unless debugedit is installed!"
 fi
 
+unset ${!INODE_*}
+
+inode_var_name() {
+       if  [[ $USERLAND = BSD ]] ; then
+               stat -f 'INODE_%d_%i' "$1"
+       else
+               stat -c 'INODE_%d_%i' "$1"
+       fi
+}
+
 save_elf_sources() {
        hasq installsources ${FEATURES} || return 0
        hasq installsources ${RESTRICT} && return 0
        type -P debugedit >/dev/null || return 0
 
        local x=$1
+       local inode=$(inode_var_name "$x")
+       [[ -n ${!inode} ]] && return 0
        local sources_dir=${EPREFIX}/usr/src/debug/${CATEGORY}/${PF}
        debugedit -b "${WORKDIR}" -d "${sources_dir}" \
                -l "${T}"/debug.sources "${x}"
@@ -60,11 +72,18 @@ save_elf_debug() {
        local buildid="$( type -P debugedit >/dev/null && debugedit -i "${x}" )"
 
        mkdir -p $(dirname "${y}")
-       ${OBJCOPY} --only-keep-debug "${x}" "${y}"
-       ${OBJCOPY} --add-gnu-debuglink="${y}" "${x}"
-       [[ -g ${x} ]] && chmod go-r "${y}"
-       [[ -u ${x} ]] && chmod go-r "${y}"
-       chmod a-x,o-w "${y}"
+
+       local inode=$(inode_var_name "$x")
+       if [[ -n ${!inode} ]] ; then
+               ln "${D}usr/lib/debug/${!inode:${#D}}.debug" "$y"
+       else
+               eval $inode=\$x
+               ${OBJCOPY} --only-keep-debug "${x}" "${y}"
+               ${OBJCOPY} --add-gnu-debuglink="${y}" "${x}"
+               [[ -g ${x} ]] && chmod go-r "${y}"
+               [[ -u ${x} ]] && chmod go-r "${y}"
+               chmod a-x,o-w "${y}"
+       fi
 
        if [[ -n ${buildid} ]] ; then
                local buildid_dir="${D}usr/lib/debug/.build-id/${buildid:0:2}"
index fb25365b462f5af72756f3a963bc89bfa505b392..af9cdee6febd2cee7cd7f687660bca2f3d7ae1a7 100644 (file)
@@ -1062,6 +1062,9 @@ class FakeVartree(portage.vartree):
                self.root = real_vartree.root
                self.settings = real_vartree.settings
                mykeys = list(real_vartree.dbapi._aux_cache_keys)
+               if "_mtime_" not in mykeys:
+                       mykeys.append("_mtime_")
+               self._db_keys = mykeys
                self._pkg_cache = pkg_cache
                self.dbapi = PackageVirtualDbapi(real_vartree.settings)
                vdb_path = os.path.join(self.root, portage.VDB_PATH)
@@ -1200,8 +1203,12 @@ class FakeVartree(portage.vartree):
                        pkg = pkg_vardb.get(pkg_hash_key)
                        if pkg is not None:
                                counter, mtime = real_vardb.aux_get(cpv, validation_keys)
+                               try:
+                                       counter = long(counter)
+                               except ValueError:
+                                       counter = 0
 
-                               if counter != pkg.metadata["COUNTER"] or \
+                               if counter != pkg.counter or \
                                        mtime != pkg.mtime:
                                        pkg_vardb.cpv_remove(pkg)
                                        aux_get_history.discard(pkg.cpv)
@@ -1223,11 +1230,18 @@ class FakeVartree(portage.vartree):
        def _pkg(self, cpv):
                root_config = self._root_config
                real_vardb = root_config.trees["vartree"].dbapi
-               db_keys = list(real_vardb._aux_cache_keys)
                pkg = Package(cpv=cpv, installed=True,
-                       metadata=izip(db_keys, real_vardb.aux_get(cpv, db_keys)),
+                       metadata=izip(self._db_keys,
+                       real_vardb.aux_get(cpv, self._db_keys)),
                        root_config=root_config,
                        type_name="installed")
+
+               try:
+                       mycounter = long(pkg.metadata["COUNTER"])
+               except ValueError:
+                       mycounter = 0
+                       pkg.metadata["COUNTER"] = str(mycounter)
+
                return pkg
 
 def grab_global_updates(portdir):
@@ -1586,7 +1600,7 @@ class _PackageMetadataWrapper(_PackageMetadataWrapperBase):
        def _set_counter(self, k, v):
                if isinstance(v, basestring):
                        try:
-                               v = int(v.strip())
+                               v = long(v.strip())
                        except ValueError:
                                v = 0
                self._pkg.counter = v