From ea06d0db0ce3cf51e1a4b0b4a517aa2e64a20ccd Mon Sep 17 00:00:00 2001 From: Fabian Groffen Date: Fri, 5 Dec 2008 21:22:55 +0000 Subject: [PATCH] Merged from trunk -r12133:12146 MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit | 12134 | Source bashrc files as late as possible, giving them the | | zmedico | opportunity to override as much as possible. Thanks to Ned | | | Ludd for the suggestion. | | 12136 | Skip sourcinf of profile.bashrc during the depend phase. | | zmedico | | | 12138 | Fix depgraph._dep_check_composite_db._visible() to reject | | zmedico | installed packages that are masked. This is necessary for | | | correct choices in || deps when we want to ensure that | | | installed masked packages are not preferred over other | | | available choices that are not masked. Thanks to Jan | | | Kundrát for reporting this issue and testing the | | | patch. | | 12140 | When calling `git ls-files -m` to list modified files, use | | zmedico | --with-tree=HEAD so that differences from the most recent | | | commit are given instead of differences from the index which | | | is used for commit staging purposes. This is required since | | | otherwise files that have been added via `git add` (such as | | | echangelog does with the ChangeLog) won't show up in the | | | list of modified files due to being unmodified relative to | | | the index. Thanks to Christian Ruppert (idl0r) for | | | reporting. | | 12142 | It's not safe to use the git commit -a option since there | | zmedico | might be some modified files elsewhere in the working tree | | | that the user doesn't want to commit. Therefore, call git | | | update-index in order to ensure that the index is updated | | | with the latest versions of all new and modified files in | | | the relevant portion of the working tree. | | 12144 | When --keep-going drops packages due to unsatisfied | | zmedico | dependencies, include them in the list of packgaes that | | | "failed to build or install" that's displayed at the end. | | 12146 | Break references between the depgraph and the dropped tasks | | zmedico | inside Scheduler._calc_resume_list(), since the tasks are | | | now saved for display at the end. | svn path=/main/branches/prefix/; revision=12163 --- bin/ebuild.sh | 28 ++++++++++++++++------------ bin/isolated-functions.sh | 3 ++- bin/misc-functions.sh | 1 + bin/repoman | 27 +++++++++++++++++++++++++-- pym/_emerge/__init__.py | 16 +++++++++------- 5 files changed, 53 insertions(+), 22 deletions(-) diff --git a/bin/ebuild.sh b/bin/ebuild.sh index c6e3cc365..8971c78d3 100755 --- a/bin/ebuild.sh +++ b/bin/ebuild.sh @@ -1502,6 +1502,8 @@ _ebuild_phase_funcs() { esac } +PORTAGE_BASHRCS_SOURCED=0 + # @FUNCTION: source_all_bashrcs # @DESCRIPTION: # Source a relevant bashrc files and perform other miscellaneous @@ -1514,6 +1516,8 @@ _ebuild_phase_funcs() { # function for the current phase. # source_all_bashrcs() { + [[ $PORTAGE_BASHRCS_SOURCED = 1 ]] && return 0 + PORTAGE_BASHRCS_SOURCED=1 local x if [[ -n $EBUILD_PHASE && -n ${EAPI/prefix/} ]] ; then @@ -1525,14 +1529,17 @@ source_all_bashrcs() { fi local OCC="${CC}" OCXX="${CXX}" - # source the existing profile.bashrc's. - save_IFS - IFS=$'\n' - local path_array=($PROFILE_PATHS) - restore_IFS - for x in "${path_array[@]}" ; do - [ -f "${x}/profile.bashrc" ] && qa_source "${x}/profile.bashrc" - done + + if [[ $EBUILD_PHASE != depend ]] ; then + # source the existing profile.bashrcs. + save_IFS + IFS=$'\n' + local path_array=($PROFILE_PATHS) + restore_IFS + for x in "${path_array[@]}" ; do + [ -f "$x/profile.bashrc" ] && qa_source "$x/profile.bashrc" + done + fi # We assume if people are changing shopts in their bashrc they do so at their # own peril. This is the ONLY non-portage bit of code that can change shopts @@ -1853,7 +1860,6 @@ if ! hasq "$EBUILD_PHASE" clean cleanrm depend && \ ;; esac - source_all_bashrcs fi if ! hasq "$EBUILD_PHASE" clean cleanrm && \ @@ -1902,9 +1908,6 @@ fi # PREFIX HACK: ignore prefix, and then respect it again [[ -n ${EAPI/prefix/} ]] || EAPI="${EAPI}${EAPI:+ }0" -# enable bashrc support for the clean phase -hasq "$EBUILD_PHASE" clean cleanrm && source_all_bashrcs - # unset USE_EXPAND variables that contain only the special "*" token for x in ${USE_EXPAND} ; do [ "${!x}" == "*" ] && unset ${x} @@ -1932,6 +1935,7 @@ if [ "${EBUILD_PHASE}" != "depend" ] ; then fi ebuild_main() { + source_all_bashrcs local f x local export_vars="ASFLAGS CCACHE_DIR CCACHE_SIZE CFLAGS CXXFLAGS LDFLAGS LIBCFLAGS LIBCXXFLAGS" diff --git a/bin/isolated-functions.sh b/bin/isolated-functions.sh index 1e3079cb2..b1a673aab 100755 --- a/bin/isolated-functions.sh +++ b/bin/isolated-functions.sh @@ -516,7 +516,8 @@ save_ebuild_env() { GOOD HILITE HOME IMAGE \ LAST_E_CMD LAST_E_LEN LD_PRELOAD MISC_FUNCTIONS_ARGS MOPREFIX \ NORMAL PKGDIR PKGUSE PKG_LOGDIR PKG_TMPDIR \ - PORTAGE_ACTUAL_DISTDIR PORTAGE_ARCHLIST PORTAGE_BASHRC \ + PORTAGE_ACTUAL_DISTDIR PORTAGE_ARCHLIST \ + PORTAGE_BASHRC PORTAGE_BASHRCS_SOURCED \ PORTAGE_BINPKG_TAR_OPTS PORTAGE_BINPKG_TMPFILE PORTAGE_BUILDDIR \ PORTAGE_COLORMAP PORTAGE_CONFIGROOT PORTAGE_DEBUG \ PORTAGE_DEPCACHEDIR PORTAGE_GID PORTAGE_INST_GID \ diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh index 7753c65fa..7bc529d66 100644 --- a/bin/misc-functions.sh +++ b/bin/misc-functions.sh @@ -820,6 +820,7 @@ dyn_rpm() { } if [ -n "${MISC_FUNCTIONS_ARGS}" ]; then + source_all_bashrcs [ "$PORTAGE_DEBUG" == "1" ] && set -x for x in ${MISC_FUNCTIONS_ARGS}; do ${x} diff --git a/bin/repoman b/bin/repoman index 4f2af4087..3fc8e1757 100755 --- a/bin/repoman +++ b/bin/repoman @@ -737,7 +737,7 @@ 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").readlines() + 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 @@ -1733,7 +1733,7 @@ else: for prop in props if " - " in prop) elif vcs == "git": - mychanged = os.popen("git ls-files -m").readlines() + 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 @@ -1764,6 +1764,8 @@ else: mymanifests.add(f) else: myupdates.add(f) + if vcs == 'git': + myupdates.difference_update(myremoved) myupdates = list(myupdates) mymanifests = list(mymanifests) myheaders = [] @@ -2058,6 +2060,27 @@ else: portage.writemsg("!!! Disabled FEATURES='sign'\n") signed = False + if vcs == 'git': + # It's not safe to use the git commit -a option since there might + # be some modified files elsewhere in the working tree that the + # user doesn't want to commit. Therefore, call git update-index + # in order to ensure that the index is updated with the latest + # versions of all new and modified files in the relevant portion + # of the working tree. + myfiles = mymanifests + myupdates + myfiles.sort() + update_index_cmd = ["git", "update-index"] + update_index_cmd.extend(f.lstrip("./") for f in myfiles) + if options.pretend: + print "(%s)" % (" ".join(update_index_cmd),) + else: + retval = spawn(update_index_cmd, env=os.environ) + if retval != os.EX_OK: + writemsg_level(("!!! Exiting on %s (shell) " + \ + "error code: %s\n") % (vcs, retval), + level=logging.ERROR, noiselevel=-1) + sys.exit(retval) + if vcs == 'git' or manifest_commit_required or signed: myfiles = mymanifests[:] diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py index 75979b339..a09262eb1 100644 --- a/pym/_emerge/__init__.py +++ b/pym/_emerge/__init__.py @@ -8253,13 +8253,13 @@ class depgraph(object): arg = None if arg: return False - if pkg.installed: - try: - if not visible( - self._depgraph.pkgsettings[pkg.root], pkg): - return False - except portage.exception.InvalidDependString: - pass + if pkg.installed: + try: + if not visible( + self._depgraph.pkgsettings[pkg.root], pkg): + return False + except portage.exception.InvalidDependString: + pass return True def _dep_expand(self, atom): @@ -10488,6 +10488,7 @@ class Scheduler(PollScheduler): mylist = mydepgraph.altlist() mydepgraph.break_refs(mylist) + mydepgraph.break_refs(dropped_tasks) self._mergelist = mylist self._set_digraph(mydepgraph.schedulerGraph()) @@ -10509,6 +10510,7 @@ class Scheduler(PollScheduler): # not valid here. settings.pop("T", None) portage.elog.elog_process(pkg.cpv, settings) + self._failed_pkgs_all.append(self._failed_pkg(pkg=pkg)) return True -- 2.26.2