From: Fabian Groffen Date: Sun, 2 Nov 2008 07:55:50 +0000 (-0000) Subject: Merged from trunk -r11776:11784 X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=75d3447c6cf24cf8192188819d70fe2862da0b7e;p=portage.git Merged from trunk -r11776:11784 | 11777 | Rename "object" variable to avoid name collision with the | | zmedico | builtin class. | | 11778 | Before returning from PreservedLibsRegistry.store(), update | | zmedico | self._data_orig. | | 11779 | Explicitly load the preserved libs registry after obtaining | | zmedico | a lock for merge or unmerge, in case the registry has been | | | changed by a parallel emerge instance. | | 11780 | Also call PreservedLibsRegistry.pruneNonExisting() after | | zmedico | obtaining a lock and loading it for merge or unmerge. | | 11781 | Remove unnecessary handler for plain "Exception" from | | zmedico | lstat() call in dblink.mergeme(). | | 11782 | * In fetch(), ensure that pkg_nofetch is never called more | | zmedico | than once. * In _validate_deps(), revert back to using | | | aux_get since the config instance does not cache SRC_URI. | | 11783 | Remove broken pickle_write() since it can't possibly be | | zmedico | used. | | 11784 | When echoing the emake command, redirect to stderr since | | zmedico | otherwise it breaks the gcc ebuild because of the way that | | | the get_make_var() function from toolchain.eclass is used. | svn path=/main/branches/prefix/; revision=11793 --- diff --git a/bin/emake b/bin/emake index 83bc87c42..e18c3604b 100755 --- a/bin/emake +++ b/bin/emake @@ -11,6 +11,6 @@ # /etc/make.globals here because emake is only called from an # ebuild. -[[ $PORTAGE_QUIET = 1 ]] || echo ${MAKE:-make} ${MAKEOPTS} ${EXTRA_EMAKE} "$@" +[[ $PORTAGE_QUIET = 1 ]] || echo ${MAKE:-make} $MAKEOPTS $EXTRA_EMAKE "$@" >&2 exec ${MAKE:-make} ${MAKEOPTS} ${EXTRA_EMAKE} "$@" diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py index 71f8b444a..76b7704dd 100644 --- a/pym/portage/__init__.py +++ b/pym/portage/__init__.py @@ -3677,6 +3677,7 @@ def fetch(myuris, mysettings, listonly=0, fetchonly=0, locks_in_subdir=".locks", distdir_writable = can_fetch and not fetch_to_ro failed_files = set() + restrict_fetch_msg = False for myfile in filedict: """ @@ -4119,7 +4120,8 @@ def fetch(myuris, mysettings, listonly=0, fetchonly=0, locks_in_subdir=".locks", 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 " + \ @@ -4155,17 +4157,21 @@ def fetch(myuris, mysettings, listonly=0, fetchonly=0, locks_in_subdir=".locks", 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 @@ -5895,7 +5901,8 @@ def _validate_deps(mysettings, myroot, mydo, mydbapi): 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): @@ -6114,6 +6121,8 @@ def unmerge(cat, pkg, myroot, mysettings, mytrimworld=1, vartree=None, 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: diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py index 6fb04895a..30bd43679 100644 --- a/pym/portage/dbapi/vartree.py +++ b/pym/portage/dbapi/vartree.py @@ -79,6 +79,8 @@ class PreservedLibsRegistry(object): 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 @@ -156,7 +158,7 @@ class LinkageMap(object): __slots__ = ("__weakref__", "_key") - def __init__(self, object, root): + def __init__(self, obj, root): """ This takes a path to an object. @@ -164,7 +166,7 @@ class LinkageMap(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) @@ -172,7 +174,7 @@ class LinkageMap(object): 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. @@ -186,7 +188,7 @@ class LinkageMap(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: @@ -3937,16 +3939,6 @@ class dblink(object): 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; @@ -4199,6 +4191,8 @@ class dblink(object): 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 diff --git a/pym/portage/util.py b/pym/portage/util.py index 47339dee9..650b4ad45 100644 --- a/pym/portage/util.py +++ b/pym/portage/util.py @@ -565,21 +565,8 @@ def varexpand(mystring, mydict={}): 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