Note: \fBrepoman commit\fR only works \fIinside local\fR CVS repositories.
.SH OPTIONS
.TP
+\fB--force\fR
+Force commit to proceed, regardless of QA issues. For convenience, this option
+causes the most time consuming QA checks to be skipped. The commit message will
+include an indication that this option has been enabled, together with the
+usual portage version stamp.
+.TP
\fB-q\fR, \fB--quiet\fR
Be less verbose about extraneous info
.TP
.B digest.assumed
Existing digest must be assumed correct (Package level only)
.TP
-.B digest.disjointed
-Digests not added to cvs when the matching ebuild has been added
-.TP
.B digest.fail
Digest does not match the specified local file
.TP
.B digest.missing
Digest files that are missing (ebuild exists, digest doesn't)
.TP
-.B digest.notadded
-Digests that exist but have not been added to cvs
-.TP
.B digest.partial
Digest files do not contain all corresponding URI elements
.TP
from portage.data import secpass
from portage.util import normalize_path as normpath
from portage.util import writemsg
-from portage.sets.dbapi import InternalPackageSet
+from portage.sets import InternalPackageSet
from portage.sets.profiles import PackagesSystemSet as SystemSet
from portage.sets.files import WorldSet
def clean_world(vardb, cpv):
"""Remove a package from the world file when unmerged."""
- world_set = WorldSet("world", vardb.settings["ROOT"])
+ world_set = WorldSet(vardb.settings["ROOT"])
world_set.lock()
worldlist = list(world_set) # loads latest from disk
mykey = portage.cpv_getkey(cpv)
self.settings = trees["vartree"].settings
self.root = self.settings["ROOT"]
self.sets = {}
- world_set = WorldSet("world", self.root)
+ world_set = WorldSet(self.root)
self.sets["world"] = world_set
- system_set = SystemSet("system", self.settings.profiles)
+ system_set = SystemSet(self.settings.profiles)
self.sets["system"] = system_set
def create_world_atom(pkg_key, metadata, args_set, root_config):
for ignore_priority in xrange(DepPriority.SOFT,
DepPriority.MEDIUM_SOFT + 1):
for node in nodes:
- if not accept_root_node and \
+ if nodes is not asap_nodes and \
+ not accept_root_node and \
not mygraph.parent_nodes(node):
continue
selected_nodes = set()
vardb = dep_check_trees[myroot]["vartree"].dbapi
# Constrain dependency selection to the installed packages.
dep_check_trees[myroot]["porttree"] = dep_check_trees[myroot]["vartree"]
- system_set = SystemSet("system", settings.profiles)
+ system_set = SystemSet(settings.profiles)
syslist = list(system_set)
- world_set = WorldSet("world", myroot)
+ world_set = WorldSet(myroot)
worldlist = list(world_set)
args_set = InternalPackageSet()
fakedb = portage.fakedbapi(settings=settings)
# Blacklist vars that could interfere with portage internals.
for blacklisted in "CATEGORY", "PKGUSE", "PORTAGE_CONFIGROOT", \
- "ROOT", "SANDBOX_DENY", "SANDBOX_PREDICT", "SANDBOX_READ", \
- "SANDBOX_WRITE", "EPREFIX", "EROOT":
+ "ROOT", "EPREFIX", "EROOT":
for cfg in self.lookuplist:
cfg.pop(blacklisted, None)
del blacklisted, cfg
# $Id$
from portage.util import normalize_path, writemsg
-import os, sys
+import errno, os, sys
from portage.data import portage_gid
+from portage.exception import PermissionDenied
class cache(object):
"""
self._eclass_locations = {}
eclass_len = len(".eclass")
for x in [normalize_path(os.path.join(y,"eclass")) for y in self.porttrees]:
- if not os.path.isdir(x):
- continue
- for y in [y for y in os.listdir(x) if y.endswith(".eclass")]:
+ eclass_filenames = []
+ try:
+ for y in os.listdir(x):
+ if y.endswith(".eclass"):
+ eclass_filenames.append(y)
+ except OSError, e:
+ if e.errno == errno.ENOENT:
+ del e
+ continue
+ elif e.errno == errno.ENOTDIR:
+ del e
+ continue
+ elif e.errno == PermissionDenied.errno:
+ raise PermissionDenied(x)
+ raise
+ for y in eclass_filenames:
try:
mtime = long(os.stat(os.path.join(x, y)).st_mtime)
except OSError:
for root, dirs, files in os.walk(filename):
if 'CVS' in dirs:
dirs.remove('CVS')
- files = [f for f in files if not f.startswith('.')]
- files = [f for f in files if not f.endswith('~')]
+ files = [f for f in files if not f.startswith('.') and not f.endswith('~')]
for f in files:
yield os.path.join(root, f)
else:
listing = None
if protocol in ["http","https"]:
+ if not address.endswith("/"):
+ # http servers can return a 400 error here
+ # if the address doesn't end with a slash.
+ address += "/"
page,rc,msg = make_http_request(conn,address,params,headers)
if page:
# package sets, the latter doesn't make sense for some sets like "system"
# or "security" and therefore isn't supported by them.
_operations = ["merge"]
- _atommap = {}
description = "generic package set"
- def __init__(self, name):
- self.name = name
+ def __init__(self):
self._atoms = set()
self._atommap = {}
self._loaded = False
class InternalPackageSet(EditablePackageSet):
def __init__(self, initial_atoms=None):
- super(InternalPackageSet, self).__init__("")
+ super(InternalPackageSet, self).__init__()
if initial_atoms != None:
self.update(initial_atoms)
from portage.sets.dbapi import EverythingSet
from portage.const import PRIVATE_PATH, USER_CONFIG_PATH
- rValue = set()
- worldset = StaticFileSet("world", os.path.join(root, PRIVATE_PATH, "world"))
+ rValue = {}
+ worldset = StaticFileSet(os.path.join(root, PRIVATE_PATH, "world"))
worldset.description = "Set of packages that were directly installed"
- rValue.add(worldset)
+ rValue["world"] = worldset
for suffix in ["mask", "unmask", "keywords", "use"]:
myname = "package_"+suffix
- myset = ConfigFileSet(myname, os.path.join(configroot, USER_CONFIG_PATH.lstrip(os.sep), "package."+suffix))
- rValue.add(myset)
- rValue.add(PackagesSystemSet("system", profile_paths))
+ myset = ConfigFileSet(os.path.join(configroot, USER_CONFIG_PATH.lstrip(os.sep), "package."+suffix))
+ rValue[myname] = myset
+ rValue["system"] = PackagesSystemSet(profile_paths)
if settings != None and portdbapi != None:
- rValue.add(NewAffectedSet("security", settings, vdbapi, portdbapi))
+ rValue["security"] = NewAffectedSet(settings, vdbapi, portdbapi)
else:
- rValue.add(InternalPackageSet("security"))
+ rValue["security"] = InternalPackageSet()
if vdbapi != None:
- rValue.add(EverythingSet("everything", vdbapi))
+ rValue["everything"] = EverythingSet(vdbapi)
else:
- rValue.add(InternalPackageSet("everything"))
+ rValue["everything"] = InternalPackageSet()
return rValue
from portage.sets.files import StaticFileSet
from portage.const import PRIVATE_PATH, USER_CONFIG_PATH
- rValue = set()
+ rValue = {}
mydir = os.path.join(configroot, USER_CONFIG_PATH.lstrip(os.sep), "sets")
try:
mysets = os.listdir(mydir)
for myname in mysets:
if myname in DEFAULT_SETS:
continue
- rValue.add(StaticFileSet(myname, os.path.join(mydir, myname)))
+ rValue[myname] = StaticFileSet(os.path.join(mydir, myname))
return rValue
def make_category_sets(portdbapi, settings, only_visible=True):
from portage.sets.dbapi import CategorySet
- rValue = set()
+ rValue = {}
for c in settings.categories:
- rValue.add(CategorySet("category_%s" % c, c, portdbapi, only_visible=only_visible))
+ rValue["category_%s" % c] = CategorySet(c, portdbapi, only_visible=only_visible)
return rValue
# adhoc test code
for s in sys.argv[1:]:
if s.startswith("category_"):
c = s[9:]
- l.add(CategorySet("category_%s" % c, c, portage.db['/']['porttree'].dbapi, only_visible=False))
+ l["category_%s" % c] = CategorySet(c, portage.db['/']['porttree'].dbapi, only_visible=False)
elif os.path.exists(s):
- l.add(StaticFileSet(os.path.basename(s), s))
+ l[os.path.basename(s)] = StaticFileSet(s)
elif s != "*":
print "ERROR: could not create set '%s'" % s
if not "*" in sys.argv:
- l = [s for s in l if s.name in sys.argv[1:]]
+ for n in l:
+ if n not in sys.argv[1:]:
+ del l[n]
for x in l:
- print x.name+":"
- print "DESCRIPTION = %s" % x.getMetadata("Description")
- for n in sorted(x.getAtoms()):
+ print x+":"
+ print "DESCRIPTION = %s" % l[x].getMetadata("Description")
+ for n in sorted(l[x].getAtoms()):
print "- "+n
print
_operations = ["merge", "unmerge"]
description = "Package set containing all installed packages"
- def __init__(self, name, vdbapi):
- super(EverythingSet, self).__init__(name)
+ def __init__(self, vdbapi):
+ super(EverythingSet, self).__init__()
self._db = vdbapi
def load(self):
class CategorySet(PackageSet):
_operations = ["merge", "unmerge"]
- def __init__(self, name, category, portdbapi, only_visible=True):
- super(CategorySet, self).__init__(name)
- self._db = portdbapi
+ def __init__(self, category, dbapi, only_visible=True):
+ super(CategorySet, self).__init__()
+ self._db = dbapi
self._category = category
self._check = only_visible
if only_visible:
class StaticFileSet(EditablePackageSet):
_operations = ["merge", "unmerge"]
- def __init__(self, name, filename):
- super(StaticFileSet, self).__init__(name)
+ def __init__(self, filename):
+ super(StaticFileSet, self).__init__()
self._filename = filename
self._mtime = None
self.description = "Package set loaded from file %s" % self._filename
if e.errno != errno.ENOENT:
raise
del e
+ data = {}
self._setAtoms(data.keys())
self._mtime = mtime
class ConfigFileSet(PackageSet):
- def __init__(self, name, filename):
- super(ConfigFileSet, self).__init__(name)
+ def __init__(self, filename):
+ super(ConfigFileSet, self).__init__()
self._filename = filename
self.description = "Package set generated from %s" % self._filename
self.loader = KeyListFileLoader(self._filename, ValidAtomValidator)
class WorldSet(StaticFileSet):
description = "Set of packages that were directly installed by the user"
- def __init__(self, name, root):
- super(WorldSet, self).__init__(name, os.path.join(os.sep, root, PRIVATE_PATH, "world"))
+ def __init__(self, root):
+ super(WorldSet, self).__init__(os.path.join(os.sep, root, PRIVATE_PATH, "world"))
self._lock = None
def _ensure_dirs(self):
class PackagesSystemSet(PackageSet):
_operations = ["merge"]
- def __init__(self, name, profile_paths):
- super(PackagesSystemSet, self).__init__(name)
+ def __init__(self, profile_paths):
+ super(PackagesSystemSet, self).__init__()
self._profile_paths = profile_paths
self.description = "System packages for profile %s" % self._profile_paths[-1]
description = "package set that includes all packages possibly affected by a GLSA"
- def __init__(self, name, settings, vardbapi, portdbapi):
- super(SecuritySet, self).__init__(name)
+ def __init__(self, settings, vardbapi, portdbapi):
+ super(SecuritySet, self).__init__()
self._settings = settings
self._vardbapi = vardbapi
self._portdbapi = portdbapi
"""
_operations = ["merge", "unmerge"]
- def __init__(self, name, command):
- super(CommandOutputSet, self).__init__(name)
+ def __init__(self, command):
+ super(CommandOutputSet, self).__init__()
self._command = command
self.description = "Package set generated from output of '%s'" % self._command
os.close(fd)
null_fd = os.open('/dev/null', os.O_RDWR)
test_string = 2 * "blah blah blah\n"
+ # Test cases are unique because they run inside src_test() which
+ # may or may not already be running within a sandbox. Interaction
+ # with SANDBOX_* variables may trigger unwanted sandbox violations
+ # that are only reproducible with certain combinations of sandbox,
+ # usersandbox, and userpriv FEATURES. Attempts to filter SANDBOX_*
+ # variables can interfere with a currently running sandbox
+ # instance. Therefore, use free=1 here to avoid potential
+ # interactions (see bug #190268).
spawn("echo -n '%s'" % test_string, settings, logfile=logfile,
- fd_pipes={0:sys.stdin.fileno(), 1:null_fd, 2:null_fd})
+ free=1, fd_pipes={0:sys.stdin.fileno(), 1:null_fd, 2:null_fd})
os.close(null_fd)
f = open(logfile, 'r')
log_content = f.read()
os.close(fd)
def tearDown(self):
-# os.unlink(self.testfile)
- pass
+ os.unlink(self.testfile)
def testConfigStaticFileSet(self):
- s = ConfigFileSet('test', self.testfile)
+ s = ConfigFileSet(self.testfile)
s.load()
self.assertEqual(set(test_cps), s.getAtoms())
os.unlink(self.testfile)
def testSampleStaticFileSet(self):
- s = StaticFileSet('test', self.testfile)
+ s = StaticFileSet(self.testfile)
s.load()
self.assertEqual(set(test_cps), s.getAtoms())
command += " -e "
for a in input:
command += "\"%s\n\"" % a
- s = CommandOutputSet('testset', command)
+ s = CommandOutputSet(command)
atoms = s.getAtoms()
self.assertEqual(atoms, input)