"""
if (len(argv) < 2):
print("ERROR: insufficient parameters!")
- sys.exit(2)
+ return 2
warnings = []
try:
mylist = portage.db[argv[0]]["vartree"].dbapi.match(atom)
if mylist:
- sys.exit(0)
+ return 0
else:
- sys.exit(1)
+ return 1
except KeyError:
- sys.exit(1)
+ return 1
except portage.exception.InvalidAtom:
portage.writemsg("ERROR: Invalid atom: '%s'\n" % argv[1],
noiselevel=-1)
"""
if (len(argv) < 2):
print("ERROR: insufficient parameters!")
- sys.exit(2)
+ return 2
warnings = []
mylist = portage.db[argv[0]]["vartree"].dbapi.match(atom)
print(portage.best(mylist))
except KeyError:
- sys.exit(1)
+ return 1
best_version.uses_root = True
"""
if (len(argv) < 2):
print("ERROR: insufficient parameters!")
- sys.exit(2)
+ return 2
try:
for pack in argv[1:]:
mylist=portage.db[argv[0]]["vartree"].dbapi.match(pack)
print(pack+":"+portage.best(mylist))
except KeyError:
- sys.exit(1)
+ return 1
mass_best_version.uses_root = True
def metadata(argv):
if (len(argv) < 4):
print("ERROR: insufficient parameters!", file=sys.stderr)
- sys.exit(2)
+ return 2
eroot, pkgtype, pkgspec = argv[0:3]
metakeys = argv[3:]
"installed":"vartree"}
if pkgtype not in type_map:
print("Unrecognized package type: '%s'" % pkgtype, file=sys.stderr)
- sys.exit(1)
+ return 1
trees = portage.db
repo = portage.dep.dep_getrepo(pkgspec)
pkgspec = portage.dep.remove_slot(pkgspec)
writemsg_stdout(''.join('%s\n' % x for x in values), noiselevel=-1)
except KeyError:
print("Package not found: '%s'" % pkgspec, file=sys.stderr)
- sys.exit(1)
+ return 1
metadata.__doc__ = """
<eroot> <pkgtype> <category/package> [<key>]+
if (len(argv) < 2):
print("ERROR: insufficient parameters!")
- sys.exit(2)
+ return 2
try:
root = argv.pop(0)
pkgtype = "ebuild"
writemsg_stdout("%s:" % pack, noiselevel=-1)
best_visible([root, pkgtype, pack])
except KeyError:
- sys.exit(1)
+ return 1
mass_best_visible.uses_root = True
"""
if len(argv) != 2:
print("ERROR: expected 2 parameters, got %d!" % len(argv))
- sys.exit(2)
+ return 2
root, atom = argv
if not atom:
atom = "*/*"
if len(argv) == 0:
print("ERROR: insufficient parameters!")
- sys.exit(2)
+ return 2
for arg in argv:
if verbose:
"""
if len(argv) < 1:
print("ERROR: insufficient parameters!")
- sys.exit(2)
+ return 2
print(" ".join(portage.db[argv[0]]["porttree"].dbapi.getRepositories()))
get_repos.uses_root = True
"""
if len(argv) < 2:
print("ERROR: insufficient parameters!")
- sys.exit(2)
+ return 2
for arg in argv[1:]:
path = portage.db[argv[0]]["porttree"].dbapi.getRepositoryPath(arg)
if path is None:
if len(argv) != 1:
print("ERROR: wrong number of arguments")
- sys.exit(2)
+ return 2
mylibs = portage.db[argv[0]]["vartree"].dbapi._plib_registry.getPreservedLibs()
rValue = 1
msg = []