returns None, and raise 'ebuild not found' exceptions when necessary.
svn path=/main/trunk/; revision=14442
root_config = pkg.root_config
portdb = root_config.trees["porttree"].dbapi
bintree = root_config.trees["bintree"]
- ebuild_path = portdb.findname(self.pkg.cpv)
+ ebuild_path = portdb.findname(pkg.cpv)
+ if ebuild_path is None:
+ raise AssertionError("ebuild not found for '%s'" % pkg.cpv)
settings = self.settings
debug = settings.get("PORTAGE_DEBUG") == "1"
portdb = root_config.trees[tree].dbapi
settings.setcpv(pkg)
settings.configdict["pkg"]["EMERGE_FROM"] = pkg.type_name
- ebuild_path = portdb.findname(self.pkg.cpv)
+ ebuild_path = portdb.findname(pkg.cpv)
+ if ebuild_path is None:
+ raise AssertionError("ebuild not found for '%s'" % pkg.cpv)
self._ebuild_path = ebuild_path
prefetcher = self.prefetcher
root_config = self.pkg.root_config
portdb = root_config.trees["porttree"].dbapi
ebuild_path = portdb.findname(self.pkg.cpv)
+ if ebuild_path is None:
+ raise AssertionError(
+ "ebuild not found for '%s'" % self.pkg.cpv)
settings = self.settings
settings.setcpv(self.pkg)
debug = settings.get("PORTAGE_DEBUG") == "1"
root_config = self.pkg.root_config
portdb = root_config.trees["porttree"].dbapi
ebuild_path = portdb.findname(self.pkg.cpv)
+ if ebuild_path is None:
+ raise AssertionError("ebuild not found for '%s'" % self.pkg.cpv)
settings = self.config_pool.allocate()
settings.setcpv(self.pkg)
pkg = self.pkg
portdb = pkg.root_config.trees["porttree"].dbapi
ebuild_path = portdb.findname(pkg.cpv)
+ if ebuild_path is None:
+ raise AssertionError("ebuild not found for '%s'" % pkg.cpv)
settings.setcpv(pkg)
debug = settings.get("PORTAGE_DEBUG") == "1"
root_config = pkg.root_config
portdb = root_config.trees["porttree"].dbapi
ebuild_path = portdb.findname(pkg.cpv)
+ if ebuild_path is None:
+ raise AssertionError("ebuild not found for '%s'" % pkg.cpv)
debug = settings.get("PORTAGE_DEBUG") == "1"
retval = portage.doebuild(ebuild_path, "fetch",
self.settings["ROOT"], self.settings, debug=debug,
for cpv in cpv_list:
valid_pkgs.add(cpv)
ebuild_path, repo_path = portdb.findname2(cpv)
+ if ebuild_path is None:
+ raise AssertionError("ebuild not found for '%s'" % cpv)
metadata, st, emtime = portdb._pull_valid_cache(
cpv, ebuild_path, repo_path)
if metadata is not None:
continue
portdb = x.root_config.trees['porttree'].dbapi
ebuild_path = portdb.findname(x.cpv)
- if not ebuild_path:
- writemsg_level(
- "!!! Could not locate ebuild for '%s'.\n" \
- % x.cpv, level=logging.ERROR, noiselevel=-1)
- return 1
+ if ebuild_path is None:
+ raise AssertionError("ebuild not found for '%s'" % x.cpv)
pkgsettings['O'] = os.path.dirname(ebuild_path)
if not portage.digestgen([], pkgsettings, myportdb=portdb):
writemsg_level(
root_config = x.root_config
portdb = root_config.trees["porttree"].dbapi
quiet_config = quiet_settings[root_config.root]
- quiet_config["O"] = os.path.dirname(portdb.findname(x.cpv))
+ ebuild_path = portdb.findname(x.cpv)
+ if ebuild_path is None:
+ raise AssertionError("ebuild not found for '%s'" % x.cpv)
+ quiet_config["O"] = os.path.dirname(ebuild_path)
if not portage.digestcheck([], quiet_config, strict=True):
failures |= 1
metadata = pkg.metadata
ebuild_path = None
repo_name = metadata["repository"]
- if pkg_type == "ebuild":
- ebuild_path = portdb.findname(pkg_key)
- if not ebuild_path: # shouldn't happen
- raise portage.exception.PackageNotFound(pkg_key)
+ if pkg.type_name == "ebuild":
+ ebuild_path = portdb.findname(pkg.cpv)
+ if ebuild_path is None:
+ raise AssertionError(
+ "ebuild not found for '%s'" % pkg.cpv)
repo_path_real = os.path.dirname(os.path.dirname(
os.path.dirname(ebuild_path)))
else:
if "--changelog" in self._frozen_config.myopts:
inst_matches = vardb.match(pkg.slot_atom)
if inst_matches:
- changelogs.extend(calc_changelog(
- portdb.findname(pkg_key),
- inst_matches[0], pkg_key))
+ ebuild_path_cl = ebuild_path
+ if ebuild_path_cl is None:
+ # binary package
+ ebuild_path_cl = portdb.findname(pkg.cpv)
+
+ if ebuild_path_cl is not None:
+ changelogs.extend(calc_changelog(
+ ebuild_path_cl, inst_matches[0], pkg.cpv))
else:
addl = " " + green("N") + " " + fetch + " "
if ordered:
the file we wanted.
"""
if not mycpv:
- return ("", 0)
+ return (None, 0)
mysplit = mycpv.split("/")
psplit = pkgsplit(mysplit[1])
if psplit is None or len(mysplit) != 2:
myebuild, mylocation = self.findname2(mycpv, mytree)
if not myebuild:
- writemsg(_("!!! aux_get(): ebuild path for '%s' not specified:\n") % mycpv,
- noiselevel=1)
- writemsg("!!! %s\n" % myebuild, noiselevel=1)
+ writemsg("!!! aux_get(): %s\n" % \
+ _("ebuild not found for '%s'") % mycpv, noiselevel=1)
raise KeyError(mycpv)
mydata, st, emtime = self._pull_valid_cache(mycpv, myebuild, mylocation)
def getfetchsizes(self, mypkg, useflags=None, debug=0):
# returns a filename:size dictionnary of remaining downloads
myebuild = self.findname(mypkg)
+ if myebuild is None:
+ raise AssertionError("ebuild not found for '%s'" % mypkg)
pkgdir = os.path.dirname(myebuild)
mf = Manifest(pkgdir, self.mysettings["DISTDIR"])
checksums = mf.getDigests()
useflags = mysettings["USE"].split()
myfiles = self.getFetchMap(mypkg, useflags=useflags)
myebuild = self.findname(mypkg)
+ if myebuild is None:
+ raise AssertionError("ebuild not found for '%s'" % mypkg)
pkgdir = os.path.dirname(myebuild)
mf = Manifest(pkgdir, self.mysettings["DISTDIR"])
mysums = mf.getDigests()