Merged from trunk -r15825:15835
authorFabian Groffen <grobian@gentoo.org>
Sat, 20 Mar 2010 18:31:13 +0000 (18:31 -0000)
committerFabian Groffen <grobian@gentoo.org>
Sat, 20 Mar 2010 18:31:13 +0000 (18:31 -0000)
   | 15826   | Update SIGPIPE comments to refer to "[Errno 32] Broken pipe" |
   | zmedico | exceptions since this is signal hander now set automatically |
   |         | for subprocesses after the fork in portage.process.spawn().  |

   | 15827   | Revert tar error handling changes from bug #309001 since we  |
   | zmedico | can't necessarily trust tar exist status alone (reverts      |
   |         | r15820 and r15821).                                          |

   | 15828   | Bug #299095 - Always use UTF-8 codec when opening ebuilds,   |
   | zmedico | to avoid UnicodeDecodeError with python3.                    |

   | 15829   | Add a TODO note about adding a registration interface for    |
   | zmedico | eclasses to register phase hooks, in order to migrate away   |
   |         | from global scope useq() calls.                              |

   | 15830   | Fix breakage from previous commit.                           |
   | zmedico |                                                              |

   | 15831   | Bug #309699 - Update --emptytree docs. Thanks to Ben Kohler  |
   | zmedico | <bkohler@gmail.com> for wording suggestions.                 |

   | 15832   | Bug #309907 - Fix update_config_files() to handle            |
   | zmedico | package.license.                                             |

   | 15833   | Bug #310135 - Skip the changelog.ebuildadded for all         |
   | zmedico | distributed SCMs.                                            |

   | 15834   | Note that use.local.desc is automatically generated, and     |
   | zmedico | refer to GLEP 56.                                            |

   | 15835   | Fix typo.                                                    |
   | zmedico |                                                              |

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

bin/ebuild
bin/ebuild.sh
bin/emerge
bin/repoman
man/emerge.1
man/make.conf.5
man/portage.5
pym/_emerge/BinpkgExtractorAsync.py
pym/_emerge/help.py
pym/portage/update.py

index 9c6b8fefb921f62a150498b0d65c9d70af5363fe..30f75f246bfef3ce2ac8cc74070ac0b5e1d6a1a0 100755 (executable)
@@ -17,7 +17,8 @@ try:
 
        signal.signal(signal.SIGINT, exithandler)
        signal.signal(signal.SIGTERM, exithandler)
-       # Quiet killing of subprocesses by SIGPIPE (see bug #309001).
+       # Prevent "[Errno 32] Broken pipe" exceptions when
+       # writing to a pipe.
        signal.signal(signal.SIGPIPE, signal.SIG_DFL)
 
 except KeyboardInterrupt:
index 5e217b7311f59dc9c4e75eba7aac49caafcec082..3e127ac3a7a3d711d7185858eba7042bdf30f7cc 100755 (executable)
@@ -140,12 +140,14 @@ useq() {
        fi
 
        if [[ $EBUILD_PHASE = depend ]] ; then
-               # Skip this for older EAPIs since lots of ebuilds/eclasses
-               # have stuff in global scope that really belongs somewhere
-               # like pkg_setup or src_configure.
-               if [[ -n $EAPI ]] && ! hasq "$EAPI" 0 1 2 3 3_pre2 ; then
-                       die "use() called during invalid phase: $EBUILD_PHASE"
-               fi
+               # TODO: Add a registration interface for eclasses to register
+               # any number of phase hooks, so that global scope eclass
+               # initialization can by migrated to phase hooks in new EAPIs.
+               # Example: add_phase_hook before pkg_setup $ECLASS_pre_pkg_setup
+               #if [[ -n $EAPI ]] && ! hasq "$EAPI" 0 1 2 3 ; then
+               #       die "use() called during invalid phase: $EBUILD_PHASE"
+               #fi
+               true
 
        # Make sure we have this USE flag in IUSE
        elif [[ -n $PORTAGE_IUSE && -n $EBUILD_PHASE ]] ; then
@@ -362,7 +364,8 @@ unpack() {
 
                _unpack_tar() {
                        if [ "${y}" == "tar" ]; then
-                               $1 -dc "$srcdir$x" | tar xof - || die "$myfail"
+                               $1 -dc "$srcdir$x" | tar xof -
+                               assert "$myfail"
                        else
                                $1 -dc "${srcdir}${x}" > ${x%.*} || die "$myfail"
                        fi
@@ -377,7 +380,8 @@ unpack() {
                                tar xozf "$srcdir$x" || die "$myfail"
                                ;;
                        tbz|tbz2)
-                               bzip2 -dc "$srcdir$x" | tar xof - || die "$myfail"
+                               bzip2 -dc "$srcdir$x" | tar xof -
+                               assert "$myfail"
                                ;;
                        ZIP|zip|jar)
                                unzip -qo "${srcdir}${x}" || die "$myfail"
index e88d43e04f7642d734bdad6713b520508889db70..5321a9440d26b24dc46c3b64a790da504d3b37d6 100755 (executable)
@@ -17,7 +17,8 @@ try:
 
        signal.signal(signal.SIGINT, exithandler)
        signal.signal(signal.SIGTERM, exithandler)
-       # Quiet killing of subprocesses by SIGPIPE (see bug #309001).
+       # Prevent "[Errno 32] Broken pipe" exceptions when
+       # writing to a pipe.
        signal.signal(signal.SIGPIPE, signal.SIG_DFL)
 
 except KeyboardInterrupt:
index 13beaa29e5f01fbec55f89a3419600b21af72d54..b43f902970f0d0c8331a5427467be2cc70f7d189 100755 (executable)
@@ -497,6 +497,12 @@ elif os.path.isdir(os.path.join(portdir_overlay, ".bzr")):
 elif os.path.isdir(os.path.join(portdir_overlay, ".hg")):
        vcs = "hg"
 
+# Note: We don't use ChangeLogs in distributed SCMs.
+# It will be generated on server side from scm log,
+# before package moves to the rsync server.
+# This is needed because we try to avoid merge collisions.
+check_changelog = vcs in ('CVS', 'SVN')
+
 vcs_local_opts = repoman_settings.get("REPOMAN_VCS_LOCAL_OPTS", "").split()
 vcs_global_opts = repoman_settings.get("REPOMAN_VCS_GLOBAL_OPTS")
 if vcs_global_opts is None:
@@ -1275,11 +1281,8 @@ for x in scanlist:
                                                        relative_path + ': %s' % error_match.group(1))
 
        del mydigests
-       # Note: We don't use ChangeLogs in distributed SCMs.
-       # It will be generated on server side from scm log,
-       # before package moves to the rsync server.
-       # This is needed because we try to avoid merge collisions.
-       if vcs not in ("git", "hg") and "ChangeLog" not in checkdirlist:
+
+       if check_changelog and "ChangeLog" not in checkdirlist:
                stats["changelog.missing"]+=1
                fails["changelog.missing"].append(x+"/ChangeLog")
        
@@ -1337,7 +1340,8 @@ for x in scanlist:
                if repolevel < 2:
                        ebuild_path = os.path.join(catdir, ebuild_path)
                ebuild_path = os.path.join(".", ebuild_path)
-               if not changelog_modified and ebuild_path in new_ebuilds:
+               if check_changelog and not changelog_modified \
+                       and ebuild_path in new_ebuilds:
                        stats['changelog.ebuildadded'] += 1
                        fails['changelog.ebuildadded'].append(relative_path)
 
@@ -2318,7 +2322,9 @@ else:
        from portage.util import write_atomic
        cvs_header = re.compile(r'^#\s*\$Header.*\$$')
        for x in myheaders:
-               f = open(x)
+               f = codecs.open(_unicode_encode(x,
+                       encoding=_encodings['fs'], errors='strict'),
+                       mode='r', encoding=_encodings['repo.content'], errors='strict')
                mylines = f.readlines()
                f.close()
                modified = False
@@ -2327,7 +2333,8 @@ else:
                                mylines[i] = line.replace("/Attic/", "/")
                                modified = True
                if modified:
-                       write_atomic(x, "".join(mylines))
+                       write_atomic(x, "".join(mylines),
+                               encoding=_encodings['repo.content'], errors='strict')
 
        manifest_commit_required = True
        if vcs in ('cvs', 'svn') and (myupdates or myremoved):
index b93d0b08f5d12c7744a0f4be5f6673f2cc5a10e3..82fe9c216ecb9be32a21481197ac6c9b55efd243 100644 (file)
@@ -354,10 +354,10 @@ behavior with respect to build time dependencies that are not strictly
 required.
 .TP
 .BR "\-\-emptytree " (\fB\-e\fR)
-Reinstalls all world packages and their dependencies to the current USE 
-specifications while differing from the installed set of packages as 
-little as possible.  You should run with \fB\-\-pretend\fR first to make 
-sure the result is what you expect.
+Reinstalls target atoms and their entire deep
+dependency tree, as though no packages are currently
+installed. You should run this with \fB\-\-pretend\fR
+first to make sure the result is what you expect.
 .TP
 .BR "\-\-fail\-clean[=n]"
 Clean up temporary files after a build failure. This is
index ecf6c153e59e465c5343f677a17c126f14ecbc98..68b163d886d1b61023e92e1635ff0040a70fc472 100644 (file)
@@ -38,7 +38,7 @@ Defaults to the value of $ARCH.
 .TP
 \fBACCEPT_LICENSE\fR = \fI[space delimited list of licenses or groups]\fR
 This variable is used to mask packages based on licensing restrictions. It
-make contain both license and group names, where group names are prefixed
+may contain both license and group names, where group names are prefixed
 with the '@' symbol. License groups are defined in the \fIlicense_groups\fR
 file (see \fBportage\fR(5)). In addition to license and group names, the
 \fI*\fR and \fI-*\fR wildcard tokens are also supported. Refer to GLEP 23
index 40bf89f4e64abb5af8954293e31a14ec949ca459..fb354c2201e3ad8d72ec0dd7e6b05b36a2959aad 100644 (file)
@@ -811,8 +811,11 @@ doc \- Adds extra documentation
 .fi
 .TP
 .BR use.local.desc
-All local USE flags must be listed here along with the package and a 
-description.
+All local USE flags are listed here along with the package and a 
+description. This file is automatically generated from the
+metadata.xml files that are included with each individual package.
+Refer to GLEP 56 for further information:
+\fIhttp://www.gentoo.org/proj/en/glep/glep-0056.html\fR.
 
 .nf
 .I Format:
index e646d9c1b03e29d28726c6a27244ba13d4426a51..45af54136be44b610273b59c3bb89314f3782ba1 100644 (file)
@@ -20,7 +20,13 @@ class BinpkgExtractorAsync(SpawnProcess):
 
        def _start(self):
                self.args = [self._shell_binary, "-c",
-                       ("bzip2 -dqc -- %s | tar -xp -C %s -f -") % \
+                       ("bzip2 -dqc -- %s | tar -xp -C %s -f - ; " + \
+                       "p=(${PIPESTATUS[@]}) ; " + \
+                       "if [ ${p[0]} != 0 ] ; then " + \
+                       "echo bzip2 failed with status ${p[0]} ; exit ${p[0]} ; fi ; " + \
+                       "if [ ${p[1]} != 0 ] ; then " + \
+                       "echo tar failed with status ${p[1]} ; exit ${p[1]} ; fi ; " + \
+                       "exit 0 ;") % \
                        (portage._shell_quote(self.pkg_path),
                        portage._shell_quote(self.image_dir))]
 
index 409bbe2909ff351bf9a4c6a689ae3a9950dd0970..0a3cf3e6e60b5e8325ab9b9a154b1c5b1ba98c12 100644 (file)
@@ -372,10 +372,12 @@ def help(myopts, havecolor=1):
                print("              dependencies that are not strictly required.")
                print() 
                print("       "+green("--emptytree")+" ("+green("-e")+" short option)")
-               print("              Virtually tweaks the tree of installed packages to contain")
-               print("              nothing. This is great to use together with --pretend. This makes")
-               print("              it possible for developers to get a complete overview of the")
-               print("              complete dependency tree of a certain package.")
+               desc = "Reinstalls target atoms and their entire deep " + \
+                       "dependency tree, as though no packages are currently " + \
+                       "installed. You should run this with --pretend " + \
+                       "first to make sure the result is what you expect."
+               for line in wrap(desc, desc_width):
+                       print(desc_indent + line)
                print()
                print("       "+green("--fail-clean[=n]"))
                desc = "Clean up temporary files after a build failure. This is " + \
index 7629179359224e3329794b7ef6367400f7459fae..c55741473036cf15b5e1358d76012707b71b87ab 100644 (file)
@@ -194,7 +194,7 @@ def update_config_files(config_root, protect, protect_mask, update_iter):
        update_files = {}
        file_contents = {}
        myxfiles = ["package.mask", "package.unmask", \
-               "package.keywords", "package.use"]
+               "package.keywords", "package.license", "package.use"]
        myxfiles += [os.path.join("profile", x) for x in myxfiles]
        abs_user_config = os.path.join(config_root, USER_CONFIG_PATH)
        recursivefiles = []