tmpsettings.backup_changes("EBUILD_SKIP_MANIFEST")
portage._doebuild_manifest_exempt_depend += 1
-build_dir_phases = set(["setup", "unpack", "compile",
+build_dir_phases = set(["setup", "unpack", "configure", "compile",
"test", "install", "package", "rpm"])
def stale_env_warning():
fi
}
-pkg_nofetch() {
+_default_pkg_nofetch() {
[ -z "${SRC_URI}" ] && return
echo "!!! The following are listed in SRC_URI for ${PN}:"
done
}
-src_unpack() {
+_default_src_unpack() {
[[ -n ${A} ]] && unpack ${A}
}
-src_compile() {
+_default_src_configure() {
if [ "${EAPI:-0}" == 0 ] ; then
[ -x ./configure ] && econf
elif [ -x "${ECONF_SOURCE:-.}/configure" ] ; then
econf
fi
+}
+
+_default_src_compile() {
if [ -f Makefile ] || [ -f GNUmakefile ] || [ -f makefile ]; then
emake || die "emake failed"
fi
}
-src_test() {
+_default_src_test() {
if emake -j1 check -n &> /dev/null; then
vecho ">>> Test phase [check]: ${CATEGORY}/${PF}"
if ! emake -j1 check; then
fi
}
+pkg_nofetch() {
+ _default_pkg_nofetch
+}
+
+src_unpack() {
+ _default_src_unpack
+}
+
+src_compile() {
+ hasq "$EAPI" 0 1 2_pre1 && \
+ _default_src_configure
+
+ _default_src_compile
+}
+
src_install() {
- # this avoids misc errors in prefix because it doesn't exist
- # by default
- mkdir -p "${ED}"
- return
+ if hasq "$EAPI" prefix; then
+ # this avoids misc errors in prefix because it doesn't exist
+ # by default
+ mkdir -p "${ED}"
+ return
+ fi
+}
+
+src_test() {
+ _default_src_test
}
ebuild_phase() {
trap SIGINT SIGQUIT
}
+abort_configure() {
+ abort_handler src_configure $1
+ rm -f "$PORTAGE_BUILDDIR/.configured"
+ exit 1
+}
+
abort_compile() {
abort_handler "src_compile" $1
rm -f "${PORTAGE_BUILDDIR}/.compiled"
exit 1
}
-dyn_compile() {
- trap "abort_compile" SIGINT SIGQUIT
-
- [ "$(type -t pre_src_compile)" == "function" ] && qa_call pre_src_compile
+dyn_configure() {
+ hasq "$EAPI" 0 1 2_pre1 && return 0
- [ "${CFLAGS-unset}" != "unset" ] && export CFLAGS
- [ "${CXXFLAGS-unset}" != "unset" ] && export CXXFLAGS
- [ "${LIBCFLAGS-unset}" != "unset" ] && export LIBCFLAGS
- [ "${LIBCXXFLAGS-unset}" != "unset" ] && export LIBCXXFLAGS
- [ "${LDFLAGS-unset}" != "unset" ] && export LDFLAGS
- [ "${ASFLAGS-unset}" != "unset" ] && export ASFLAGS
+ if [[ $PORTAGE_BUILDDIR/.configured -nt $WORKDIR ]] ; then
+ vecho ">>> It appears that '$PF' is already configured; skipping."
+ vecho ">>> Remove '$PORTAGE_BUILDDIR/.configured' to force configuration."
+ return 0
+ fi
- [ "${CCACHE_DIR-unset}" != "unset" ] && export CCACHE_DIR
- [ "${CCACHE_SIZE-unset}" != "unset" ] && export CCACHE_SIZE
+ trap abort_configure SIGINT SIGQUIT
- [ "${DISTCC_DIR-unset}" == "unset" ] && export DISTCC_DIR="${PORTAGE_TMPDIR}/.distcc"
- [ ! -z "${DISTCC_DIR}" ] && addwrite "${DISTCC_DIR}"
+ [[ $(type -t pre_src_configure) = function ]] && \
+ qa_call pre_src_configure
- LIBDIR_VAR="LIBDIR_${ABI}"
- if [ -z "${PKG_CONFIG_PATH}" -a -n "${ABI}" -a -n "${!LIBDIR_VAR}" ]; then
- export PKG_CONFIG_PATH="${EPREFIX}/usr/${!LIBDIR_VAR}/pkgconfig"
- fi
- unset LIBDIR_VAR
+ vecho ">>> Configuring source in $srcdir ..."
+ ebuild_phase src_configure
+ vecho ">>> Source configured."
+ #|| abort_configure "fail"
+ cd "$PORTAGE_BUILDDIR"
+ touch .configured
+ [[ $(type -t post_src_configure) = function ]] && \
+ qa_call post_src_configure
- if hasq noauto $FEATURES && [ ! -f ${PORTAGE_BUILDDIR}/.unpacked ]; then
- echo
- echo "!!! We apparently haven't unpacked... This is probably not what you"
- echo "!!! want to be doing... You are using FEATURES=noauto so I'll assume"
- echo "!!! that you know what you are doing... You have 5 seconds to abort..."
- echo
+ trap SIGINT SIGQUIT
+}
- local x
- for x in 1 2 3 4 5 6 7 8; do
- echo -ne "\a"
- LC_ALL=C sleep 0.25
- done
+dyn_compile() {
- sleep 3
+ if [[ $PORTAGE_BUILDDIR/.compiled -nt $WORKDIR ]] ; then
+ vecho ">>> It appears that '${PF}' is already compiled; skipping."
+ vecho ">>> Remove '$PORTAGE_BUILDDIR/.compiled' to force compilation."
+ return 0
fi
- local srcdir=${PORTAGE_BUILDDIR}
- cd "${PORTAGE_BUILDDIR}"
- if [ ! -e "build-info" ]; then
- mkdir build-info
- fi
- cp "${EBUILD}" "build-info/${PF}.ebuild"
+ trap abort_compile SIGINT SIGQUIT
+
+ [[ $(type -t pre_src_compile) = function ]] && \
+ qa_call pre_src_compile
- if [[ ${PORTAGE_BUILDDIR}/.compiled -nt ${WORKDIR} ]] ; then
- vecho ">>> It appears that '${PF}' is already compiled; skipping."
- vecho ">>> Remove '${PORTAGE_BUILDDIR}/.compiled' to force compilation."
- trap SIGINT SIGQUIT
- [ "$(type -t post_src_compile)" == "function" ] && qa_call post_src_compile
- return
- fi
- if [ -d "${S}" ]; then
- srcdir=${S}
- else
- srcdir=${WORKDIR}
- fi
- cd "${srcdir}"
- #our custom version of libtool uses $S and $ED to fix
- #invalid paths in .la files
- export S ED
- #some packages use an alternative to $S to build in, cause
- #our libtool to create problematic .la files
- export PWORKDIR="$WORKDIR"
vecho ">>> Compiling source in ${srcdir} ..."
ebuild_phase src_compile
vecho ">>> Source compiled."
echo " digest : create a manifest file for the package"
echo " manifest : create a manifest file for the package"
echo " unpack : unpack/patch sources (auto-fetch if needed)"
- echo " compile : compile sources (auto-fetch/unpack if needed)"
- echo " test : test package (auto-fetch/unpack/compile if needed)"
+ echo " configure : configure sources (auto-fetch/unpack if needed)"
+ echo " compile : compile sources (auto-fetch/unpack/configure if needed)"
+ echo " test : test package (auto-fetch/unpack/configure/compile if needed)"
echo " preinst : execute pre-install instructions"
echo " postinst : execute post-install instructions"
echo " install : install the package to the temporary install directory"
PATH="${stripped_path}"
}
+# @FUNCTION: source_all_bashrcs
+# @DESCRIPTION:
+# Source a relevant bashrc files and perform other miscellaneous
+# environment initialization when appropriate:
+#
+# * If EAPI is set, define default_* functions provided by the current EAPI.
+#
source_all_bashrcs() {
[ -n "$EBUILD_PHASE" ] || return
+ local x
+ local default_phases="pkg_nofetch src_unpack src_configure
+ src_compile src_test"
+
+ if [[ -n $EAPI ]] && ! hasq "$EAPI" 0 1 2_pre1 ; then
+ for x in $default_phases ; do
+ eval "default_$x() { _default_$x \"\$@\" ; }"
+ done
+
+ [[ $(type -t src_configure) = function ]] || \
+ src_configure() { _default_src_configure "$@" ; }
+
+ else
+ for x in $default_phases ; do
+ eval "default_$x() {
+ die \"default_$x() is not supported with EAPI='$EAPI'\"
+ }"
+ done
+ fi
+
local OCC="${CC}" OCXX="${CXX}"
# source the existing profile.bashrc's.
save_IFS
IFS=$'\n'
- local x
for x in ${PROFILE_PATHS}; do
# Must unset it so that it doesn't mess up assumptions in the RCs.
unset IFS
debug-print "RDEPEND: not set... Setting to: ${DEPEND}"
fi
+ # Set default EAPI if necessary, so that most
+ # code can simply assume that it's defined.
+ [[ -n $EAPI ]] || EAPI=0
+
# add in dependency info from eclasses
IUSE="${IUSE} ${E_IUSE}"
DEPEND="${DEPEND} ${E_DEPEND}"
declare -r ${READONLY_EBUILD_METADATA} ${READONLY_PORTAGE_VARS}
fi
-if [ -n "${EBUILD_SH_ARGS}" ] ; then
+ebuild_main() {
+ local f x
+ local export_vars="ASFLAGS CCACHE_DIR CCACHE_SIZE
+ CFLAGS CXXFLAGS LDFLAGS LIBCFLAGS LIBCXXFLAGS"
+
case ${EBUILD_SH_ARGS} in
nofetch)
ebuild_phase_with_hooks pkg_nofetch
)
fi
;;
- unpack|compile|test|clean|install)
- if [ "${SANDBOX_DISABLED="0"}" == "0" ]; then
+ unpack|configure|compile|test|clean|install)
+ if [[ ${SANDBOX_DISABLED:-0} = 0 ]] ; then
export SANDBOX_ON="1"
else
export SANDBOX_ON="0"
fi
+
+ case "$EBUILD_SH_ARGS" in
+ configure|compile)
+
+ for x in $export_vars ; do
+ [[ ${!x-unset} != unset ]] && export $x
+ done
+
+ hasq distcc $FEATURES && [[ -n $DISTCC_DIR ]] && \
+ [[ ${SANDBOX_WRITE/$DISTCC_DIR} = $SANDBOX_WRITE ]] && \
+ addwrite "$DISTCC_DIR"
+
+ x=LIBDIR_$ABI
+ [ -z "$PKG_CONFIG_PATH" -a -n "$ABI" -a -n "${!x}" ] && \
+ export PKG_CONFIG_PATH=/usr/${!x}/pkgconfig
+
+ if hasq noauto $FEATURES && \
+ [[ ! -f $PORTAGE_BUILDDIR/.unpacked ]] ; then
+ echo
+ echo "!!! We apparently haven't unpacked..." \
+ "This is probably not what you"
+ echo "!!! want to be doing... You are using" \
+ "FEATURES=noauto so I'll assume"
+ echo "!!! that you know what you are doing..." \
+ "You have 5 seconds to abort..."
+ echo
+
+ local x
+ for x in 1 2 3 4 5 6 7 8; do
+ echo -ne "\a"
+ LC_ALL=C sleep 0.25
+ done
+
+ sleep 3
+ fi
+
+ cd "$PORTAGE_BUILDDIR"
+ if [ ! -d build-info ] ; then
+ mkdir build-info
+ cp "$EBUILD" "build-info/$PF.ebuild"
+ fi
+
+ local srcdir
+ if [[ -d $S ]] ; then
+ srcdir=$S
+ else
+ srcdir=$WORKDIR
+ fi
+ cd "$srcdir"
+ #our custom version of libtool uses $S and $D to fix
+ #invalid paths in .la files
+ export S D
+ #some packages use an alternative to $S to build in, cause
+ #our libtool to create problematic .la files
+ export PWORKDIR=$WORKDIR
+
+ ;;
+ esac
+
if [ "${PORTAGE_DEBUG}" != "1" ] || [ "${-/x/}" != "$-" ]; then
dyn_${EBUILD_SH_ARGS}
else
esac
[ -n "${EBUILD_EXIT_STATUS_FILE}" ] && \
touch "${EBUILD_EXIT_STATUS_FILE}" &>/dev/null
-fi
+}
+
+[[ -n $EBUILD_SH_ARGS ]] && ebuild_main
# Save the env only for relevant phases.
if [ -n "${EBUILD_SH_ARGS}" ] && \
best_version use_with use_enable register_die_hook check_KV \
keepdir unpack strip_duplicate_slashes econf einstall \
dyn_setup dyn_unpack dyn_clean into insinto exeinto docinto \
- insopts diropts exeopts libopts abort_handler abort_compile \
- abort_test abort_install dyn_compile dyn_test dyn_install \
+ insopts diropts exeopts libopts \
+ abort_handler abort_configure abort_compile \
+ abort_test abort_install dyn_configure \
+ dyn_compile dyn_test dyn_install \
dyn_preinst dyn_help debug-print debug-print-function \
debug-print-section inherit EXPORT_FUNCTIONS newdepend newrdepend \
newpdepend do_newdepend remove_path_entry \
save_ebuild_env filter_readonly_variables preprocess_ebuild_env \
- source_all_bashrcs ebuild_phase ebuild_phase_with_hooks \
+ source_all_bashrcs ebuild_main \
+ ebuild_phase ebuild_phase_with_hooks \
${QA_INTERCEPTORS}
# portage config variables and variables set directly by portage
def caterror(mycat):
err(mycat+" is not an official category. Skipping QA checks in this directory.\nPlease ensure that you add "+catdir+" to "+repodir+"/profiles/categories\nif it is a new category.")
-# retreive local USE list
-luselist={}
-try:
- f = open(os.path.join(portdir, "profiles", "use.local.desc"))
- utilities.parse_use_local_desc(f, luselist)
- f.close()
-except (IOError, OSError, ParseError), e:
- logging.exception("Couldn't read from use.local.desc")
- sys.exit(1)
-
-if portdir_overlay != portdir:
- filename = os.path.join(portdir_overlay, "profiles", "use.local.desc")
- if os.path.exists(filename):
- try:
- f = open(filename)
- utilities.parse_use_local_desc(f, luselist)
- f.close()
- except (IOError, OSError, ParseError), e:
- logging.exception("Couldn't read from '%s'" % (filename,))
- sys.exit(1)
- del filename
-
# setup a uselist from portage
uselist=[]
try:
if myuse[mypos] and (myuse[mypos] in muselist):
del myuse[mypos]
- # uselist checks - local
- mykey = portage.dep_getkey(catpkg)
- if mykey in luselist:
- for mypos in range(len(myuse)-1,-1,-1):
- if myuse[mypos] and (myuse[mypos] in luselist[mykey]):
- del myuse[mypos]
-
if default_use and eapi == "0":
for myflag in default_use:
stats['EAPI.incompatible'] += 1
portage.dep.paren_reduce(myaux["RESTRICT"]), matchall=1)
except portage.exception.InvalidDependString, e:
stats["RESTRICT.syntax"] = stats["RESTRICT.syntax"] + 1
- fails["RESTRICT.syntax"].append(mykey+".ebuild RESTRICT: "+str(e))
+ fails["RESTRICT.syntax"].append(
+ "%s: RESTRICT: %s" % (relative_path, e))
del e
if myrestrict:
myrestrict = set(portage.flatten(myrestrict))
-<sect1 id='package-ebuild-eapi-2'>
+<sect1 id='package-ebuild-eapi-2_pre1'>
<title>EAPI 2_pre1</title>
<sect2 id='package-ebuild-eapi-2-helpers'>
<title>Helpers</title>
</sect3>
</sect2>
</sect1>
+<sect1 id='package-ebuild-eapi-2_pre2'>
+ <title>EAPI 2_pre2</title>
+ <sect2 id='package-ebuild-eapi-2-phases'>
+ <title>Phases</title>
+ <sect3 id='package-ebuild-eapi-2-phases-src-configure'>
+ <title>New src_configure Phase Function</title>
+ <para>
+ The configure portion of the src_compile function has been
+ split into a separate function which is named src_configure. The
+ src_configure function is called in between the src_unpack and
+ src_compile functions.
+ </para>
+ <table><title>Execution Order of Phase Functions</title>
+ <tgroup cols='1' align='left' >
+ <colspec colname='name'/>
+ <thead>
+ <row>
+ <entry>Phase Function Name</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>pkg_setup</entry>
+ </row>
+ <row>
+ <entry>src_unpack</entry>
+ </row>
+ <row>
+ <entry>src_configure</entry>
+ </row>
+ <row>
+ <entry>src_compile</entry>
+ </row>
+ <row>
+ <entry>src_test</entry>
+ </row>
+ <row>
+ <entry>src_install</entry>
+ </row>
+ <row>
+ <entry>pkg_preinst</entry>
+ </row>
+ <row>
+ <entry>pkg_postinst</entry>
+ </row>
+ <row>
+ <entry>pkg_prerm</entry>
+ </row>
+ <row>
+ <entry>pkg_postrm</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ </sect3>
+ <sect3 id='package-ebuild-eapi-2-phases-default-functions'>
+ <title>Default Phase Functions</title>
+ <para>
+ Each of the default src_* phase functions is now accessible
+ via a function having a name that begins with default_ and
+ ends with the respective phase function name. For example,
+ a call to a function with the name default_src_compile is
+ equivalent to a call to the default src_compile
+ implementation.
+ </para>
+ </sect3>
+ </sect2>
+</sect1>
__slots__ = ("pkg", "scheduler", "settings") + ("_tree",)
- _phases = ("compile", "test", "install")
+ _phases = ("configure", "compile", "test", "install")
_live_eclasses = frozenset([
"cvs",
world_atom = self.world_atom
ldpath_mtimes = mtimedb["ldpath"]
- action_desc = "Building"
+ action_desc = "Emerging"
preposition = "for"
if pkg.type_name == "binary":
- action_desc = "Extracting"
+ action_desc += " binary"
if build_opts.fetchonly:
action_desc = "Fetching"
pkgsettings = self.pkgsettings[myroot]
final_db = self.mydbapi[myroot]
- graph_complete_for_root = "complete" in self.myparams or \
- (myroot == self.target_root and \
- ("deep" in self.myparams or "empty" in self.myparams) and \
- not self._required_set_names.difference(self._sets))
-
blocker_cache = BlockerCache(myroot, vardb)
stale_cache = set(blocker_cache)
for pkg in vardb:
#
# * KEYWORDS is not empty (not installed by old portage).
#
- # * The graph is complete and the package has not been
- # pulled into the dependency graph. It's eligible for
- # depclean, but depclean may fail to recognize it as
- # such due to differences in visibility filtering which
- # can lead to differences in || dep evaluation.
- # TODO: Share visibility code to fix this inconsistency.
if pkg in final_db:
if pkg_in_graph and not visible(pkgsettings, pkg):
self._masked_installed.add(pkg)
- elif graph_complete_for_root and \
- pkgsettings._getMissingKeywords(
+ elif pkgsettings._getMissingKeywords(
pkg.cpv, pkg.metadata) and \
pkg.metadata["KEYWORDS"].split() and \
not pkg_in_graph:
emergelog(self.xterm_titles, *pargs, **kwargs)
class _failed_pkg(SlotObject):
- __slots__ = ("log_path", "pkg", "returncode")
+ __slots__ = ("build_dir", "build_log",
+ "fetch_log", "pkg", "returncode")
def __init__(self, settings, trees, mtimedb, myopts,
spinner, mergelist, favorites, digraph):
# If only one package failed then just show it's
# whole log for easy viewing.
failed_pkg = self._failed_pkgs_all[-1]
- log_path = failed_pkg.log_path
- if log_path is not None:
+ build_dir = failed_pkg.build_dir
+ log_file = None
+
+ log_paths = [failed_pkg.build_log]
+
+ if not (build_dir and os.path.isdir(build_dir)):
+ log_paths.append(failed_pkg.fetch_log)
+
+ for log_path in log_paths:
+ if not log_path:
+ continue
+
+ try:
+ log_size = os.stat(log_path).st_size
+ except OSError:
+ continue
+
+ if log_size == 0:
+ continue
+
try:
log_file = open(log_path, 'rb')
except IOError:
- pass
- else:
- try:
- for line in log_file:
- writemsg_level(line, noiselevel=-1)
- finally:
- log_file.close()
- failure_log_shown = True
+ continue
+
+ break
+
+ if log_file is not None:
+ try:
+ for line in log_file:
+ writemsg_level(line, noiselevel=-1)
+ finally:
+ log_file.close()
+ failure_log_shown = True
if background and not failure_log_shown and \
self._failed_pkgs_all and \
def _do_merge_exit(self, merge):
pkg = merge.merge.pkg
if merge.returncode != os.EX_OK:
- log_path = merge.merge.settings.get("PORTAGE_LOG_FILE")
+ settings = merge.merge.settings
+ build_dir = settings.get("PORTAGE_BUILDDIR")
+ build_log = settings.get("PORTAGE_LOG_FILE")
+ fetch_log = self._fetch_Log
+
self._failed_pkgs.append(self._failed_pkg(
- log_path=log_path, pkg=pkg, returncode=merge.returncode))
+ build_dir=build_dir, build_log=build_log,
+ fetch_log=fetch_log, pkg=pkg,
+ returncode=merge.returncode))
+
self._status_display.failed = len(self._failed_pkgs)
return
self._task_queues.merge.add(merge)
self._status_display.merges = len(self._task_queues.merge)
else:
- log_path = build.settings.get("PORTAGE_LOG_FILE")
+ settings = build.settings
+ build_dir = settings.get("PORTAGE_BUILDDIR")
+ fetch_log = self._fetch_log
+ build_log = settings.get("PORTAGE_LOG_FILE")
+
self._failed_pkgs.append(self._failed_pkg(
- log_path=log_path, pkg=build.pkg, returncode=build.returncode))
+ build_dir=build_dir, build_log=build_log,
+ fetch_log=fetch_log, pkg=build.pkg,
+ returncode=build.returncode))
+
self._status_display.failed = len(self._failed_pkgs)
self._deallocate_config(build.settings)
self._jobs -= 1
@type msg: str
@param msg: a brief status message (no newlines allowed)
"""
-
+ if not self._background:
+ writemsg_level("\n")
self._status_display.displayMessage(msg)
def _save_resume_list(self):
eapi.remove(prop)
# now check if what's left is supported (can)
- properties = [ "2_pre1" ] # another clumpsy solution
+ properties = [ "2_pre2", "2_pre1" ] # another clumpsy solution
for i in range(portage.const.EAPI + 1):
properties.append(str(i))
os.unlink(exit_status_file)
_doebuild_manifest_exempt_depend = 0
-_doebuild_manifest_checked = None
+_doebuild_manifest_cache = None
+_doebuild_broken_ebuilds = set()
_doebuild_broken_manifests = set()
def doebuild(myebuild, mydo, myroot, mysettings, debug=0, listonly=0,
actionmap_deps={
"setup": [],
"unpack": ["setup"],
- "compile":["unpack"],
+ "configure": ["unpack"],
+ "compile":["configure"],
"test": ["compile"],
"install":["test"],
"rpm": ["install"],
validcommands = ["help","clean","prerm","postrm","cleanrm","preinst","postinst",
"config", "info", "setup", "depend",
"fetch", "fetchall", "digest",
- "unpack","compile","test","install","rpm","qmerge","merge",
+ "unpack", "configure", "compile", "test",
+ "install", "rpm", "qmerge", "merge",
"package","unmerge", "manifest"]
if mydo not in validcommands:
mydo not in ("digest", "manifest", "help") and \
not _doebuild_manifest_exempt_depend:
# Always verify the ebuild checksums before executing it.
+ global _doebuild_manifest_cache, _doebuild_broken_ebuilds, \
+ _doebuild_broken_ebuilds
+
+ if myebuild in _doebuild_broken_ebuilds:
+ return 1
+
pkgdir = os.path.dirname(myebuild)
manifest_path = os.path.join(pkgdir, "Manifest")
- global _doebuild_manifest_checked, _doebuild_broken_manifests
- if manifest_path in _doebuild_broken_manifests:
- return 1
+
# Avoid checking the same Manifest several times in a row during a
# regen with an empty cache.
- if _doebuild_manifest_checked != manifest_path:
+ if _doebuild_manifest_cache is None or \
+ _doebuild_manifest_cache.getFullname() != manifest_path:
+ _doebuild_manifest_cache = None
if not os.path.exists(manifest_path):
- writemsg("!!! Manifest file not found: '%s'\n" % manifest_path,
- noiselevel=-1)
- _doebuild_broken_manifests.add(manifest_path)
+ out = portage.output.EOutput()
+ out.eerror("Manifest not found for '%s'" % (myebuild,))
+ _doebuild_broken_ebuilds.add(myebuild)
return 1
mf = Manifest(pkgdir, mysettings["DISTDIR"])
- try:
- mf.checkTypeHashes("EBUILD")
- except portage.exception.FileNotFound, e:
- writemsg("!!! A file listed in the Manifest " + \
- "could not be found: %s\n" % str(e), noiselevel=-1)
- _doebuild_broken_manifests.add(manifest_path)
- return 1
- except portage.exception.DigestException, e:
- writemsg("!!! Digest verification failed:\n", noiselevel=-1)
- writemsg("!!! %s\n" % e.value[0], noiselevel=-1)
- writemsg("!!! Reason: %s\n" % e.value[1], noiselevel=-1)
- writemsg("!!! Got: %s\n" % e.value[2], noiselevel=-1)
- writemsg("!!! Expected: %s\n" % e.value[3], noiselevel=-1)
- _doebuild_broken_manifests.add(manifest_path)
- return 1
- # Make sure that all of the ebuilds are actually listed in the
- # Manifest.
+
+ else:
+ mf = _doebuild_manifest_cache
+
+ try:
+ mf.checkFileHashes("EBUILD", os.path.basename(myebuild))
+ except KeyError:
+ out = portage.output.EOutput()
+ out.eerror("Missing digest for '%s'" % (myebuild,))
+ _doebuild_broken_ebuilds.add(myebuild)
+ return 1
+ except portage.exception.FileNotFound:
+ out = portage.output.EOutput()
+ out.eerror("A file listed in the Manifest " + \
+ "could not be found: '%s'" % (myebuild,))
+ _doebuild_broken_ebuilds.add(myebuild)
+ return 1
+ except portage.exception.DigestException, e:
+ out = portage.output.EOutput()
+ out.eerror("Digest verification failed:")
+ out.eerror("%s" % e.value[0])
+ out.eerror("Reason: %s" % e.value[1])
+ out.eerror("Got: %s" % e.value[2])
+ out.eerror("Expected: %s" % e.value[3])
+ _doebuild_broken_ebuilds.add(myebuild)
+ return 1
+
+ if mf.getFullname() in _doebuild_broken_manifests:
+ return 1
+
+ if mf is not _doebuild_manifest_cache:
+
+ # Make sure that all of the ebuilds are
+ # actually listed in the Manifest.
for f in os.listdir(pkgdir):
if f.endswith(".ebuild") and not mf.hasFile("EBUILD", f):
- writemsg("!!! A file is not listed in the " + \
- "Manifest: '%s'\n" % os.path.join(pkgdir, f),
- noiselevel=-1)
+ f = os.path.join(pkgdir, f)
+ if f not in _doebuild_broken_ebuilds:
+ out = portage.output.EOutput()
+ out.eerror("A file is not listed in the " + \
+ "Manifest: '%s'" % (f,))
_doebuild_broken_manifests.add(manifest_path)
return 1
- _doebuild_manifest_checked = manifest_path
+
+ # Only cache it if the above stray files test succeeds.
+ _doebuild_manifest_cache = mf
def exit_status_check(retval):
if retval != os.EX_OK:
# args are for the to spawn function
actionmap = {
-"setup": {"cmd":ebuild_sh, "args":{"droppriv":0, "free":1, "sesandbox":0, "fakeroot":0}},
-"unpack": {"cmd":ebuild_sh, "args":{"droppriv":droppriv, "free":0, "sesandbox":sesandbox, "fakeroot":0}},
-"compile":{"cmd":ebuild_sh, "args":{"droppriv":droppriv, "free":nosandbox, "sesandbox":sesandbox, "fakeroot":0}},
-"test": {"cmd":ebuild_sh, "args":{"droppriv":droppriv, "free":nosandbox, "sesandbox":sesandbox, "fakeroot":0}},
-"install":{"cmd":ebuild_sh, "args":{"droppriv":0, "free":0, "sesandbox":sesandbox, "fakeroot":fakeroot}},
-"rpm": {"cmd":misc_sh, "args":{"droppriv":0, "free":0, "sesandbox":0, "fakeroot":fakeroot}},
-"package":{"cmd":misc_sh, "args":{"droppriv":0, "free":0, "sesandbox":0, "fakeroot":fakeroot}},
+"setup": {"cmd":ebuild_sh, "args":{"droppriv":0, "free":1, "sesandbox":0, "fakeroot":0}},
+"unpack": {"cmd":ebuild_sh, "args":{"droppriv":droppriv, "free":0, "sesandbox":sesandbox, "fakeroot":0}},
+"configure":{"cmd":ebuild_sh, "args":{"droppriv":droppriv, "free":nosandbox, "sesandbox":sesandbox, "fakeroot":0}},
+"compile": {"cmd":ebuild_sh, "args":{"droppriv":droppriv, "free":nosandbox, "sesandbox":sesandbox, "fakeroot":0}},
+"test": {"cmd":ebuild_sh, "args":{"droppriv":droppriv, "free":nosandbox, "sesandbox":sesandbox, "fakeroot":0}},
+"install": {"cmd":ebuild_sh, "args":{"droppriv":0, "free":0, "sesandbox":sesandbox, "fakeroot":fakeroot}},
+"rpm": {"cmd":misc_sh, "args":{"droppriv":0, "free":0, "sesandbox":0, "fakeroot":fakeroot}},
+"package": {"cmd":misc_sh, "args":{"droppriv":0, "free":0, "sesandbox":0, "fakeroot":fakeroot}},
}
# merge the deps in so we have again a 'full' actionmap
"ACCEPT_KEYWORDS", "ACCEPT_LICENSE",
"CONFIG_PROTECT_MASK", "CONFIG_PROTECT",
"PRELINK_PATH", "PRELINK_PATH_MASK", "PROFILE_ONLY_VARIABLES"]
-EBUILD_PHASES = ["setup", "unpack", "compile", "test", "install",
+EBUILD_PHASES = ["setup", "unpack", "configure",
+ "compile", "test", "install",
"package", "preinst", "postinst","prerm", "postrm",
"other"]
writemsg("!!! FAILED prerm: %s\n" % \
os.path.join(self.dbdir, "EAPI"), noiselevel=-1)
writemsg("%s\n" % str(e), noiselevel=-1)
- return 1
- catdir = os.path.dirname(self.settings["PORTAGE_BUILDDIR"])
- ensure_dirs(os.path.dirname(catdir),
- uid=portage_uid, gid=portage_gid, mode=070, mask=0)
+ myebuildpath = None
+ else:
+ catdir = os.path.dirname(self.settings["PORTAGE_BUILDDIR"])
+ ensure_dirs(os.path.dirname(catdir), uid=portage_uid,
+ gid=portage_gid, mode=070, mask=0)
+
builddir_lock = None
catdir_lock = None
scheduler = self._scheduler
# XXX: Decide how to handle failures here.
if retval != os.EX_OK:
writemsg("!!! FAILED prerm: %s\n" % retval, noiselevel=-1)
- return retval
self._unmerge_pkgfiles(pkgfiles, others_in_slot)
# XXX: Decide how to handle failures here.
if retval != os.EX_OK:
writemsg("!!! FAILED postrm: %s\n" % retval, noiselevel=-1)
- return retval
# regenerate reverse NEEDED map
self.vartree.dbapi.linkmap.rebuild()
path = normalize_path(path + "/..")
maxdepth -= 1
-
-def parse_use_local_desc(mylines, usedict=None):
- """
- Records are of the form PACKAGE:FLAG - DESC
- returns a dict of the form {cpv:set(flags)}"""
- if usedict is None:
- usedict = {}
- for line_num, l in enumerate(mylines):
- if not l or l.startswith('#'):
- continue
- pkg_flag = l.split(None, 1) # None implies splitting on whitespace
- if not pkg_flag:
- continue
- try:
- pkg, flag = pkg_flag[0].split(":")
- except ValueError:
- raise exception.ParseError("line %d: Malformed input: '%s'" % \
- (line_num + 1, l.rstrip("\n")))
- usedict.setdefault(pkg, set())
- usedict[pkg].add(flag)
- return usedict
-
def parse_metadata_use(mylines, uselist=None):
"""
Records are wrapped in XML as per GLEP 56