From: Fabian Groffen Date: Thu, 8 Jan 2009 20:13:34 +0000 (-0000) Subject: Merged from trunk -r12384:12389 X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=5d6404cde76abed72a6f939d691a5c92026a4406;p=portage.git Merged from trunk -r12384:12389 | 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 --- diff --git a/bin/ebuild.sh b/bin/ebuild.sh index a7442cbc3..64250ccf9 100755 --- a/bin/ebuild.sh +++ b/bin/ebuild.sh @@ -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) diff --git a/bin/prepstrip b/bin/prepstrip index 7cbab9ac6..49c886cb8 100755 --- a/bin/prepstrip +++ b/bin/prepstrip @@ -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}" diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py index fb25365b4..af9cdee6f 100644 --- a/pym/_emerge/__init__.py +++ b/pym/_emerge/__init__.py @@ -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