Merged from trunk 9280:9299
authorFabian Groffen <grobian@gentoo.org>
Fri, 8 Feb 2008 16:00:54 +0000 (16:00 -0000)
committerFabian Groffen <grobian@gentoo.org>
Fri, 8 Feb 2008 16:00:54 +0000 (16:00 -0000)
   | 9281    | Bug #155993 - Update environment.bz2 after postinst in case  |
   | zmedico | installation phases need to pass some variables to           |
   |         | uninstallation phases.                                       |

   | 9283    | Bug #209144 - For emerge --sync, don't return 0 when the     |
   | zmedico | server is out of date.                                       |

   | 9285    | Bug #208782 - Consistently use double quotes rather than     |
   | zmedico | mixining in single quotes.                                   |

   | 9287    | Bug #208743 - Clarify dosed docs to indicate that sed is     |
   | zmedico | performed in place of a file in ${D}.                        |

   | 9289    | Bug #208708 - Fix warnings for system or world packages that |
   | zmedico | are masked.                                                  |

   | 9290    | Add DISTDIR to the EbuildQuote.var_names. Thanks to          |
   | zmedico | Betelgeuse.                                                  |

   | 9292    | Don't show unmasked packages (currently installed packages)  |
   | zmedico | in the masking display.                                      |

   | 9293    | Bug #208708 - Fix masked package display some more: - Warn   |
   | zmedico | if all matching ebuilds are masked or the installed package  |
   |         | itself is masked. - Do not warn if there are simply no       |
   |         | matching ebuilds since that would be annoying in some cases. |

   | 9299    | Fix some broken variable references found by pyflakes.       |
   | zmedico |                                                              |

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

bin/ebuild.sh
bin/isolated-functions.sh
man/ebuild.5
pym/_emerge/__init__.py
pym/portage/__init__.py
pym/portage/dbapi/vartree.py
pym/repoman/checks.py

index 1e17a602c60ed61f1ed0db9af0ea4be21590a523..1704103dec7a7cdfb397e199de4c4a0550b79516 100755 (executable)
@@ -1802,6 +1802,16 @@ if [ -n "${EBUILD_SH_ARGS}" ] ; then
                        ebuild_phase_with_hooks pkg_${EBUILD_SH_ARGS}
                        set +x
                fi
+               if [[ $EBUILD_PHASE == postinst ]] && [[ -n $PORTAGE_UPDATE_ENV ]]; then
+                       # Update environment.bz2 in case installation phases
+                       # need to pass some variables to uninstallation phases.
+                       (
+                               unset S _E_DOCDESTTREE_ _E_EXEDESTTREE_
+                               save_ebuild_env | filter_readonly_variables \
+                                       --filter-sandbox --allow-extra-vars | \
+                                       bzip2 -c -f9 > "$PORTAGE_UPDATE_ENV"
+                       )
+               fi
                ;;
        unpack|compile|test|clean|install)
                if [ "${SANDBOX_DISABLED="0"}" == "0" ]; then
index e0be5d31edd58dc7a7383145d6d77271b8490037..93774dc54e7987b00a92a0d3718ebb1643ebcdf6 100755 (executable)
@@ -485,7 +485,8 @@ save_ebuild_env() {
                        PORTAGE_COLORMAP PORTAGE_CONFIGROOT PORTAGE_DEBUG \
                        PORTAGE_DEPCACHEDIR PORTAGE_GID PORTAGE_INST_GID \
                        PORTAGE_INST_UID PORTAGE_LOG_FILE PORTAGE_MASTER_PID \
-                       PORTAGE_REPO_NAME PORTAGE_RESTRICT PORTAGE_WORKDIR_MODE PORTDIR \
+                       PORTAGE_REPO_NAME PORTAGE_RESTRICT PORTAGE_UPDATE_ENV \
+                       PORTAGE_WORKDIR_MODE PORTDIR \
                        PORTDIR_OVERLAY ${!PORTAGE_SANDBOX_*} PREROOTPATH \
                        PROFILE_PATHS PWORKDIR QA_INTERCEPTORS \
                        RC_DEFAULT_INDENT RC_DOT_PATTERN RC_ENDCOL \
index 5623d9084fc5901eccf7b78cb5ec9147f5a7ddf1..6f6403738ae3c63780e7149e05444c020c80ffea 100644 (file)
@@ -727,7 +727,7 @@ multiple directories.
 .PD 1
 .TP
 \fBdosed\fR \fI"s:orig:change:g" <filename>\fR
-Performs sed (including cp/mv \fIfilename\fR) on \fIfilename\fR.
+Performs sed in place on \fIfilename\fR inside ${D}.
 .br
 .BR 'dosed\ "s:/usr/local:/usr:g"\ /usr/bin/some\-script'
 runs sed on ${D}/usr/bin/some\-script
index e26629215214eebdf28803dfdcdd31199dd147eb..4e5dbb93efc8811660f33424ed7fb9f4f3c0e7a8 100644 (file)
@@ -241,7 +241,7 @@ shortmapping={
 "p":"--pretend",   "P":"--prune",
 "q":"--quiet",
 "s":"--search",    "S":"--searchdesc",
-'t':"--tree",
+"t":"--tree",
 "u":"--update",
 "v":"--verbose",   "V":"--version"
 }
@@ -2110,6 +2110,34 @@ class depgraph(object):
                                                        return 0, myfavorites
                                                self._missing_args.append((arg, atom))
                                                continue
+                                       if pkg.installed:
+                                               # Warn if all matching ebuilds are masked or
+                                               # the installed package itself is masked. Do
+                                               # not warn if there are simply no matching
+                                               # ebuilds since that would be annoying in some
+                                               # cases:
+                                               #
+                                               #  - binary packages installed from an overlay
+                                               #    that is not listed in PORTDIR_OVERLAY
+                                               #
+                                               #  - multi-slot atoms listed in the world file
+                                               #    to prevent depclean from removing them
+
+                                               installed_masked = not visible(
+                                                       pkgsettings, pkg.cpv, pkg.metadata,
+                                                       built=pkg.built, installed=pkg.installed)
+
+                                               all_ebuilds_masked = bool(
+                                                       portdb.xmatch("match-all", atom) and
+                                                       not portdb.xmatch("bestmatch-visible", atom))
+
+                                               if installed_masked or all_ebuilds_masked:
+                                                       self._missing_args.append((arg, atom))
+
+                                               if "selective" not in self.myparams:
+                                                       self._show_unsatisfied_dep(myroot, atom)
+                                                       return 0, myfavorites
+
                                        self._dep_stack.append(
                                                Dependency(atom=atom, root=myroot, parent=arg))
                                        if not self._create_graph():
@@ -2354,7 +2382,7 @@ class depgraph(object):
                                        metadata = None
                                if metadata and not built:
                                        if "?" in metadata["LICENSE"]:
-                                               pkgsettings.setcpv(p, mydb=portdb)
+                                               pkgsettings.setcpv(cpv, mydb=portdb)
                                                metadata["USE"] = pkgsettings.get("USE", "")
                                        else:
                                                metadata["USE"] = ""
@@ -2391,6 +2419,8 @@ class depgraph(object):
                                                # This will have already been reported
                                                # above via mreasons.
                                                pass
+                               if not mreasons:
+                                       continue
                                masked_packages.append((cpv, mreasons,
                                        comment, filename, missing_licenses))
                if masked_packages:
@@ -5667,6 +5697,7 @@ def action_sync(settings, trees, mtimedb, myopts, myaction):
                                        print ">>> In order to force sync, remove '%s'." % servertimestampfile
                                        print ">>>"
                                        print
+                                       exitcode = 1
                                elif (servertimestamp == 0) or (servertimestamp > mytimestamp):
                                        # actual sync
                                        mycommand = rsynccommand + [dosyncuri+"/", myportdir]
@@ -6363,7 +6394,7 @@ def action_depclean(settings, trees, ldpath_mtimes,
                                except portage.exception.InvalidDependString, e:
                                        file_path = os.path.join(
                                                myroot, portage.VDB_PATH, pkg, "PROVIDE")
-                                       portage.writemsg("\n\nInvalid PROVIDE: %s\n" % str(s),
+                                       portage.writemsg("\n\nInvalid PROVIDE: %s\n" % str(e),
                                                noiselevel=-1)
                                        portage.writemsg("See '%s'\n" % file_path,
                                                noiselevel=-1)
index be28ee53f52baec00f90a8d41be3e95745afcfc3..584ae40ae1ade3293603c71424c7ada770648526 100644 (file)
@@ -891,7 +891,7 @@ class config(object):
                "PORTAGE_IUSE",
                "PORTAGE_LOG_FILE", "PORTAGE_MASTER_PID",
                "PORTAGE_PYM_PATH", "PORTAGE_REPO_NAME", "PORTAGE_RESTRICT",
-               "PORTAGE_TMPDIR", "PORTAGE_WORKDIR_MODE",
+               "PORTAGE_TMPDIR", "PORTAGE_UPDATE_ENV", "PORTAGE_WORKDIR_MODE",
                "PORTDIR", "PORTDIR_OVERLAY", "PREROOTPATH", "PROFILE_PATHS",
                "ROOT", "ROOTPATH", "STARTDIR", "T", "TMP", "TMPDIR",
                "USE_EXPAND", "USE_ORDER", "WORKDIR",
index af726b54e891c40ea84e32df5274b0cc1f16d90d..ae37127ab66f6f939bad3cc62916df7fbc7da001 100644 (file)
@@ -2152,8 +2152,12 @@ class dblink(object):
                self.vartree.dbapi.libmap.update()
 
                #do postinst script
+               self.settings["PORTAGE_UPDATE_ENV"] = \
+                       os.path.join(self.dbpkgdir, "environment.bz2")
+               self.settings.backup_changes("PORTAGE_UPDATE_ENV")
                a = doebuild(myebuild, "postinst", destroot, self.settings, use_cache=0,
                        tree=self.treetype, mydbapi=mydbapi, vartree=self.vartree)
+               self.settings.pop("PORTAGE_UPDATE_ENV", None)
 
                # XXX: Decide how to handle failures here.
                if a != os.EX_OK:
index 462199722db04c43c87f902c167d635b103b544c..ea76f6a019bd6bbeae5c7f46d4c75644abf13779 100644 (file)
@@ -77,7 +77,7 @@ class EbuildQuote(LineCheck):
 
        repoman_check_name = 'ebuild.minorsyn'
        ignore_line = re.compile(r'(^$)|(^\s*#.*)|(^\s*\w+=.*)|(^\s*(local|export)\s+)')
-       var_names = r'(D|S|T|ROOT|FILESDIR|WORKDIR)'
+       var_names = r'(D|DISTDIR|FILESDIR|S|T|ROOT|WORKDIR)'
        var_reference = re.compile(r'\$(\{'+var_names+'\}|' + \
                var_names + '\W)')
        missing_quotes = re.compile(r'(\s|^)[^"\'\s]*\$\{?' + var_names + \