Merged from trunk 8113:8121
authorFabian Groffen <grobian@gentoo.org>
Sun, 14 Oct 2007 09:26:44 +0000 (09:26 -0000)
committerFabian Groffen <grobian@gentoo.org>
Sun, 14 Oct 2007 09:26:44 +0000 (09:26 -0000)
   | 8114    | In the file collision eerror output, don't colorize the file |
   | zmedico | paths since the escape codes look ugly in the log.           |

   | 8115    | Remove unused import.                                        |
   | zmedico |                                                              |

   | 8117    | Avoid an error message from find when "${D}"/usr/share does  |
   | zmedico | not exist.                                                   |

   | 8119    | In some cases, openpty can be slow when it fails. Therefore, |
   | zmedico | stop trying to use it after the first failure.               |

   | 8121    | Remove the checks for files in symlinked directories from    |
   | zmedico | the collision protect code since it hasn't been needed ever  |
   |         | since the followSymlinks parameter was disabled for          |
   |         | portage.listdir() calls in order to prevent infinite         |
   |         | recursion loops.                                             |

svn path=/main/branches/prefix/; revision=8122

bin/misc-functions.sh
pym/portage/__init__.py
pym/portage/dbapi/vartree.py

index b6361c7ff4b8083da2205f2202ad26a8379c0bcc..ee8d806c480afd93a1af7b412ffddd2612dfb42f 100644 (file)
@@ -403,7 +403,7 @@ install_qa_check() {
 
        # Compiled python objects do not belong in /usr/share (FHS violation)
        # and can be a pain when upgrading python
-       f=$(find "${ED}"/usr/share -name '*.py[co]')
+       f=$([ -d "${ED}"/usr/share ] && find "${D}"/usr/share -name '*.py[co]')
        if [[ -n ${f} ]] ; then
                vecho -ne '\a\n'
                eqawarn "QA Notice: Precompiled python object files do not belong in /usr/share"
index a2a38ff8786efa5b7149aac9ac49ca7dce876600..c0fc83deb7a6f3c58650fa96df378ffd9e27ee0d 100644 (file)
@@ -2513,6 +2513,10 @@ class config(object):
                                        pass
                return self._selinux_enabled
 
+# In some cases, openpty can be slow when it fails. Therefore,
+# stop trying to use it after the first failure.
+_disable_openpty = False
+
 # XXX This would be to replace getstatusoutput completely.
 # XXX Issue: cannot block execution. Deadlock condition.
 def spawn(mystring, mysettings, debug=0, free=0, droppriv=0, sesandbox=0, fakeroot=0, **keywords):
@@ -2587,14 +2591,19 @@ def spawn(mystring, mysettings, debug=0, free=0, droppriv=0, sesandbox=0, fakero
                del keywords["logfile"]
                if 1 not in fd_pipes or 2 not in fd_pipes:
                        raise ValueError(fd_pipes)
-               from pty import openpty
-               try:
-                       master_fd, slave_fd = openpty()
-                       got_pty = True
-               except EnvironmentError, e:
-                       writemsg("openpty failed: '%s'\n" % str(e), noiselevel=1)
-                       del e
+               global _disable_openpty
+               if _disable_openpty:
                        master_fd, slave_fd = os.pipe()
+               else:
+                       from pty import openpty
+                       try:
+                               master_fd, slave_fd = openpty()
+                               got_pty = True
+                       except EnvironmentError, e:
+                               _disable_openpty = True
+                               writemsg("openpty failed: '%s'\n" % str(e), noiselevel=1)
+                               del e
+                               master_fd, slave_fd = os.pipe()
 
                # We must set non-blocking mode before we close the slave_fd
                # since otherwise the fcntl call can fail on FreeBSD (the child
index 4fc590a467bcf9d508eefd0a357e32bb61e8489a..26badff201f7c95321175e17fb39c15357d9e5b5 100644 (file)
@@ -1474,11 +1474,9 @@ class dblink(object):
 
                del preserve_paths
        
-       def _collision_protect(self, srcroot, destroot, mypkglist, mycontents, mysymlinks):
+       def _collision_protect(self, srcroot, destroot, mypkglist, mycontents):
                        collision_ignore = set([normalize_path(myignore) for myignore in \
                                self.settings.get("COLLISION_IGNORE", "").split()])
-                       mysymlinked_directories = [s + os.path.sep for s in mysymlinks]
-                       del mysymlinks
 
                        stopmerge = False
                        i=0
@@ -1487,15 +1485,6 @@ class dblink(object):
                                os.path.sep
                        print green("*")+" checking "+str(len(mycontents))+" files for package collisions"
                        for f in mycontents:
-                               nocheck = False
-                               # listdir isn't intelligent enough to exclude symlinked dirs,
-                               # so we have to do it ourself
-                               for s in mysymlinked_directories:
-                                       if f.startswith(s):
-                                               nocheck = True
-                                               break
-                               if nocheck:
-                                       continue
                                i = i + 1
                                if i % 1000 == 0:
                                        print str(i)+" files checked ..."
@@ -1750,7 +1739,7 @@ class dblink(object):
 
                # check for package collisions
                collisions = self._collision_protect(srcroot, destroot, others_in_slot,
-                       myfilelist+mylinklist, mylinklist)
+                       myfilelist+mylinklist)
 
                if True:
                        """ The merge process may move files out of the image directory,
@@ -1803,10 +1792,9 @@ class dblink(object):
                        cmd += "eerror \"Detected file collision(s):\" ; "
                        cmd += "eerror ; "
 
-                       from portage.output import colorize
                        for f in collisions:
-                               cmd += "eerror \"     '%s'\" ; " % colorize("INFORM",
-                                       os.path.join(destroot, f.lstrip(os.path.sep)))
+                               cmd += "eerror \"     '%s'\" ; " % \
+                                       os.path.join(destroot, f.lstrip(os.path.sep))
 
                        from portage import process
                        process.spawn(["bash", "-c", cmd],