From: Fabian Groffen Date: Sun, 1 Nov 2009 10:56:19 +0000 (-0000) Subject: Merged from trunk -r14750:14767 X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=5b2e994ad04b38acc423b0c6ae81cb282bc98bc4;p=portage.git Merged from trunk -r14750:14767 | 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 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 --- diff --git a/bin/dohtml.py b/bin/dohtml.py index 39e7ab107..3224dbbca 100755 --- a/bin/dohtml.py +++ b/bin/dohtml.py @@ -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) diff --git a/man/emerge.1 b/man/emerge.1 index b9380c7b0..0035102ba 100644 --- a/man/emerge.1 +++ b/man/emerge.1 @@ -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\') diff --git a/man/repoman.1 b/man/repoman.1 index 5fa1bdf8e..4ca110fab 100644 --- a/man/repoman.1 +++ b/man/repoman.1 @@ -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) diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py index cef1d47e8..654120b57 100644 --- a/pym/_emerge/depgraph.py +++ b/pym/_emerge/depgraph.py @@ -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 diff --git a/pym/_emerge/help.py b/pym/_emerge/help.py index 94dc17218..422442fb4 100644 --- a/pym/_emerge/help.py +++ b/pym/_emerge/help.py @@ -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" + \ diff --git a/pym/_emerge/main.py b/pym/_emerge/main.py index 90e08aaa9..b73dc0900 100644 --- a/pym/_emerge/main.py +++ b/pym/_emerge/main.py @@ -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": diff --git a/pym/_emerge/unmerge.py b/pym/_emerge/unmerge.py index aefc94b36..e11c7dd7c 100644 --- a/pym/_emerge/unmerge.py +++ b/pym/_emerge/unmerge.py @@ -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: diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py index 6d24a8321..a3e1eb5dd 100644 --- a/pym/portage/__init__.py +++ b/pym/portage/__init__.py @@ -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 diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py index fdc1ec118..c42a85ac3 100644 --- a/pym/portage/dbapi/vartree.py +++ b/pym/portage/dbapi/vartree.py @@ -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):