exit 1
fi
+TMP=$T/.doins_tmp
+mkdir "$TMP"
+
if [[ ${INSDESTTREE#${EPREFIX}} != "${INSDESTTREE}" ]]; then
vecho "-------------------------------------------------------" 1>&2
vecho "You should not use \${EPREFIX} with helpers." 1>&2
local mysrc="$1" mydir="$2" cleanup="" rval
if [ -L "$mysrc" ] ; then
- cp "$mysrc" "${T}"
- mysrc="${T}/${mysrc##*/}"
+ cp "$mysrc" "$TMP"
+ mysrc="$TMP/${mysrc##*/}"
cleanup=${mysrc}
fi
else
pushd "${x%/*}" >/dev/null
fi
- find "${x##*/}" -type d -exec dodir "${INSDESTTREE}/{}" \;
- find "${x##*/}" \( -type f -or -type l \) -print0 | _xdoins
- popd >/dev/null
+ x=${x##*/}
+ x_orig=$x
+ # Follow any symlinks recursively until we've got
+ # a normal directory for 'find' to traverse.
+ while [ -L "$x" ] ; do
+ pushd "$(readlink "$x")" >/dev/null
+ x=${PWD##*/}
+ pushd "${PWD%/*}" >/dev/null
+ done
+ if [[ $x != $x_orig ]] ; then
+ mv "$x" "$TMP/$x_orig"
+ pushd "$TMP" >/dev/null
+ fi
+ find "$x_orig" -type d -exec dodir "${INSDESTTREE}/{}" \;
+ find "$x_orig" \( -type f -or -type l \) -print0 | _xdoins
+ if [[ $x != $x_orig ]] ; then
+ popd >/dev/null
+ mv "$TMP/$x_orig" "$x"
+ fi
+ while popd >/dev/null 2>&1 ; do true ; done
((++success))
else
_doins "${x}" && ((++success))
fi
done
-
+rm -rf "$TMP"
[ $success -gt 0 ] && exit 0 || exit 1
}
# Ensure that $PWD is sane whenever possible.
-cd "$PORTAGE_BUILDDIR" 2>/dev/null
+if ! hasq "$EBUILD_PHASE" clean depend help ; then
+ cd "$PORTAGE_BUILDDIR" || \
+ die "PORTAGE_BUILDDIR does not exist: '$PORTAGE_BUILDDIR'"
+fi
#if no perms are specified, dirs/files will have decent defaults
#(not secretive, but not stupid)
# result in it wiping the users distfiles directory (bad).
rm -rf "${PORTAGE_BUILDDIR}/distdir"
- if [ -z "$(find "${PORTAGE_BUILDDIR}" -mindepth 1 -maxdepth 1)" ]; then
- rmdir "${PORTAGE_BUILDDIR}"
- fi
+ # Some kernels, such as Solaris, return EINVAL when an attempt
+ # is made to remove the current working directory.
+ cd "$PORTAGE_BUILDDIR"/..
+ rmdir "$PORTAGE_BUILDDIR" 2>/dev/null
true
}
def _show_unsatisfied_dep(self, root, atom, myparent=None, arg=None):
atom = portage.dep.Atom(atom)
+ atom_set = InternalPackageSet(initial_atoms=(atom,))
atom_without_use = atom
if atom.use:
atom_without_use = portage.dep.remove_slot(atom)
for cpv in cpv_list:
metadata, mreasons = get_mask_info(root_config, cpv,
pkgsettings, db, pkg_type, built, installed, db_keys)
- if atom.use and not mreasons:
- missing_use.append(Package(built=built, cpv=cpv,
+ if metadata is not None:
+ pkg = Package(built=built, cpv=cpv,
installed=installed, metadata=metadata,
- root_config=root_config))
- else:
- masked_packages.append(
- (root_config, pkgsettings, cpv, metadata, mreasons))
+ root_config=root_config)
+ if pkg.cp != atom.cp:
+ # A cpv can be returned from dbapi.match() as an
+ # old-style virtual match even in cases when the
+ # package does not actually PROVIDE the virtual.
+ # Filter out any such false matches here.
+ if not atom_set.findAtomForPackage(pkg):
+ continue
+ if atom.use and not mreasons:
+ missing_use.append(pkg)
+ continue
+ masked_packages.append(
+ (root_config, pkgsettings, cpv, metadata, mreasons))
missing_use_reasons = []
missing_iuse_reasons = []
if not isinstance(atom, portage.dep.Atom):
atom = portage.dep.Atom(atom)
atom_cp = atom.cp
+ atom_set = InternalPackageSet(initial_atoms=(atom,))
existing_node = None
myeb = None
usepkgonly = "--usepkgonly" in self.myopts
pkgsettings.setcpv(pkg)
pkg.metadata["USE"] = pkgsettings["PORTAGE_USE"]
+ if pkg.cp != atom.cp:
+ # A cpv can be returned from dbapi.match() as an
+ # old-style virtual match even in cases when the
+ # package does not actually PROVIDE the virtual.
+ # Filter out any such false matches here.
+ if not atom_set.findAtomForPackage(pkg):
+ continue
+
myarg = None
if root == self.target_root:
try:
# Build directory creation isn't required for any of these.
have_build_dirs = False
- if mydo not in ("clean", "cleanrm", "digest",
- "fetch", "help", "manifest"):
+ if mydo not in ("digest", "help", "manifest"):
mystatus = prepare_build_dirs(myroot, mysettings, cleanup)
if mystatus:
return mystatus
raise PermissionDenied(self._filename)
else:
raise e
-
+ self._data_orig = self._data.copy()
def store(self):
""" Store the registry data to file. No need to call this if autocommit
was enabled.
"""
- if os.environ.get("SANDBOX_ON") == "1":
+ if os.environ.get("SANDBOX_ON") == "1" or \
+ self._data == self._data_orig:
return
try:
f = atomic_ofstream(self._filename)
#if we have a file containing previously-merged config file md5sums, grab it.
conf_mem_file = os.path.join(destroot, EPREFIX_LSTRIP, CONFIG_MEMORY_FILE)
cfgfiledict = grabdict(conf_mem_file)
+ cfgfiledict_orig = cfgfiledict.copy()
if "NOCONFMEM" in self.settings:
cfgfiledict["IGNORE"]=1
else:
# write out our collection of md5sums
cfgfiledict.pop("IGNORE", None)
- ensure_dirs(os.path.dirname(conf_mem_file),
- gid=portage_gid, mode=02750, mask=02)
- writedict(cfgfiledict, conf_mem_file)
+ if cfgfiledict != cfgfiledict_orig:
+ ensure_dirs(os.path.dirname(conf_mem_file),
+ gid=portage_gid, mode=02750, mask=02)
+ writedict(cfgfiledict, conf_mem_file)
# These caches are populated during collision-protect and the data
# they contain is now invalid. It's very important to invalidate