# 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)
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}"
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}"
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)
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)
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):
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