Merged from trunk -r12133:12146
authorFabian Groffen <grobian@gentoo.org>
Fri, 5 Dec 2008 21:22:55 +0000 (21:22 -0000)
committerFabian Groffen <grobian@gentoo.org>
Fri, 5 Dec 2008 21:22:55 +0000 (21:22 -0000)
   | 12134   | Source bashrc files as late as possible, giving them the     |
   | zmedico | opportunity to override as much as possible. Thanks to Ned   |
   |         | Ludd <solar@g.o> 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 <jkt@g.o> 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
bin/isolated-functions.sh
bin/misc-functions.sh
bin/repoman
pym/_emerge/__init__.py

index c6e3cc365def1decb6e1c50b7c546585447f8f93..8971c78d36171676a548d49301c8d379b49ddce7 100755 (executable)
@@ -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"
index 1e3079cb287a92a9e66868ecdffde4c23014fa0b..b1a673aabe3b801047c6a97563c68ed98b822d62 100755 (executable)
@@ -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 \
index 7753c65fadc5b35837d56c4aeefcd81d9613e6f3..7bc529d6686b7d48dcd1dc4c25817bc9afe45322 100644 (file)
@@ -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}
index 4f2af408784ebb008509411c70a8e318468f7dcd..3fc8e1757e9af6ab2ed9d843ec42d6166c66e2ff 100755 (executable)
@@ -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[:]
index 75979b3399986fe974c5e55199c0b6ba030a9853..a09262eb12f4e6590d47302df3001a2b2207b4cb 100644 (file)
@@ -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