#check for blocking dependencies
if "--fetchonly" not in self.myopts and \
+ "--fetch-all-uri" not in self.myopts and \
"--buildpkgonly" not in self.myopts:
for x in mylist:
if x[0]=="blocks":
print "!!! Please use 'emerge --pretend' to determine blockers."
if "--quiet" not in self.myopts:
show_blocker_docs_link()
- if "--pretend" not in self.myopts:
- try:
- del mtimedb["resume"]
- except KeyError:
- pass
- sys.exit(1)
+ return 1
+
+ # Verify all the manifests now so that the user is notified of failure
+ # as soon as possible.
+ if "--fetchonly" not in self.myopts and \
+ "--fetch-all-uri" not in self.myopts and \
+ len(mylist) > 1 and \
+ "strict" in self.settings.features:
+ shown_verifying_msg = False
+ quiet_settings = {}
+ for myroot, pkgsettings in self.pkgsettings.iteritems():
+ quiet_config = portage.config(clone=pkgsettings)
+ quiet_config["PORTAGE_QUIET"] = "1"
+ quiet_config.backup_changes("PORTAGE_QUIET")
+ quiet_settings[myroot] = quiet_config
+ del quiet_config
+ for x in mylist:
+ if x[0] != "ebuild" or x[-1] == "nomerge":
+ continue
+ if not shown_verifying_msg:
+ shown_verifying_msg = True
+ print ">>> Verifying ebuild Manifests..."
+ mytype, myroot, mycpv, mystatus = x
+ portdb = self.trees[myroot]["porttree"].dbapi
+ quiet_config = quiet_settings[myroot]
+ quiet_config["O"] = os.path.dirname(portdb.findname(mycpv))
+ if not portage.digestcheck([], quiet_config, strict=True):
+ return 1
+ del x, mytype, myroot, mycpv, mystatus, quiet_config
+ del shown_verifying_msg, quiet_settings
#buildsyspkg: I need mysysdict also on resume (moved from the else block)
mysysdict = genericdict(getlist(self.settings, "system"))
-# Copyright 1999-2006 Gentoo Foundation
+# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
from portage.output import bold, turquoise, green
def shorthelp():
- print
- print
+ print bold("emerge:")+" the other white meat (command-line interface to the Portage system)"
print bold("Usage:")
print " "+turquoise("emerge")+" [ "+green("options")+" ] [ "+green("action")+" ] [ "+turquoise("ebuildfile")+" | "+turquoise("tbz2file")+" | "+turquoise("dependency")+" ] [ ... ]"
print " "+turquoise("emerge")+" [ "+green("options")+" ] [ "+green("action")+" ] < "+turquoise("system")+" | "+turquoise("world")+" >"
print " ["+green("--nospinner")+"]"
print " [ "+green("--deep")+" ] [" + green("--with-bdeps")+" < " + turquoise("y") + " | "+ turquoise("n")+" > ]"
print bold("Actions:")+" [ "+green("--clean")+" | "+green("--depclean")+" | "+green("--prune")+" | "+green("--regen")+" | "+green("--search")+" | "+green("--unmerge")+" ]"
- print
def help(myaction,myopts,havecolor=1):
- if not myaction and ("--help" not in myopts):
+ if not myaction and ("--verbose" not in myopts):
shorthelp()
print
- print " For more help try 'emerge --help' or consult the man page."
- print
+ print " For more help try 'emerge --help --verbose' or consult the man page."
elif not myaction:
shorthelp()
print
else:
atoms = [dep]
+ if not vardb:
+ # called by repoman
+ other.append((atoms, None, False))
+ continue
+
all_available = True
+ versions = {}
for atom in atoms:
- if not mydbapi.match(atom):
+ avail_pkg = best(mydbapi.match(atom))
+ if not avail_pkg and use_binaries:
# With --usepkgonly, count installed packages as "available".
# Note that --usepkgonly currently has no package.mask support.
# See bug #149816.
- if use_binaries and vardb and vardb.match(atom):
- continue
+ avail_pkg = best(vardb.match(atom))
+ if not avail_pkg:
all_available = False
break
-
- if not vardb:
- # called by repoman
- preferred.append((atoms, None, all_available))
- continue
-
- """ The package names rather than the exact atoms are used for an
- initial rough match against installed packages. More specific
- preference selection is handled later via slot and version comparison."""
- all_installed = True
- for atom in set([dep_getkey(atom) for atom in atoms]):
- # New-style virtuals have zero cost to install.
- if not vardb.match(atom) and not atom.startswith("virtual/"):
- all_installed = False
- break
-
- # Check if the set of atoms will result in a downgrade of
- # an installed package. If they will then don't prefer them
- # over other atoms.
- has_downgrade = False
- versions = {}
- if all_installed or all_available:
- for atom in atoms:
- mykey = dep_getkey(atom)
- avail_pkg = best(mydbapi.match(atom))
- if not avail_pkg:
- continue
- avail_slot = "%s:%s" % (mykey,
- mydbapi.aux_get(avail_pkg, ["SLOT"])[0])
- versions[avail_slot] = avail_pkg
- inst_pkg = vardb.match(avail_slot)
- if not inst_pkg:
- continue
- # emerge guarantees 1 package per slot here (highest counter)
- inst_pkg = inst_pkg[0]
- if avail_pkg != inst_pkg and \
- avail_pkg != best([avail_pkg, inst_pkg]):
- has_downgrade = True
- break
+ avail_slot = "%s:%s" % (dep_getkey(atom),
+ mydbapi.aux_get(avail_pkg, ["SLOT"])[0])
+ versions[avail_slot] = avail_pkg
this_choice = (atoms, versions, all_available)
- if not has_downgrade:
+ if all_available:
+ # The "all installed" criterion is not version or slot specific.
+ # If any version of a package is installed then we assume that it
+ # is preferred over other possible packages choices.
+ all_installed = True
+ for atom in set([dep_getkey(atom) for atom in atoms]):
+ # New-style virtuals have zero cost to install.
+ if not vardb.match(atom) and not atom.startswith("virtual/"):
+ all_installed = False
+ break
if all_installed:
preferred.append(this_choice)
- continue
- elif all_available:
+ else:
possible_upgrades.append(this_choice)
- continue
- other.append(this_choice)
+ else:
+ 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
# 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):
+ preferred.extend(possible_upgrades)
+ possible_upgrades = preferred[1:]
+ for possible_upgrade in possible_upgrades:
atoms, versions, all_available = possible_upgrade
myslots = set(versions)
for other_choice in preferred:
+ if possible_upgrade is other_choice:
+ # possible_upgrade will not be promoted, so move on
+ break
o_atoms, o_versions, o_all_available = other_choice
intersecting_slots = myslots.intersection(o_versions)
if not intersecting_slots:
has_downgrade = True
break
if has_upgrade and not has_downgrade:
+ preferred.remove(possible_upgrade)
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)