Merged from trunk 7586:7593
authorFabian Groffen <grobian@gentoo.org>
Sun, 12 Aug 2007 17:46:20 +0000 (17:46 -0000)
committerFabian Groffen <grobian@gentoo.org>
Sun, 12 Aug 2007 17:46:20 +0000 (17:46 -0000)
   | 7587    | Don't generate a QA Notice if the ${S} directory doesn't     |
   | zmedico | exist since it might be irrelevant for some ebuilds.         |

   | 7589    | Optimize config.setcpv() so that it doesn't call             |
   | zmedico | regenerate() unnecessarily when there are no USE wildcards   |
   |         | to expand.                                                   |

   | 7591    | For bug #188559, invalidate dblink._contents_inodes as       |
   | zmedico | necessary to prevent FEATURES=unmerge-orphans from unmerging |
   |         | anything that belongs to the package that has just been      |
   |         | merged.                                                      |

   | 7593    | For bug #33585, leave the old info dir file in place if      |
   | zmedico | there is nothing to generate.                                |

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

bin/ebuild.sh
pym/emerge/__init__.py
pym/portage/__init__.py
pym/portage/dbapi/vartree.py

index 223bbd5e6b6080e3f2d6db339b5d13f58403381e..4dd3fd997097449ec791c4f31068330742797871 100755 (executable)
@@ -916,7 +916,6 @@ dyn_compile() {
                srcdir=${S}
                cd "${S}"
        else
-               eqawarn "QA Notice: Directory does not exist: S=\"${S}\""
                cd "${WORKDIR}"
        fi
        #our custom version of libtool uses $S and $ED to fix
@@ -977,7 +976,6 @@ dyn_test() {
        if [ -d "${S}" ]; then
                cd "${S}"
        else
-               eqawarn "QA Notice: Directory does not exist: S=\"${S}\""
                cd "${WORKDIR}"
        fi
        if ! hasq test $FEATURES && [ "${EBUILD_FORCE_TEST}" != "1" ]; then
@@ -1016,7 +1014,6 @@ dyn_install() {
        if [ -d "${S}" ]; then
                cd "${S}"
        else
-               eqawarn "QA Notice: Directory does not exist: S=\"${S}\""
                cd "${WORKDIR}"
        fi
        vecho
index 534b934634e7c16c9fcc12a93a5b3c8552bff737..413f7d5d56472cd003dc5d9313abc94cd3b3bebc 100644 (file)
@@ -4233,28 +4233,43 @@ def chk_updated_info_files(root, infodirs, prev_mtimes, retval):
                else:
                        portage.writemsg_stdout(" "+green("*")+" Regenerating GNU info directory index...\n")
 
+                       dir_extensions = ("", ".gz", ".bz2")
                        icount=0
                        badcount=0
                        for inforoot in regen_infodirs:
                                if inforoot=='':
                                        continue
-                               for filename in ("dir", "dir.gz", "dir.bz2"):
-                                       file_path = os.path.join(inforoot, filename)
-                                       try:
-                                               os.rename(file_path, file_path + ".old")
-                                       except OSError, e:
-                                               if e.errno != errno.ENOENT:
-                                                       raise
-                                               del e
 
                                if not os.path.isdir(inforoot):
                                        continue
                                errmsg = ""
                                file_list = os.listdir(inforoot)
                                file_list.sort()
+                               dir_file = os.path.join(inforoot, "dir")
+                               moved_old_dir = False
+                               processed_count = 0
                                for x in file_list:
-                                       if (x[0] == ".") or (x in ["dir","dir.old"]) or (os.path.isdir(inforoot+"/"+x)):
+                                       if x.startswith(".") or \
+                                               os.path.isdir(os.path.join(inforoot, x)):
                                                continue
+                                       if x.startswith("dir"):
+                                               skip = False
+                                               for ext in dir_extensions:
+                                                       if x == "dir" + ext:
+                                                               skip = True
+                                                               break
+                                               if skip:
+                                                       continue
+                                       if processed_count == 0:
+                                               for ext in dir_extensions:
+                                                       try:
+                                                               os.rename(dir_file + ext, dir_file + ext + ".old")
+                                                               moved_old_dir = True
+                                                       except EnvironmentError, e:
+                                                               if e.errno != errno.ENOENT:
+                                                                       raise
+                                                               del e
+                                       processed_count += 1
                                        myso=commands.getstatusoutput("LANG=C LANGUAGE=C "+EPREFIX+"/usr/bin/install-info --dir-file="+inforoot+"/dir "+inforoot+"/"+x)[1]
                                        existsstr="already exists, for file `"
                                        if myso!="":
@@ -4271,6 +4286,17 @@ def chk_updated_info_files(root, infodirs, prev_mtimes, retval):
                                                        errmsg += myso + "\n"
                                        icount=icount+1
 
+                               if moved_old_dir and not os.path.exists(dir_file):
+                                       # We didn't generate a new dir file, so put the old file
+                                       # back where it was originally found.
+                                       for ext in dir_extensions:
+                                               try:
+                                                       os.rename(dir_file + ext + ".old", dir_file + ext)
+                                               except EnvironmentError, e:
+                                                       if e.errno != errno.ENOENT:
+                                                               raise
+                                                       del e
+
                                #update mtime so we can potentially avoid regenerating.
                                prev_mtimes[inforoot] = long(os.stat(inforoot).st_mtime)
 
index 26ef8c25d29e8b16b574af46eef96ed6ff29b88b..1d1aeeb9154f2b3b0d204c599bdf1869825098d5 100644 (file)
@@ -881,6 +881,7 @@ class config(object):
 
                self.user_profile_dir = None
                self.local_config = local_config
+               self._use_wildcards = False
 
                if clone:
                        self.incrementals = copy.deepcopy(clone.incrementals)
@@ -940,6 +941,7 @@ class config(object):
 
                        self._accept_license = copy.deepcopy(clone._accept_license)
                        self._plicensedict = copy.deepcopy(clone._plicensedict)
+                       self._use_wildcards = copy.deepcopy(clone._use_wildcards)
                else:
 
                        # backupenv is for calculated incremental variables.
@@ -1275,6 +1277,11 @@ class config(object):
                                        if not self.pusedict.has_key(cp):
                                                self.pusedict[cp] = {}
                                        self.pusedict[cp][key] = pusedict[key]
+                                       if not self._use_wildcards:
+                                               for x in pusedict[key]:
+                                                       if x.endswith("_*"):
+                                                               self._use_wildcards = True
+                                                               break
 
                                #package.keywords
                                pkgdict = grabdict_package(
@@ -1803,7 +1810,10 @@ class config(object):
                self.configdict["pkg"]["USE"]    = self.puse[:] # this gets appended to USE
                if iuse != self.configdict["pkg"].get("IUSE",""):
                        self.configdict["pkg"]["IUSE"] = iuse
-                       has_changed = True
+                       if self._use_wildcards:
+                               # Without this conditional, regenerate() would be called
+                               # *every* time.
+                               has_changed = True
                # CATEGORY is essential for doebuild calls
                self.configdict["pkg"]["CATEGORY"] = mycpv.split("/")[0]
                if has_changed:
@@ -2091,6 +2101,7 @@ class config(object):
                        has_wildcard = "*" in var_split
                        if has_wildcard:
                                var_split = [ x for x in var_split if x != "*" ]
+                               self._use_wildcards = True
                        has_iuse = False
                        for x in iuse:
                                if x.startswith(prefix):
index 9d650953d0916e883230f7f5c74aa666a8158629..b9f205a7a4e7854ea78c4eb9f0fa8e0b05c275e2 100644 (file)
@@ -1802,7 +1802,13 @@ class dblink(object):
                        if dblnk.mycpv != self.mycpv:
                                continue
                        writemsg_stdout(">>> Safely unmerging already-installed instance...\n")
+                       # These caches are populated during collision-protect and the data
+                       # they contain is now invalid. It's very important to invalidate
+                       # the contents_inodes cache so that FEATURES=unmerge-orphans
+                       # doesn't unmerge anything that belongs to this package that has
+                       # just been merged.
                        self.contentscache = None
+                       self._contents_inodes = None
                        others_in_slot.append(self)  # self has just been merged
                        others_in_slot.remove(dblnk) # dblnk will unmerge itself now
                        dblnk.unmerge(trimworld=0, ldpath_mtimes=prev_mtimes,