Merged from trunk -r12352:12367
authorFabian Groffen <grobian@gentoo.org>
Thu, 8 Jan 2009 19:57:19 +0000 (19:57 -0000)
committerFabian Groffen <grobian@gentoo.org>
Thu, 8 Jan 2009 19:57:19 +0000 (19:57 -0000)
   | 12359   | Bug #252727 - Use `git diff-index --name-only                |
   | zmedico | --diff-filter=M HEAD` instead of `git ls-files -m            |
   |         | --with-tree=HEAD` since the latter doesn't behave like we    |
   |         | want for files that have been added to the index. Also, use  |
   |         | `git diff-index` instead of `git diff` since the latter is   |
   |         | considered a high-level "porcelain" command which means that |
   |         | it's interface may not be reliable.                          |

   | 12360   | Inside git_sync_timestamps(), use git-diff-index for the     |
   | zmedico | same reason that repoman now uses it since bug #252727.      |

   | 12361   | Wrap lines to 80 columns and remove extra blank lines.       |
   | zmedico |                                                              |

   | 12362   | Add notes about FEATURES=protect-owned and move the note     |
   | zmedico | about --complete-graph to NEWS.                              |

   | 12363   | Bug #252840 - Fix TypeError which is triggered by a broken   |
   | zmedico | override of varnings.formatwarning(). Override               |
   |         | warnings.showwarning() instead since the api docs say it may |
   |         | be overriden while they do not say this about                |
   |         | formatwarning().                                             |

   | 12364   | Inside _showwarning(), import sys since otherwise it's None  |
   | zmedico | for some reason.                                             |

   | 12365   | Bug #253002 - Add a new variable.invalidchar check for       |
   | zmedico | metadata variables that contain characters that are not part |
   |         | of the ASCII character set.                                  |

   | 12366   | Fix 'TypeError: not all arguments converted during string    |
   | zmedico | formatting' triggered by repoman -v. Thanks to Javier        |
   |         | Villavicencio <the_paya@g.o> for reporting.                  |

   | 12367   | Specify that metadata variable values should only contain    |
   | zmedico | ASCII as per GLEP 31.                                        |

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

NEWS
RELEASE-NOTES
bin/repoman
man/ebuild.5
man/repoman.1
pym/_emerge/__init__.py
pym/portage_compat_namespace.py

diff --git a/NEWS b/NEWS
index 2e8942a377a9a2710e351510d7e2e44b1c500c51..a64b4060261f01183df8ead8a4dfa0de7c113765 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -32,10 +32,20 @@ portage-2.1.6
 * Namespace sanitizing: move all portage related code into portage.* namespace,
   rename portage_foo modules to portage.foo (but keep symlinks for compability)
 * Add support for news items (GLEP 42)
+* Add FEATURES=protect-owned which is identical to the collision-protect
+  feature except that files may be overwritten if they are not explicitly
+  listed in the contents of a currently installed package.
 
 portage-2.1.5
 -------------
 
+* For extra careful dependency handling, emerge has a new --complete-graph
+  option that causes it to consider the deep dependencies of all packages from
+  the system and world sets. With this option enabled, emerge will bail out
+  if it determines that the given operation will break any dependencies of
+  the packages that have been added to the graph. Unlike the --deep option,
+  the --complete-graph option does not cause any more packages to be updated
+  than would have otherwise been updated with the option disabled.
 * Blockers are now resolved automatically in many more cases
   than before.  When it's safe, blocked packages are uninstalled
   automatically so that users are no longer inconvenienced with the
index 47627acd6d11bb215e0c3b7ffe4652253023bf6d..540809a43deb98beb25c3b655e70fd41e52c6d7c 100644 (file)
@@ -4,19 +4,20 @@ Features/major bugfixes are listed in NEWS
 portage-2.2
 ==================================
 
-* Portage now warns if an ebuild repository does not have a name, as several new
-  features in 2.2 make use of or require named repositories. The repository name
-  is stored in profiles/repo_name in each repository.
-* Package set support: There are several important notes regarding package sets:
-  - setnames have to be prefixed with @ (exceptions: 'world' and 'system' can be 
-    used without the prefix)
-  - they may currently only include simple and versioned atoms or other sets, use
-    conditionals or any-of constructs aren't possible yet
-  - sets can be referenced either in other file-based sets or as argument to emerge, but
-    not in ebuilds, config files or other tools at this time.
+* Portage now warns if an ebuild repository does not have a name, as several
+  new features in 2.2 make use of or require named repositories. The repository
+  name is stored in profiles/repo_name in each repository.
+* Package set support: There are several important notes regarding package
+  sets:
+  - setnames have to be prefixed with @ (exceptions: 'world' and 'system' can
+    be used without the prefix)
+  - they may currently only include simple and versioned atoms or other sets,
+    use conditionals or any-of constructs aren't possible yet
+  - sets can be referenced either in other file-based sets or as argument to
+    emerge, but not in ebuilds, config files or other tools at this time.
   - packages won't be unmerged if they are referenced by an installed package
     set (with the exception of the world set, and installed being determined
-       by the world_sets file).
+    by the world_sets file).
 * "world" does no longer include "system" unconditionally, but you can add
   "@system" to the world_sets file to restore the old state.
 
@@ -25,16 +26,21 @@ portage-2.1.6
 
 * FEATURES=fixpackages is now enabled by default via make.globals. Set
   FEATURES="-fixpackages" in make.conf if you'd like to disable it.
+* File collision protection is now enabled by default via make.globals with
+  FEATURES=protect-owned. In order to protect files from be overwritten or
+  removed a inappropriate times, it is recommended to leave protect-owned
+  (or the similar collision-protect feature) enabled at all times.
 * The python namespace for portage has been sanitized, all portage related code
-  is now contained within the portage namespace. External script should be updated
-  accordingly, though links exist for backward compability.
+  is now contained within the portage namespace. External script should be
+  updated accordingly, though links exist for backward compability.
 * -* support in package.keywords was changed as it was inconsistent with 
-  ACCEPT_KEYWORDS behavior (also see http://dev.gentoo.org/~genone/docs/KEYWORDS.stupid).
-  Previously having -* in package.keywords matched packages with KEYWORDS="-*", 
+  ACCEPT_KEYWORDS behavior (also see
+  http://dev.gentoo.org/~genone/docs/KEYWORDS.stupid).
+  Previously having -* in package.keywords matched packages with KEYWORDS="-*",
   now it resets the ACCEPT_KEYWORDS list for the given atom like it does when
   used in ACCEPT_KEYWORDS.
-  For packages that don't specify any other KEYWORDS you can use the new ** token
-  as documented in portage(5) to disable KEYWORDS filtering completely.
+  For packages that don't specify any other KEYWORDS you can use the new **
+  token as documented in portage(5) to disable KEYWORDS filtering completely.
 
 portage-2.1.5
 ==================================
@@ -47,7 +53,6 @@ portage-2.1.5
   earlier phase (such as pkg_preinst) and store the result in a global
   variable to be accessed by pkg_postinst when it is called. Bug #226505
   tracks all issues related to this phase execution order change.
-
 * The metadata-transfer feature is now disabled by default. This disables the
   "Updating Portage cache" routine that used to run at the tail end of each
   `emerge --sync` operation. If you use something like the sqlite module and
@@ -57,21 +62,12 @@ portage-2.1.5
   that override eclasses from PORTDIR (in this case, you may have disabled
   a relevant warning message by setting PORTAGE_ECLASS_WARNING_ENABLE="0" in
   make.conf).
-
 * The parallel-fetch feature is now enabled by default. It is optimized
   to avoid doing redundant checksums for previously downloaded files that have
   the correct size. Run `tail -f /var/log/emerge-fetch.log` in a
   terminal to view parallel-fetch progress. Add FEATURES="-parallel-fetch"
   to /etc/make.conf if you want to disable this feature.
 
-* For extra careful dependency handling, emerge has a new --complete-graph
-  option that causes it to consider the deep dependencies of all packages from
-  the system and world sets. With this option enabled, emerge will bail out
-  if it determines that the given operation will break any dependencies of
-  the packages that have been added to the graph. Unlike the --deep option,
-  the --complete-graph option does not cause any more packages to be updated
-  than would have otherwise been updated with the option disabled.
-
 portage-2.1.4.1
 ==================================
 
index 2a1cafc900b66b123fad30a1c9a5abc701bffc15..f088b31beeff0e143c4c5962b81f99942dd2661d 100755 (executable)
@@ -296,6 +296,7 @@ qahelp={
        "ebuild.syntax":"Error generating cache entry for ebuild; typically caused by ebuild syntax error or digest verification failure",
        "ebuild.output":"A simple sourcing of the ebuild produces output; this breaks ebuild policy.",
        "ebuild.nesteddie":"Placing 'die' inside ( ) prints an error, but doesn't stop the ebuild.",
+       "variable.invalidchar":"A variable contains an invalid character that is not part of the ASCII character set",
        "variable.readonly":"Assigning a readonly variable",
        "LIVEVCS.stable":"This ebuild is a live checkout from a VCS but has stable keywords.",
        "IUSE.invalid":"This ebuild has a variable in IUSE that is not in the use.desc or use.local.desc file",
@@ -358,6 +359,8 @@ qawarnings = set((
 "LIVEVCS.stable"
 ))
 
+non_ascii_re = re.compile(r'[^\x00-\x7f]')
+
 missingvars=["KEYWORDS","LICENSE","DESCRIPTION","HOMEPAGE","SLOT"]
 allvars = set(x for x in portage.auxdbkeys if not x.startswith("UNUSED_"))
 allvars.discard("CDEPEND")
@@ -746,10 +749,15 @@ if vcs == "svn":
        mychanged = [ "./" + elem.split()[-1:][0] for elem in svnstatus if elem and elem[:1] in "MR" ]
        mynew     = [ "./" + elem.split()[-1:][0] for elem in svnstatus if elem.startswith("A") ]
 elif vcs == "git":
-       mychanged = os.popen("git ls-files -m --with-tree=HEAD").readlines()
-       mychanged = [ "./" +  elem[:-1] for elem in mychanged ]
-       mynew = os.popen("git diff --cached --name-only --diff-filter=A").readlines()
        strip_levels = repolevel - 1
+
+       mychanged = os.popen("git diff-index --name-only --diff-filter=M HEAD").readlines()
+       if strip_levels:
+               mychanged = [elem[repo_subdir_len:] for elem in mychanged \
+                       if elem[:repo_subdir_len] == repo_subdir]
+       mychanged = ["./" + elem[:-1] for elem in mychanged]
+
+       mynew = os.popen("git diff-index --name-only --diff-filter=A HEAD").readlines()
        if strip_levels:
                mynew = [elem[repo_subdir_len:] for elem in mynew \
                        if elem[:repo_subdir_len] == repo_subdir]
@@ -1095,6 +1103,17 @@ for x in scanlist:
                inherited = pkg.inherited
                live_ebuild = live_eclasses.intersection(inherited)
 
+               for k, v in myaux.iteritems():
+                       if not isinstance(v, basestring):
+                               continue
+                       m = non_ascii_re.search(v)
+                       if m is not None:
+                               stats["variable.invalidchar"] += 1
+                               fails["variable.invalidchar"].append(
+                                       ("%s: %s variable contains non-ASCII " + \
+                                       "character at position %s") % \
+                                       (relative_path, k, m.start() + 1))
+
                if not src_uri_error:
                        # Check that URIs don't reference a server from thirdpartymirrors.
                        for uri in portage.flatten(portage.dep.use_reduce(
@@ -1742,15 +1761,21 @@ else:
                        for prop in props if " - " in prop)
 
        elif vcs == "git":
-               mychanged = os.popen("git ls-files -m --with-tree=HEAD").readlines()
-               mychanged = [ "./" +  elem[:-1] for elem in mychanged ]
-               mynew = os.popen("git diff --cached --name-only --diff-filter=A").readlines()
                strip_levels = repolevel - 1
+
+               mychanged = os.popen("git diff-index --name-only --diff-filter=M HEAD").readlines()
+               if strip_levels:
+                       mychanged = [elem[repo_subdir_len:] for elem in mychanged \
+                               if elem[:repo_subdir_len] == repo_subdir]
+               mychanged = ["./" + elem[:-1] for elem in mychanged]
+
+               mynew = os.popen("git diff-index --name-only --diff-filter=A HEAD").readlines()
                if strip_levels:
                        mynew = [elem[repo_subdir_len:] for elem in mynew \
                                if elem[:repo_subdir_len] == repo_subdir]
                mynew = ["./" + elem[:-1] for elem in mynew]
-               myremoved = os.popen("git diff --cached --name-only --diff-filter=D").readlines()
+
+               myremoved = os.popen("git diff-index --name-only --diff-filter=D HEAD").readlines()
                if strip_levels:
                        myremoved = [elem[repo_subdir_len:] for elem in myremoved \
                                if elem[:repo_subdir_len] == repo_subdir]
@@ -1807,8 +1832,8 @@ else:
                print "%s have headers that will change." % green(str(len(myheaders)))
                print "* Files with headers will cause the " + \
                        "manifests to be made and recommited."
-       logging.info("myupdates:", str(myupdates))
-       logging.info("myheaders:", str(myheaders))
+       logging.info("myupdates: %s", myupdates)
+       logging.info("myheaders: %s", myheaders)
 
        commitmessage = options.commitmsg
        if options.commitmsgfile:
index e71d9282a00aac65701c4841172f17bc0d095fce..50a54a0b0ade3c374fedf208951c5248ebbf862e 100644 (file)
@@ -55,6 +55,9 @@ ebuilds (such as the PORTAGE* and PORTDIR* variables)
 .br
 \- When assigning values to variables in ebuilds, you \fBcannot have a
 space\fR between the variable name and the equal sign.
+.br
+\- Variable values should only contain characters that are members of the
+\fBascii\fR(7) character set. This requirement is mandated by \fBGLEP 31\fR.
 .TP
 .B P
 This variable contains the package name without the ebuild revision.
index dde0d15d2a83776200ede82348c153185ac919a8..0380adfd6964dc69b60e9f72f587ba1563908337 100644 (file)
@@ -270,6 +270,10 @@ tracked in bugs.gentoo.org
 .B usage.obsolete
 The ebuild makes use of an obsolete construct
 .TP
+.B variable.invalidchar
+A variable contains an invalid character that is not part of the ASCII
+character set.
+.TP
 .B variable.readonly
 Assigning a readonly variable
 .TP
index ac7523f0cac61589d1d1c76cf71068302f1581e4..b7dc2ee8968caf9e83cf4211b04cf425dbdbecb4 100644 (file)
@@ -12370,7 +12370,7 @@ def git_sync_timestamps(settings, portdir):
                return 1
 
        args = [portage.const.BASH_BINARY, "-c",
-               "cd %s && git ls-files -m --with-tree=HEAD" % \
+               "cd %s && git diff-index --name-only --diff-filter=M HEAD" % \
                portage._shell_quote(portdir)]
        import subprocess
        proc = subprocess.Popen(args, stdout=subprocess.PIPE)
index 07f22a95ec08a8d643d8925fe573c532ef119547..736b67833535b4374c8706cf9d47b1b2f21aae9f 100644 (file)
@@ -31,10 +31,16 @@ try:
 except (ImportError, AttributeError):
        raise ImportError("No module named %s" % __oldname)
 
-def _formatwarning(message, category, filename, lineno):
-       return "%s:%s: %s: %s\n" % (filename, lineno, category.__name__, message)
-
-warnings.formatwarning = _formatwarning
+def _showwarning(message, category, filename, lineno, file=None, line=None):
+       if file is None:
+               import sys
+               file = sys.stderr
+       try:
+               file.write("%s:%s: %s: %s\n" % (filename, lineno, category.__name__, message))
+       except IOError:
+               pass
+
+warnings.showwarning = _showwarning
 
 warnings.warn("DEPRECATION NOTICE: The %s module was replaced by %s" % (__oldname, __newname), DeprecationWarning)
 sys.modules[__oldname] = __realmodule