Merged from trunk -r11776:11784
authorFabian Groffen <grobian@gentoo.org>
Sun, 2 Nov 2008 07:55:50 +0000 (07:55 -0000)
committerFabian Groffen <grobian@gentoo.org>
Sun, 2 Nov 2008 07:55:50 +0000 (07:55 -0000)
   | 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

bin/emake
pym/portage/__init__.py
pym/portage/dbapi/vartree.py
pym/portage/util.py

index 83bc87c4292e1831067828c8eead285dd1d19167..e18c3604b3631449c19fa137f74e11130d778194 100755 (executable)
--- 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} "$@"
index 71f8b444a63f7cf336e2304b8339cf4e62441f1b..76b7704dd14258aa5d9842d0663e52fea3f969d7 100644 (file)
@@ -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:
index 6fb04895a24486d46ede084dfbfa5822d56246a5..30bd436793fe4816a4194bb3d7e17468c007db7e 100644 (file)
@@ -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
index 47339dee9e247fa67d1c2a6b96ccc484d176f0f0..650b4ad45297e3b2596978c96375568c83d74ef9 100644 (file)
@@ -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