From: Fabian Groffen Date: Fri, 8 Feb 2008 16:00:54 +0000 (-0000) Subject: Merged from trunk 9280:9299 X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=e46f9d097889a250b478ba92e5f684bef337134f;p=portage.git Merged from trunk 9280:9299 | 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 --- diff --git a/bin/ebuild.sh b/bin/ebuild.sh index 1e17a602c..1704103de 100755 --- a/bin/ebuild.sh +++ b/bin/ebuild.sh @@ -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 diff --git a/bin/isolated-functions.sh b/bin/isolated-functions.sh index e0be5d31e..93774dc54 100755 --- a/bin/isolated-functions.sh +++ b/bin/isolated-functions.sh @@ -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 \ diff --git a/man/ebuild.5 b/man/ebuild.5 index 5623d9084..6f6403738 100644 --- a/man/ebuild.5 +++ b/man/ebuild.5 @@ -727,7 +727,7 @@ multiple directories. .PD 1 .TP \fBdosed\fR \fI"s:orig:change:g" \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 diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py index e26629215..4e5dbb93e 100644 --- a/pym/_emerge/__init__.py +++ b/pym/_emerge/__init__.py @@ -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) diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py index be28ee53f..584ae40ae 100644 --- a/pym/portage/__init__.py +++ b/pym/portage/__init__.py @@ -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", diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py index af726b54e..ae37127ab 100644 --- a/pym/portage/dbapi/vartree.py +++ b/pym/portage/dbapi/vartree.py @@ -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: diff --git a/pym/repoman/checks.py b/pym/repoman/checks.py index 462199722..ea76f6a01 100644 --- a/pym/repoman/checks.py +++ b/pym/repoman/checks.py @@ -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 + \