esac
}
+PORTAGE_BASHRCS_SOURCED=0
+
# @FUNCTION: source_all_bashrcs
# @DESCRIPTION:
# Source a relevant bashrc files and perform other miscellaneous
# 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
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
;;
esac
- source_all_bashrcs
fi
if ! hasq "$EBUILD_PHASE" clean cleanrm && \
# 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}
fi
ebuild_main() {
+ source_all_bashrcs
local f x
local export_vars="ASFLAGS CCACHE_DIR CCACHE_SIZE
CFLAGS CXXFLAGS LDFLAGS LIBCFLAGS LIBCXXFLAGS"
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 \
}
if [ -n "${MISC_FUNCTIONS_ARGS}" ]; then
+ source_all_bashrcs
[ "$PORTAGE_DEBUG" == "1" ] && set -x
for x in ${MISC_FUNCTIONS_ARGS}; do
${x}
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
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
mymanifests.add(f)
else:
myupdates.add(f)
+ if vcs == 'git':
+ myupdates.difference_update(myremoved)
myupdates = list(myupdates)
mymanifests = list(mymanifests)
myheaders = []
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[:]
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):
mylist = mydepgraph.altlist()
mydepgraph.break_refs(mylist)
+ mydepgraph.break_refs(dropped_tasks)
self._mergelist = mylist
self._set_digraph(mydepgraph.schedulerGraph())
# 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