distdir_writable = can_fetch and not fetch_to_ro
failed_files = set()
+ restrict_fetch_msg = False
for myfile in filedict:
"""
if listonly:
writemsg_stdout("\n", noiselevel=-1)
if fetched != 2:
- if restrict_fetch:
+ if restrict_fetch and not restrict_fetch_msg:
+ restrict_fetch_msg = True
msg = ("\n!!! %s/%s" + \
" has fetch restriction turned on.\n" + \
"!!! This probably means that this " + \
mysettings.pop("EBUILD_PHASE", None)
else:
mysettings["EBUILD_PHASE"] = ebuild_phase
- if listonly:
- continue
+
+ elif restrict_fetch:
+ pass
elif listonly:
- continue
+ pass
elif not filedict[myfile]:
writemsg("Warning: No mirrors available for file" + \
" '%s'\n" % (myfile), noiselevel=-1)
else:
writemsg("!!! Couldn't download '%s'. Aborting.\n" % myfile,
noiselevel=-1)
- if fetchonly and not restrict_fetch:
+
+ if listonly:
+ continue
+ elif fetchonly:
failed_files.add(myfile)
continue
return 0
misc_keys = ["LICENSE", "PROPERTIES", "PROVIDE", "RESTRICT", "SRC_URI"]
other_keys = ["SLOT"]
all_keys = dep_keys + misc_keys + other_keys
- metadata = mysettings.configdict["pkg"]
+ metadata = dict(izip(all_keys,
+ mydbapi.aux_get(mysettings.mycpv, all_keys)))
class FakeTree(object):
def __init__(self, mydb):
try:
mylink.lockdb()
if mylink.exists():
+ vartree.dbapi.plib_registry.load()
+ vartree.dbapi.plib_registry.pruneNonExisting()
retval = mylink.unmerge(trimworld=mytrimworld, cleanup=1,
ldpath_mtimes=ldpath_mtimes)
if retval == os.EX_OK:
except EnvironmentError, e:
if e.errno != PermissionDenied.errno:
writemsg("!!! %s %s\n" % (e, self._filename), noiselevel=-1)
+ else:
+ self._data_orig = self._data.copy()
def register(self, cpv, slot, counter, paths):
""" Register new objects in the registry. If there is a record with the
__slots__ = ("__weakref__", "_key")
- def __init__(self, object, root):
+ def __init__(self, obj, root):
"""
This takes a path to an object.
@type object: string (example: '/usr/bin/bar')
"""
- self._key = self._generate_object_key(object, root)
+ self._key = self._generate_object_key(obj, root)
def __hash__(self):
return hash(self._key)
def __eq__(self, other):
return self._key == other._key
- def _generate_object_key(self, object, root):
+ def _generate_object_key(self, obj, root):
"""
Generate object key for a given object.
2. realpath of object if object does not exist.
"""
- abs_path = os.path.join(root, object.lstrip(os.path.sep))
+ abs_path = os.path.join(root, obj.lstrip(os.sep))
try:
object_stat = os.stat(abs_path)
except OSError:
writemsg(red("!!! File: ")+str(mysrc)+"\n", noiselevel=-1)
writemsg(red("!!! Error: ")+str(e)+"\n", noiselevel=-1)
return 1
- except Exception, e:
- writemsg("\n")
- writemsg(red("!!! ERROR: An unknown error has occurred during the merge process.\n"))
- writemsg(red("!!! A stat call returned the following error for the following file:"))
- writemsg( "!!! Please ensure that your filesystem is intact, otherwise report\n")
- writemsg( "!!! this as a portage bug at bugs.gentoo.org. Append 'emerge info'.\n")
- writemsg( "!!! File: "+str(mysrc)+"\n", noiselevel=-1)
- writemsg( "!!! Error: "+str(e)+"\n", noiselevel=-1)
- return 1
-
mymode = mystat[stat.ST_MODE]
# handy variables; mydest is the target object on the live filesystems;
retval = -1
self.lockdb()
try:
+ self.vartree.dbapi.plib_registry.load()
+ self.vartree.dbapi.plib_registry.pruneNonExisting()
retval = self.treewalk(mergeroot, myroot, inforoot, myebuild,
cleanup=cleanup, mydbapi=mydbapi, prev_mtimes=prev_mtimes)
# undo registrations of preserved libraries, bug #210501
cexpand[mystring]=newstring[1:]
return newstring[1:]
-def pickle_write(data,filename,debug=0):
- import os
- try:
- myf=open(filename,"w")
- pickle.dump(data,myf,-1)
- myf.flush()
- myf.close()
- writemsg("Wrote pickle: "+str(filename)+"\n",1)
- os.chown(myefn,uid,portage_gid)
- os.chmod(myefn,0664)
- except SystemExit, e:
- raise
- except Exception, e:
- return 0
- return 1
+# broken and removed, but can still be imported
+pickle_write = None
def pickle_read(filename,default=None,debug=0):
import os