done
fi
+ # EAPI=3 adds --disable-dependency-tracking to econf
+ if ! hasq "$EAPI" 0 1 2 ; then
+ set -- --disable-dependency-tracking "$@"
+ fi
+
# if the profile defines a location to install libs to aside from default, pass it on.
# if the ebuild passes in --libdir, they're responsible for the conf_libdir fun.
local CONF_LIBDIR LIBDIR_VAR="LIBDIR_${ABI}"
_eapi2_src_compile
}
+_eapi0_src_install() {
+ _eapi2_src_install
+}
+
_eapi0_src_test() {
if emake -j1 check -n &> /dev/null; then
vecho ">>> Test phase [check]: ${CATEGORY}/${PF}"
_eapi2_src_compile
}
+_eapi1_src_install() {
+ _eapi2_src_install
+}
+
_eapi2_src_configure() {
if [[ -x ${ECONF_SOURCE:-.}/configure ]] ; then
econf
fi
}
-src_install() {
+_eapi2_src_install() {
if use prefix ; then
- # this avoids misc errors in prefix because it doesn't exist
+ # this avoids misc errors in Prefix because it doesn't exist
# by default
mkdir -p "${ED}"
return
fi
}
+_eapi3_src_install() {
+ if [[ -f Makefile || -f GNUmakefile || -f makefile ]] ; then
+ emake DESTDIR="${D}" install
+ fi
+
+ if [[ -z $DOCS ]] ; then
+ local d
+ for d in README* ChangeLog AUTHORS NEWS TODO CHANGES \
+ THANKS BUGS FAQ CREDITS CHANGELOG ; do
+ [[ -s "${d}" ]] && dodoc "${d}"
+ done
+ elif [[ $(declare -p DOCS) == "declare -a "* ]] ; then
+ dodoc "${DOCS[@]}"
+ else
+ dodoc ${DOCS}
+ fi
+}
+
ebuild_phase() {
declare -F "$1" >/dev/null && qa_call $1
}
done
}
+dyn_pretend() {
+ ebuild_phase_with_hooks pkg_pretend
+}
+
dyn_setup() {
ebuild_phase_with_hooks pkg_setup
}
echo "than one option is specified, each will be executed in order."
echo
echo " help : show this help screen"
+ echo " pretend : execute package specific pretend actions"
echo " setup : execute package specific setup actions"
echo " fetch : download source archive(s) and patches"
echo " digest : create a manifest file for the package"
local phase_func=""
case "$arg" in
+ pretend)
+ ! hasq $eapi 0 1 2 && \
+ phase_func=pkg_pretend
+ ;;
setup)
phase_func=pkg_setup
;;
declare -F src_compile >/dev/null || \
src_compile() { _eapi2_src_compile "$@" ; }
+ [[ $eapi == 2 ]] || declare -F src_install >/dev/null || \
+ src_install() { _eapi3_src_install "$@" ; }
+
if hasq $phase_func $default_phases ; then
_eapi2_pkg_nofetch () { _eapi0_pkg_nofetch "$@" ; }
pkg_nofetch pkg_postinst pkg_postrm pkg_preinst pkg_prerm
pkg_setup src_test src_unpack"
;;
- *)
+ 2)
valid_phases="src_compile pkg_config src_configure pkg_info
src_install pkg_nofetch pkg_postinst pkg_postrm pkg_preinst
src_prepare pkg_prerm pkg_setup src_test src_unpack"
;;
+ *)
+ valid_phases="src_compile pkg_config src_configure pkg_info
+ src_install pkg_nofetch pkg_postinst pkg_postrm pkg_preinst
+ src_prepare pkg_prerm pkg_pretend pkg_setup src_test src_unpack"
+ ;;
esac
DEFINED_PHASES=
fi
export SANDBOX_ON="0"
;;
- help|setup|preinst)
+ help|pretend|setup|preinst)
#pkg_setup needs to be out of the sandbox for tmp file creation;
#for example, awking and piping a file in /tmp requires a temp file to be created
#in /etc. If pkg_setup is in the sandbox, both our lilo and apache ebuilds break.
buffer is not cleared prior to the prompt, so an accidental press of the
"Enter" key at any time prior to the prompt will be interpreted as a choice!\fR
.TP
+.BR "\-\-binpkg\-respect\-use < y | n >"
+Tells emerge to ignore binary packages if their use flags
+don't match the current configuration. (default: \'n\')
+.TP
.BR "\-\-buildpkg " (\fB\-b\fR)
Tells emerge to build binary packages for all ebuilds processed in
addition to actually merging the packages. Useful for maintainers
orig_use, orig_iuse, cur_use, cur_iuse):
"""Return a set of flags that trigger reinstallation, or None if there
are no such flags."""
- if "--newuse" in self._frozen_config.myopts:
+ if "--newuse" in self._frozen_config.myopts or \
+ "--binpkg-respect-use" in self._frozen_config.myopts:
flags = set(orig_iuse.symmetric_difference(
cur_iuse).difference(forced_flags))
flags.update(orig_iuse.intersection(orig_use).symmetric_difference(
# reject the built package if necessary.
if built and not installed and \
("--newuse" in self._frozen_config.myopts or \
- "--reinstall" in self._frozen_config.myopts):
+ "--reinstall" in self._frozen_config.myopts or \
+ "--binpkg-respect-use" in self._frozen_config.myopts):
iuses = pkg.iuse.all
old_use = pkg.use.enabled
if myeb:
print " to the prompt, so an accidental press of the \"Enter\" key at any"
print " time prior to the prompt will be interpreted as a choice!"
print
+ print " " + green("--binpkg-respect-use") + \
+ " < " + turquoise("y") + " | " + turquoise("n") + " >"
+ desc = "Tells emerge to ignore binary packages if their use flags" + \
+ " don't match the current configuration. (default: 'n')"
+ for line in wrap(desc, desc_width):
+ print desc_indent + line
+ print
print " "+green("--buildpkg")+" ("+green("-b")+" short option)"
desc = "Tells emerge to build binary packages for all ebuilds processed in" + \
" addition to actually merging the packages. Useful for maintainers" + \
if icount > 0:
out.einfo("Processed %d info files." % (icount,))
-def display_preserved_libs(vardbapi):
+def display_preserved_libs(vardbapi, myopts):
MAX_DISPLAY = 3
# Ensure the registry is consistent with existing files.
vardbapi.plib_registry.pruneNonExisting()
if vardbapi.plib_registry.hasEntries():
- print
- print colorize("WARN", "!!!") + " existing preserved libs:"
+ if "--quiet" in myopts:
+ print
+ print colorize("WARN", "!!!") + " existing preserved libs found"
+ return
+ else:
+ print
+ print colorize("WARN", "!!!") + " existing preserved libs:"
+
plibdata = vardbapi.plib_registry.getPreservedLibs()
linkmap = vardbapi.linkmap
consumer_map = {}
display_news_notification(root_config, myopts)
if retval in (None, os.EX_OK) or (not "--pretend" in myopts):
- display_preserved_libs(vardbapi)
+ display_preserved_libs(vardbapi, myopts)
sys.exit(retval)
jobs_opts = ("-j", "--jobs")
default_arg_opts = {
'--deselect' : ('n',),
+ '--binpkg-respect-use' : ('n', 'y',),
'--root-deps' : ('rdeps',),
}
arg_stack = args[:]
"type":"choice",
"choices":["changed-use"]
},
+
+ "--binpkg-respect-use": {
+ "help" : "discard binary packages if their use flags \
+ don't match the current configuration",
+ "type" : "choice",
+ "choices" : ("True", "y", "n")
+ },
+
"--root": {
"help" : "specify the target root filesystem for merging packages",
"action" : "store"
if myoptions.deselect == "True":
myoptions.deselect = True
+ if myoptions.binpkg_respect_use in ("y", "True",):
+ myoptions.binpkg_respect_use = True
+ else:
+ myoptions.binpkg_respect_use = None
+
if myoptions.root_deps == "True":
myoptions.root_deps = True
if mydo == "prepare" and eapi in ("0", "1"):
return os.EX_OK
+ if mydo == "pretend" and eapi in ("0", "1", "2"):
+ return os.EX_OK
+
kwargs = actionmap[mydo]["args"]
mysettings["EBUILD_PHASE"] = mydo
_doebuild_exit_status_unlink(
clean_phases = ("clean", "cleanrm")
validcommands = ["help","clean","prerm","postrm","cleanrm","preinst","postinst",
- "config", "info", "setup", "depend",
+ "config", "info", "setup", "depend", "pretend",
"fetch", "fetchall", "digest",
"unpack", "prepare", "configure", "compile", "test",
"install", "rpm", "qmerge", "merge",
# args are for the to spawn function
actionmap = {
+"pretend": {"cmd":ebuild_sh, "args":{"droppriv":0, "free":1, "sesandbox":0, "fakeroot":0}},
"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}},
"prepare": {"cmd":ebuild_sh, "args":{"droppriv":droppriv, "free":0, "sesandbox":sesandbox, "fakeroot":0}},
_category_re = re.compile(r'^\w[-.+\w]*$')
_pkg_dir_name_re = re.compile(r'^\w[-+\w]*$')
_categories = None
- _iuse_implicit = None
+ _iuse_implicit_re = None
_use_mutable = False
_known_keys = frozenset(x for x in auxdbkeys
if not x.startswith("UNUSED_0"))
1) Check for required IUSE intersection (need implicit IUSE here).
2) Check enabled/disabled flag states.
"""
- if self._iuse_implicit is None:
- self._iuse_implicit = self.settings._get_implicit_iuse()
+ if self._iuse_implicit_re is None:
+ self._iuse_implicit_re = re.compile("^(%s)$" % \
+ "|".join(self.settings._get_implicit_iuse()))
+ iuse_implicit_re = self._iuse_implicit_re
for cpv in cpv_iter:
try:
iuse, slot, use = self.aux_get(cpv, ["IUSE", "SLOT", "USE"])
except KeyError:
continue
use = use.split()
- iuse = self._iuse_implicit.union(
- re.escape(x.lstrip("+-")) for x in iuse.split())
- iuse_re = re.compile("^(%s)$" % "|".join(iuse))
+ iuse = frozenset(x.lstrip('+-') for x in iuse.split())
missing_iuse = False
for x in atom.use.required:
- if iuse_re.match(x) is None:
+ if x not in iuse and iuse_implicit_re.match(x) is None:
missing_iuse = True
break
if missing_iuse:
else:
from portage import settings
self.mysettings = config(clone=settings)
- self._iuse_implicit = self.mysettings._get_implicit_iuse()
self._categories = self.mysettings.categories
# This is strictly for use in aux_get() doebuild calls when metadata
# is generated by the depend phase. It's safest to use a clone for