Merged from trunk -r14750:14767
authorFabian Groffen <grobian@gentoo.org>
Sun, 1 Nov 2009 10:56:19 +0000 (10:56 -0000)
committerFabian Groffen <grobian@gentoo.org>
Sun, 1 Nov 2009 10:56:19 +0000 (10:56 -0000)
   | 14751   | Bug #259697 - Update IUSE.invalid docs for GLEP 56.          |
   | zmedico |                                                              |

   | 14753   | Bug #291271 - Make vardbapi._bump_mtime() create category    |
   | zmedico | directories when necessary.                                  |

   | 14754   | Make dblink.delete() remove empty parent category            |
   | zmedico | directories.                                                 |

   | 14755   | Make cacheddir() always behave like EmptyOnError is True,    |
   | zmedico | since listdir() doesn't handle a None return value           |
   |         | correctly.                                                   |

   | 14760   | Bug #290921 - Always exit unsuccessfully if -r is not        |
   | zmedico | specified and a directory is skipped. This reverts a         |
   |         | behavior change from r9484.                                  |

   | 14761   | Allow unmerge of packages from the "selected" set when a     |
   | zmedico | package set such as @unavailable is given on the command     |
   |         | line. Thanks to Vlastimil Babka <caster@g.o> for reporting.  |

   | 14762   | For compatibility, still exit successfully if there are      |
   | zmedico | skipped directories. We can make it more strict later.       |

   | 14763   | Add a --backtrack=COUNT option to control how many times     |
   | zmedico | backtracking is allowed, and reduce the default from 30 to   |
   |         | 5.                                                           |

   | 14767   | Fix --backtrack option handling.                             |
   | zmedico |                                                              |

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

bin/dohtml.py
man/emerge.1
man/repoman.1
pym/_emerge/depgraph.py
pym/_emerge/help.py
pym/_emerge/main.py
pym/_emerge/unmerge.py
pym/portage/__init__.py
pym/portage/dbapi/vartree.py

index 39e7ab10784a36f1cf48524bde37bf0e091cc400..3224dbbca2cc1a7210c554dbbdbc7788177d9aa5 100755 (executable)
@@ -176,14 +176,15 @@ def main():
                dirname  = os.path.dirname(x)
                success |= install(basename, dirname, options)
 
+       global skipped_directories
+       for x in skipped_directories:
+               eqawarn(["QA Notice: dohtml on directory " + \
+                       "'%s' without recursion option" % x])
+
        if success:
                retcode = 0
        else:
                retcode = 1
-               global skipped_directories
-               for x in skipped_directories:
-                       eqawarn(["QA Notice: dohtml on directory " + \
-                               "'%s' without recursion option" % x])
 
        sys.exit(retcode)
 
index b9380c7b0b31f556d77ceb75350d9232df40d0dc..0035102babb6eef97ae2f89297c9f06418cb3546 100644 (file)
@@ -276,6 +276,11 @@ acceptance of the first choice. This option is
 intended to be set in the \fBmake.conf\fR(5)
 \fBEMERGE_DEFAULT_OPTS\fR variable.
 .TP
+.BR \-\-backtrack=COUNT
+Specifies an integer number of times to backtrack if
+dependency calculation fails due to a conflict or an
+unsatisfied dependency (default: \'5\').
+.TP
 .BR "\-\-binpkg\-respect\-use < y | n >"
 Tells emerge to ignore binary packages if their use flags
 don't match the current configuration. (default: \'n\')
index 5fa1bdf8ed7af255bbad2a912a5870786e4cd741..4ca110fab34972120b98365fb8ae891694203e93 100644 (file)
@@ -120,7 +120,7 @@ Ebuilds that have an unsupported EAPI version (you must upgrade portage)
 Ebuilds that have a missing or empty HOMEPAGE variable
 .TP
 .B IUSE.invalid
-This build has a variable in IUSE that is not in the use.desc or use.local.desc file
+This ebuild has a variable in IUSE that is not in the use.desc or its metadata.xml file
 .TP
 .B IUSE.undefined
 This ebuild does not define IUSE (style guideline says to define IUSE even when empty)
index cef1d47e88ec1b44894a2d051df91a0a4de87422..654120b5701edd8a470c804a80b6511eec74d666 100644 (file)
@@ -5329,7 +5329,7 @@ def backtrack_depgraph(settings, trees, myopts, myparams,
 def _backtrack_depgraph(settings, trees, myopts, myparams, 
        myaction, myfiles, spinner):
 
-       backtrack_max = 30
+       backtrack_max = myopts.get('--backtrack', 5)
        runtime_pkg_mask = None
        allow_backtracking = True
        backtracked = 0
index 94dc17218bb48a31fd445c832ed91f3f6a3a123a..422442fb470e5430ce3ef6561ab051a8d8e3aa4a 100644 (file)
@@ -279,6 +279,13 @@ def help(myopts, havecolor=1):
                for line in wrap(desc, desc_width):
                        print(desc_indent + line)
                print()
+               print("       " + green("--backtrack") + " " + turquoise("COUNT"))
+               desc = "Specifies an integer number of times to backtrack if " + \
+                       "dependency calculation fails due to a conflict or an " + \
+                       "unsatisfied dependency (default: '5')."
+               for line in wrap(desc, desc_width):
+                       print(desc_indent + line)
+               print()
                print("        " + green("--binpkg-respect-use") + \
                        " < " + turquoise("y") + " | " + turquoise("n") + " >")
                desc = "Tells emerge to ignore binary packages if their use flags" + \
index 90e08aaa99fbef1f171e7dce35d4fb8b656824a1..b73dc09001018267adb726440f65115efa7ca309 100644 (file)
@@ -511,6 +511,15 @@ def parse_opts(tmpcmdline, silent=False):
                        "help":"temporarily override ACCEPT_PROPERTIES",
                        "action":"store"
                },
+
+               "--backtrack": {
+
+                       "help"   : "Specifies how many times to backtrack if dependency " + \
+                               "calculation fails ",
+
+                       "action" : "store"
+               },
+
                "--config-root": {
                        "help":"specify the location for portage configuration files",
                        "action":"store"
@@ -732,6 +741,21 @@ def parse_opts(tmpcmdline, silent=False):
        if myoptions.selective == "True":
                myoptions.selective = True
 
+       if myoptions.backtrack is not None:
+
+               try:
+                       backtrack = int(myoptions.backtrack)
+               except (OverflowError, ValueError):
+                       backtrack = -1
+
+               if backtrack < 0:
+                       backtrack = None
+                       if not silent:
+                               writemsg("!!! Invalid --backtrack parameter: '%s'\n" % \
+                                       (myoptions.backtrack,), noiselevel=-1)
+
+               myoptions.backtrack = backtrack
+
        if myoptions.deep is not None:
                deep = None
                if myoptions.deep == "True":
index aefc94b36d041c5e39bd619a64b50cca5d8e3309..e11c7dd7c9f0d8dda598ffddc30327539ef00579 100644 (file)
@@ -332,10 +332,9 @@ def unmerge(root_config, myopts, unmerge_action,
                        parents = []
                        for s in installed_sets:
                                # skip sets that the user requested to unmerge, and skip world 
-                               # unless we're unmerging a package set (as the package would be 
-                               # removed from "world" later on)
-                               if s in root_config.setconfig.active or \
-                                       (s == "selected" and not root_config.setconfig.active):
+                               # user-selected set, since the package will be removed from
+                               # that set later on.
+                               if s in root_config.setconfig.active or s == "selected":
                                        continue
 
                                if s not in sets:
index 6d24a8321ce82d695f165d757edc3913715d96d5..a3e1eb5dd95a85d4b9541cc55e3201718e9aac53 100644 (file)
@@ -543,13 +543,9 @@ def cacheddir(my_original_path, ignorecvs, ignorelist, EmptyOnError, followSymli
                if e.errno == portage.exception.PermissionDenied.errno:
                        raise portage.exception.PermissionDenied(mypath)
                del e
-               if EmptyOnError:
-                       return [], []
-               return None, None
+               return [], []
        except portage.exception.PortageException:
-               if EmptyOnError:
-                       return [], []
-               return None, None
+               return [], []
        # Python retuns mtime in seconds, so if it was changed in the last few seconds, it could be invalid
        if mtime != cached_mtime or time.time() - mtime < 4:
                if mypath in dircache:
@@ -616,7 +612,7 @@ def listdir(mypath, recursive=False, filesonly=False, ignorecvs=False, ignorelis
        @type ignorelist: List
        @param followSymlinks: Follow Symlink'd files and directories
        @type followSymlinks: Boolean
-       @param EmptyOnError: Return [] if an error occurs.
+       @param EmptyOnError: Return [] if an error occurs (deprecated, always True)
        @type EmptyOnError: Boolean
        @param dirsonly: Only return directories.
        @type dirsonly: Boolean
index fdc1ec118013b9e63bb7ade19f99697e32ecf9fa..c42a85ac377a5b762f90159ae943a77c9fb766d2 100644 (file)
@@ -1824,8 +1824,11 @@ class vardbapi(dbapi):
                catdir = base + _os.sep + cat
                t = time.time()
                t = (t, t)
-               for x in (catdir, base):
-                       os.utime(x, t)
+               try:
+                       for x in (catdir, base):
+                               os.utime(x, t)
+               except OSError:
+                       os.makedirs(catdir)
 
        def cpv_exists(self, mykey):
                "Tells us whether an actual ebuild exists on disk (no masking)"
@@ -2908,6 +2911,11 @@ class dblink(object):
                        return
 
                shutil.rmtree(self.dbdir)
+               # If empty, remove parent category directory.
+               try:
+                       os.rmdir(os.path.dirname(self.dbdir))
+               except OSError:
+                       pass
                self.vartree.dbapi._remove(self)
 
        def clearcontents(self):