}
dyn_unpack() {
- trap "abort_unpack" SIGINT SIGQUIT
[ "$(type -t pre_src_unpack)" == "function" ] && pre_src_unpack
local newstuff="no"
if [ -e "${WORKDIR}" ]; then
cd "${PORTAGE_BUILDDIR}"
[ "$(type -t post_src_unpack)" == "function" ] && post_src_unpack
-
- trap SIGINT SIGQUIT
}
dyn_clean() {
exit 1
}
-abort_unpack() {
- abort_handler "src_unpack" $1
- rm -f "${PORTAGE_BUILDDIR}/.unpacked"
- rm -rf "${PORTAGE_BUILDDIR}/work"
- exit 1
-}
-
abort_test() {
abort_handler "dyn_test" $1
rm -f "${PORTAGE_BUILDDIR}/.tested"
cache_valid = self._cache_data and \
isinstance(self._cache_data, dict) and \
self._cache_data.get("version") == self._cache_version and \
- self._cache_data["virtuals"] == self._virtuals and \
- set(self._cache_data["blockers"]) == self._installed_pkgs
+ self._cache_data.get("virtuals") == self._virtuals and \
+ set(self._cache_data.get("blockers", [])) == self._installed_pkgs
if cache_valid:
for pkg in self._installed_pkgs:
if long(self._vardb.aux_get(pkg, ["COUNTER"])[0]) != \
((jbigkey, myparents), (existing_node, e_parents)))
# Now add this node to the graph so that self.display()
- # can work with it show use flags and --tree output.
- self.useFlags[myroot][mykey] = myuse
+ # can show use flags and --tree output. This node is
+ # only being partially added to the graph. It must not be
+ # allowed to interfere with the other nodes that have been
+ # added. Do not overwrite data for existing nodes in
+ # self.pkg_node_map and self.mydbapi since that data will
+ # be used for blocker validation.
+ self.pkg_node_map[myroot].setdefault(mykey, jbigkey)
+ self.useFlags[myroot].setdefault(mykey, myuse)
self._parent_child_digraph.add(jbigkey, myparent)
if rev_dep and myparent:
self.digraph.add(myparent, jbigkey,
portage_dep._dep_check_strict = True
if not mycheck[0]:
- show_invalid_depstring_notice(myparent, depstring, mycheck[1])
+ if myparent:
+ show_invalid_depstring_notice(myparent, depstring, mycheck[1])
+ else:
+ sys.stderr.write("\n%s\n%s\n" % (depstring, mycheck[1]))
return 0
mymerge = mycheck[1]
return 0
if not numselected:
- print "\n>>> No packages selected for removal by", \
- unmerge_action+".\n"
+ portage.writemsg_stdout(
+ "\n>>> No packages selected for removal by " + \
+ unmerge_action + "\n")
return 0
finally:
if vdb_lock:
for f in list(use):
if f.startswith(flag_prefix):
use.remove(f)
+ use = list(use)
+ use.sort()
print 'USE="%s"' % " ".join(use),
for varname in use_expand:
myval = settings.get(varname)
rm -f "${ED}/usr/share/info/dir.gz"
fi
- if hasq multilib-strict ${FEATURES} && [ -x file -a -x find -a \
- -n "${MULTILIB_STRICT_DIRS}" -a -n "${MULTILIB_STRICT_DENY}" ]; then
- local abort=no firstrun=yes
+ if hasq multilib-strict ${FEATURES} && \
+ [[ -x ${EPREFIX}/usr/bin/file && -x ${EPREFIX}/usr/bin/find ]] && \
+ [[ -n ${MULTILIB_STRICT_DIRS} && -n ${MULTILIB_STRICT_DENY} ]]
+ then
+ local abort=no firstrun=yes
MULTILIB_STRICT_EXEMPT=$(echo ${MULTILIB_STRICT_EXEMPT} | sed -e 's:\([(|)]\):\\\1:g')
- for dir in ${MULTILIB_STRICT_DIRS}; do
- [ -d "${ED}/${dir}" ] || continue
+ for dir in ${MULTILIB_STRICT_DIRS} ; do
+ [[ -d ${ED}/${dir} ]] || continue
for file in $(find ${ED}/${dir} -type f | grep -v "^${ED}/${dir}/${MULTILIB_STRICT_EXEMPT}"); do
if file ${file} | egrep -q "${MULTILIB_STRICT_DENY}" ; then
if [[ ${firstrun} == yes ]] ; then
for j in "${i}"/*.so.* "${i}"/*.so ; do
[[ ! -e ${j} ]] && continue
- [[ -L ${j} ]] && continue
+ if [[ -L ${j} ]] ; then
+ linkdest=$(readlink "${j}")
+ if [[ ${linkdest} == /* ]] ; then
+ vecho -e "\a"
+ vecho "QA Notice: Found an absolute symlink in a library directory:"
+ vecho " ${j#${D}} -> ${linkdest}"
+ vecho " It should be a relative symlink if in the same directory"
+ vecho " or a linker script if it crosses the /usr boundary."
+ fi
+ continue
+ fi
[[ -x ${j} ]] && continue
- echo "making executable: /${j/${D}/}"
+ vecho "making executable: ${j#${D}}"
chmod +x "${j}"
done
[[ ! -e ${j} ]] && continue
[[ -L ${j} ]] && continue
[[ ! -x ${j} ]] && continue
- echo "removing executable bit: /${j/${D}/}"
+ vecho "removing executable bit: ${j#${D}}"
chmod -x "${j}"
done
done
if [[ ! -e ${s} ]] ; then
s=${s%usr/*}${s##*/usr/}
if [[ -e ${s} ]] ; then
- echo -e "\aQA Notice: missing gen_usr_ldscript for ${s##*/}\a"
+ vecho -e "\aQA Notice: missing gen_usr_ldscript for ${s##*/}\a"
sleep 1
fi
fi
# Make sure people don't store libtool files or static libs in /lib
f=$(ls "${ED}"/lib*/*.{a,la} 2>/dev/null)
if [[ -n ${f} ]] ; then
- echo -e "\n\aQA Notice: excessive files found in the / partition\a"
- echo "${f}"
+ vecho -e "\n\aQA Notice: excessive files found in the / partition\a"
+ vecho "${f}"
sleep 1
fi
for a in "${ED}"/usr/lib*/*.la ; do
s=${a##*/}
if grep -qs "${ED}" "${a}" ; then
- echo -e "\n\aQA Notice: ${s} appears to contain PORTAGE_TMPDIR paths\a"
+ vecho -e "\n\aQA Notice: ${s} appears to contain PORTAGE_TMPDIR paths\a"
sleep 1
fi
done
for d in "${ED}"/lib* "${ED}"/usr/lib* ; do
f=$(scanelf -ByF '%S %p' "${d}"/lib*.so* | gawk '$2 == "" { print }')
if [[ -n ${f} ]] ; then
- echo -e "\n\aQA Notice: the following shared libraries lack a SONAME\a"
- echo "${f}"
- echo
+ vecho -e "\n\aQA Notice: the following shared libraries lack a SONAME\a"
+ vecho "${f}"
+ vecho
sleep 1
fi
f=$(scanelf -ByF '%n %p' "${d}"/lib*.so* | gawk '$2 == "" { print }')
if [[ -n ${f} ]] ; then
- echo -e "\n\aQA Notice: the following shared libraries lack NEEDED entries\a"
- echo "${f}"
- echo
+ vecho -e "\n\aQA Notice: the following shared libraries lack NEEDED entries\a"
+ vecho "${f}"
+ vecho
sleep 1
fi
done
# d) is the first item
preferred = []
+ possible_upgrades = []
other = []
# Alias the trees we'll be checking availability against
# an installed package. If they will then don't prefer them
# over other atoms.
is_downgrade = False
- if all_installed and all_available:
+ versions = {}
+ if all_installed or all_available:
for atom in atoms:
mykey = dep_getkey(atom)
- inst_pkgs = vardb.match(mykey)
- if not inst_pkgs:
- # This must be a new-style virtual that isn't really
- # installed yet (they have zero cost to install).
- continue
avail_pkg = best(mydbapi.match(atom))
+ if not avail_pkg:
+ continue
avail_slot = mydbapi.aux_get(avail_pkg, ["SLOT"])[0]
+ versions["%s:%s" % (mykey, avail_slot)] = avail_pkg
avail_split = catpkgsplit(avail_pkg)[1:]
+ inst_pkgs = vardb.match(mykey)
+ if not inst_pkgs:
+ continue
for pkg in inst_pkgs:
if avail_slot != vardb.aux_get(pkg, ["SLOT"])[0]:
continue
if is_downgrade:
break
- if all_installed and not is_downgrade:
- preferred.append((atoms, all_available))
- else:
- other.append((atoms, all_available))
+ this_choice = (atoms, versions, all_available)
+ if not is_downgrade:
+ if all_installed:
+ preferred.append(this_choice)
+ continue
+ elif all_available:
+ possible_upgrades.append(this_choice)
+ continue
+ other.append(this_choice)
+
+ # Compare the "all_installed" choices against the "all_available" choices
+ # for possible missed upgrades. The main purpose of this code is to find
+ # upgrades of new-style virtuals since _expand_new_virtuals() expands them
+ # into || ( highest version ... lowest version ). We want to prefer the
+ # highest all_available version of the new-style virtual when there is a
+ # lower all_installed version.
+ for possible_upgrade in list(possible_upgrades):
+ atoms, versions, all_available = possible_upgrade
+ myslots = set(versions)
+ for other_choice in preferred:
+ o_atoms, o_versions, o_all_available = other_choice
+ intersecting_slots = myslots.intersection(o_versions)
+ if not intersecting_slots:
+ continue
+ has_upgrade = False
+ has_downgrade = False
+ for myslot in intersecting_slots:
+ myversion = versions[myslot]
+ o_version = o_versions[myslot]
+ if myversion != o_version:
+ if myversion == best([myversion, o_version]):
+ has_upgrade = True
+ else:
+ has_downgrade = True
+ break
+ if has_upgrade and not has_downgrade:
+ o_index = preferred.index(other_choice)
+ preferred.insert(o_index, possible_upgrade)
+ possible_upgrades.remove(possible_upgrade)
+ break
+ preferred.extend(possible_upgrades)
# preferred now contains a) and c) from the order above with
# the masked flag differentiating the two. other contains b)
preferred.extend(other)
for allow_masked in (False, True):
- for atoms, all_available in preferred:
+ for atoms, versions, all_available in preferred:
if all_available or allow_masked:
return atoms
pass
if not self._aux_cache or \
not isinstance(self._aux_cache, dict) or \
- self._aux_cache.get("version") != self._aux_cache_version:
+ self._aux_cache.get("version") != self._aux_cache_version or \
+ not self._aux_cache.get("packages"):
self._aux_cache = {"version":self._aux_cache_version}
self._aux_cache["packages"] = {}
self._aux_cache["modified"] = False