Merged from trunk 10557:10566
authorFabian Groffen <grobian@gentoo.org>
Wed, 4 Jun 2008 19:39:20 +0000 (19:39 -0000)
committerFabian Groffen <grobian@gentoo.org>
Wed, 4 Jun 2008 19:39:20 +0000 (19:39 -0000)
   | 10558   | Fix regex for compatibility with the regex implementation    |
   | zmedico | from FreeBSD's libc (used by bash on FreeBSD). Thanks to     |
   |         | Alexis Ballier <aballier@g.o> for the patch.                 |

   | 10560   | Avoid an unhandled IndexError thrown from the                |
   | zmedico | PackagesSystemSet constructor when neither /etc/make.profile |
   |         | nor /etc/portage/profile exist.                              |

   | 10561   | Make PackagesSystemSet.description refer to the real profile |
   | zmedico | rather than /etc/portage/profile when possible.              |

   | 10563   | Update --depclean and package.provided docs to indicate      |
   | zmedico | interaction between them.                                    |

   | 10564   | Use a distdir_writable variable in fetch(), for better       |
   | zmedico | control of write operations inside ${DISTDIR}.               |

   | 10566   | Fix typo.                                                    |
   | zmedico |                                                              |

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

bin/doman
man/emerge.1
man/portage.5
pym/_emerge/help.py
pym/portage/__init__.py
pym/portage/sets/profiles.py

index 59de9779429b2c528b5bdb88b561fcee38284aa6..1102c4d075235576a4339dd20cd9cd4b59d6b836 100755 (executable)
--- a/bin/doman
+++ b/bin/doman
@@ -40,7 +40,7 @@ for x in "$@" ; do
                mandir=${i18n}man${suffix:0:1}
        fi
 
-       if [[ ${mandir} =~ man[0-9n](|f|p|pm)$ ]] ; then
+       if [[ ${mandir} =~ man[0-9n](f|p|pm)?$ ]] ; then
                if [[ -s ${x} ]] ; then
                        if [[ ! -d ${ED}/usr/share/man/${mandir} ]] ; then
                                install -d "${ED}/usr/share/man/${mandir}"
index a09beee978237936ffc7b93fc0df51c05e6442fd..1a1dbf5250c3317c0ed9a979f3dd41409bfdcc93 100644 (file)
@@ -97,17 +97,23 @@ setups that the user may wish to run.
 .BR \-\-depclean
 Cleans the system by removing packages that are not associated
 with explicitly merged packages. Depclean works by creating the
-full dependency tree from the system list and the world file,
+full dependency tree from the system and world sets,
 then comparing it to installed packages. Packages installed, but
-not associated with an explicit merge are listed as candidates
-for unmerging. Inexperienced users are advised to use \fB\-\-pretend\fR
+not part of the dependency tree, will be uninstalled by depclean.
+Inexperienced users are advised to use \fB\-\-pretend\fR
 with this option in order to see a preview of which packages
-will be uninstalled. \fBWARNING: Removing some
+will be uninstalled.
+
+\fBWARNING: Removing some
 packages may cause packages which link to the removed package 
 to stop working and complain about missing libraries.\fR
 Rebuild the complaining package to fix this issue.  Also see
 \fB\-\-with\-bdeps\fR for behavior with respect to build time dependencies that
-are not strictly required. Depclean serves as a dependency aware
+are not strictly required. Note that packages listed in
+package.provided (see \fBportage\fR(5)) may be removed by
+depclean, even if they are part of the world set.
+
+Depclean serves as a dependency aware
 version of \fB\-\-unmerge\fR. When given one or more atoms, it will
 unmerge matched packages that have no reverse dependencies. Use
 \fB\-\-depclean\fR together with \fB\-\-verbose\fR to show reverse
index 9164ada887b7bcbb2be4796e45611d862c10b0b1..d6eb83cb643de0cb5a3fd32910aa9cfae28007e7 100644 (file)
@@ -213,15 +213,20 @@ useful for stage builders.
 .TP
 .BR package.provided
 A list of packages (one per line) that portage should assume have been 
-provided.  Useful for porting to non-Linux systems.  Portage will not 
-attempt to update a package that is listed here unless another package 
-explicitly requires a version that is newer than what has been listed.  
-Basically, it's a list that replaces the \fBemerge \-\-inject\fR syntax.
+provided.  Useful for porting to non-Linux systems. Basically, it's a
+list that replaces the \fBemerge \-\-inject\fR syntax.
 
 For example, if you manage your own copy of a 2.6 kernel, then you can 
 tell portage that 'sys-kernel/development-sources-2.6.7' is already taken 
 care of and it should get off your back about it.
 
+Portage will not attempt to update a package that is listed here unless
+another package explicitly requires a version that is newer than what
+has been listed. Dependencies that are satisfied by package.provided
+entries may cause installed packages satisfying equivalent dependencies
+to be removed by \fBemerge\fR(1) \fB\-\-depclean\fR actions (see the
+\fBACTIONS\fR section of the \fBemerge\fR(1) man page for more information).
+
 Virtual packages (virtual/*) should not be specified in package.provided.
 Depending on the type of virtual, it may be necessary to add an entry to the
 virtuals file and/or add a package that satisfies a virtual to
index 1e3f54affeb142a68665b77490b3c1227d9c3b06..1996a61ab3d6355f18cb64afc45eae38f7b3ead5 100644 (file)
@@ -65,22 +65,37 @@ def help(myaction,myopts,havecolor=1):
                print "              file setup or other similar setups that the user may wish to run."
                print
                print "       "+green("--depclean")
-               print "              Cleans the system by removing packages that are not associated"
-               print "              with explicitly merged packages. Depclean works by creating the"
-               print "              full dependency tree from the system list and the world file,"
-               print "              then comparing it to installed packages. Packages installed, but"
-               print "              not associated with an explicit merge are listed as candidates"
-               print "              for unmerging. Inexperienced users are advised to use --pretend"
-               print "              with this option in order to see a preview of which packages will"
-               print "              be uninstalled. "+turquoise(" WARNING: Removing some packages may cause")
-               print "              "+turquoise("packages which link to the removed package to stop working and")
-               print "              "+turquoise("complain about missing libraries. Rebuild the complaining package")
-               print "              "+turquoise("to fix this issue.")+" Also see --with-bdeps for behavior with"
-               print "              respect to build time dependencies that are not strictly"
-               print "              required. Depclean serves as a dependency aware version of"
-               print "              --unmerge. When given one or more atoms, it will unmerge matched"
-               print "              packages that have no reverse dependencies. Use --depclean"
-               print "              together with --verbose to show reverse dependencies."
+               paragraph = "Cleans the system by removing packages that are not associated " + \
+                       "with explicitly merged packages. Depclean works by creating the " + \
+                       "full dependency tree from the system and world sets, " + \
+                       "then comparing it to installed packages. Packages installed, but " + \
+                       "not part of the dependency tree, will be uninstalled by depclean. " + \
+                       "Inexperienced users are advised to use --pretend " + \
+                       "with this option in order to see a preview of which packages " + \
+                       "will be uninstalled."
+               for line in wrap(paragraph, desc_width):
+                       print desc_indent + line
+               print
+
+               paragraph =  "WARNING: Removing some " + \
+                       "packages may cause packages which link to the removed package  " + \
+                       "to stop working and complain about missing libraries. " + \
+                       "Rebuild the complaining package to fix this issue.  Also see " + \
+                       "--with-bdeps for behavior with respect to build time dependencies that " + \
+                       "are not strictly required. Note that packages listed in " + \
+                       "package.provided (see portage(5)) may be removed by " + \
+                       "depclean, even if they are part of the world set."
+               for line in wrap(paragraph, desc_width):
+                       print desc_indent + line
+               print
+
+               paragraph = "Depclean serves as a dependency aware " + \
+                       "version of --unmerge. When given one or more atoms, it will " + \
+                       "unmerge matched packages that have no reverse dependencies. Use " + \
+                       "--depclean together with --verbose to show reverse " + \
+                       "dependencies."
+               for line in wrap(paragraph, desc_width):
+                       print desc_indent + line
                print
                print "       "+green("--info")
                print "              Displays important portage variables that will be exported to"
index 35ebca987c19df737581142d7cdd9a4279f26960..7b813fc1763665c443dc965d1c863ba7df34a67b 100644 (file)
@@ -3120,7 +3120,7 @@ def _checksum_failure_temp_file(distdir, basename):
 
 def _check_digests(filename, digests):
        """
-       Check digests and displey a message if an error occurs.
+       Check digests and display a message if an error occurs.
        @return True if all digests match, False otherwise.
        """
        verified_ok, reason = portage.checksum.verify_all(filename, digests)
@@ -3424,6 +3424,8 @@ def fetch(myuris, mysettings, listonly=0, fetchonly=0, locks_in_subdir=".locks",
                                return 0
                        del distlocks_subdir
 
+       distdir_writable = can_fetch and not fetch_to_ro
+
        for myfile in filedict:
                """
                fetched  status
@@ -3464,7 +3466,7 @@ def fetch(myuris, mysettings, listonly=0, fetchonly=0, locks_in_subdir=".locks",
                                        writemsg("!!! Insufficient space to store %s in %s\n" % (myfile, mysettings["DISTDIR"]), noiselevel=-1)
                                        has_space = False
 
-                       if use_locks and can_fetch:
+                       if distdir_writable and use_locks:
                                waiting_msg = None
                                if not parallel_fetchonly and "parallel-fetch" in features:
                                        waiting_msg = ("Fetching '%s' " + \
@@ -3493,7 +3495,7 @@ def fetch(myuris, mysettings, listonly=0, fetchonly=0, locks_in_subdir=".locks",
                                match, mystat = _check_distfile(
                                        myfile_path, pruned_digests, eout)
                                if match:
-                                       if can_fetch and not fetch_to_ro:
+                                       if distdir_writable:
                                                try:
                                                        apply_secpass_permissions(myfile_path,
                                                                gid=portage_gid, mode=0664, mask=02,
@@ -3505,7 +3507,7 @@ def fetch(myuris, mysettings, listonly=0, fetchonly=0, locks_in_subdir=".locks",
                                                        del e
                                        continue
 
-                               if can_fetch and mystat is None:
+                               if distdir_writable and mystat is None:
                                        # Remove broken symlinks if necessary.
                                        try:
                                                os.unlink(myfile_path)
@@ -3514,12 +3516,12 @@ def fetch(myuris, mysettings, listonly=0, fetchonly=0, locks_in_subdir=".locks",
 
                                if mystat is not None:
                                        if mystat.st_size == 0:
-                                               if can_fetch:
+                                               if distdir_writable:
                                                        try:
                                                                os.unlink(myfile_path)
                                                        except OSError:
                                                                pass
-                                       elif can_fetch:
+                                       elif distdir_writable:
                                                if mystat.st_size < fetch_resume_size and \
                                                        mystat.st_size < size:
                                                        writemsg((">>> Deleting distfile with size " + \
@@ -3539,7 +3541,7 @@ def fetch(myuris, mysettings, listonly=0, fetchonly=0, locks_in_subdir=".locks",
                                                                "File renamed to '%s'\n\n" % \
                                                                temp_filename, noiselevel=-1)
 
-                               if can_fetch and ro_distdirs:
+                               if distdir_writable and ro_distdirs:
                                        readonly_file = None
                                        for x in ro_distdirs:
                                                filename = os.path.join(x, myfile)
@@ -3590,7 +3592,7 @@ def fetch(myuris, mysettings, listonly=0, fetchonly=0, locks_in_subdir=".locks",
                                        # If the file is empty then it's obviously invalid. Remove
                                        # the empty file and try to download if possible.
                                        if mystat.st_size == 0:
-                                               if can_fetch:
+                                               if distdir_writable:
                                                        try:
                                                                os.unlink(myfile_path)
                                                        except EnvironmentError:
@@ -3625,7 +3627,7 @@ def fetch(myuris, mysettings, listonly=0, fetchonly=0, locks_in_subdir=".locks",
                                                                        (reason[1], reason[2]), noiselevel=-1)
                                                                if reason[0] == "Insufficient data for checksum verification":
                                                                        return 0
-                                                               if can_fetch and not restrict_fetch:
+                                                               if distdir_writable:
                                                                        temp_filename = \
                                                                                _checksum_failure_temp_file(
                                                                                mysettings["DISTDIR"], myfile)
index 35cf4d87db2fb4dc114cc91ab0a90381d2895824..4b690895b4238d45ddf457b069543cac57269fc3 100644 (file)
@@ -5,6 +5,7 @@
 import os
 from portage.util import grabfile_package, stack_lists
 from portage.sets.base import PackageSet
+from portage.const import EPREFIX
 
 __all__ = ["PackagesSystemSet"]
 
@@ -14,8 +15,15 @@ class PackagesSystemSet(PackageSet):
        def __init__(self, profile_paths):
                super(PackagesSystemSet, self).__init__()
                self._profile_paths = profile_paths
-               self.description = "System packages for profile %s" % self._profile_paths[-1]
-       
+               if profile_paths:
+                       description = self._profile_paths[-1]
+                       if description == EPREFIX+"/etc/portage/profile" and \
+                               len(self._profile_paths) > 1:
+                               description = self._profile_paths[-2]
+               else:
+                       description = None
+               self.description = "System packages for profile %s" % description
+
        def load(self):
                mylist = [grabfile_package(os.path.join(x, "packages")) for x in self._profile_paths]
                mylist = stack_lists(mylist, incremental=1)