Verified Commit b15d346c authored by A. Wilcox's avatar A. Wilcox 🦊
Browse files

Initial work for adding APK support to Portage

parent 062684bf
......@@ -235,7 +235,7 @@ def discard_digests(myebuild, mysettings, mydbapi):
portage.settings.validate() # generate warning messages if necessary
build_dir_phases = set(["setup", "unpack", "prepare", "configure", "compile",
"test", "install", "package", "rpm", "merge", "qmerge"])
"test", "install", "package", "rpm", "apk", "merge", "qmerge"])
# If the current metadata is invalid then force the ebuild to be
# sourced again even if $T/environment already exists.
......
......@@ -296,6 +296,10 @@ __dyn_clean() {
true
}
__dyn_apk() {
python3.4 -m apkkit.portage
}
__abort_handler() {
local msg
if [ "$2" != "fail" ]; then
......@@ -1010,7 +1014,7 @@ __ebuild_main() {
fi
export SANDBOX_ON="0"
;;
help|pretend|setup)
help|pretend|setup|apk)
#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.
......
......@@ -315,9 +315,9 @@ class EbuildBuild(CompositeTask):
requested_binpkg_formats = self.settings.get("PORTAGE_BINPKG_FORMAT", "tar").split()
for pkg_fmt in portage.const.SUPPORTED_BINPKG_FORMATS:
if pkg_fmt in requested_binpkg_formats:
if pkg_fmt == "rpm":
if pkg_fmt == "rpm" or pkg_fmt == "apk":
binpkg_tasks.add(EbuildPhase(background=self.background,
phase="rpm", scheduler=self.scheduler,
phase=pkg_fmt, scheduler=self.scheduler,
settings=self.settings))
else:
task = EbuildBinpkg(
......
......@@ -271,7 +271,7 @@ LIVE_ECLASSES = frozenset([
"tla",
])
SUPPORTED_BINPKG_FORMATS = ("tar", "rpm")
SUPPORTED_BINPKG_FORMATS = ("tar", "rpm", "apk")
SUPPORTED_XPAK_EXTENSIONS = (".tbz2", ".xpak")
# Time formats used in various places like metadata.chk.
......
......@@ -633,7 +633,7 @@ def doebuild(myebuild, mydo, _unused=DeprecationWarning, settings=None, debug=0,
"config", "info", "setup", "depend", "pretend",
"fetch", "fetchall", "digest",
"unpack", "prepare", "configure", "compile", "test",
"install", "rpm", "qmerge", "merge",
"install", "rpm", "apk", "qmerge", "merge",
"package", "unmerge", "manifest", "nofetch"]
if mydo not in validcommands:
......@@ -967,7 +967,7 @@ def doebuild(myebuild, mydo, _unused=DeprecationWarning, settings=None, debug=0,
if eapi_exports_replace_vars(mysettings["EAPI"]) and \
(mydo in ("postinst", "preinst", "pretend", "setup") or \
("noauto" not in features and not returnpid and \
(mydo in actionmap_deps or mydo in ("merge", "package", "qmerge")))):
(mydo in actionmap_deps or mydo in ("merge", "package", "apk", "qmerge")))):
if not vartree:
writemsg("Warning: vartree not given to doebuild. " + \
"Cannot set REPLACING_VERSIONS in pkg_{pretend,setup}\n")
......@@ -1187,7 +1187,14 @@ def doebuild(myebuild, mydo, _unused=DeprecationWarning, settings=None, debug=0,
myebuild=mysettings["EBUILD"], mytree=tree, mydbapi=mydbapi,
vartree=vartree, prev_mtimes=prev_mtimes,
fd_pipes=fd_pipes)
elif mydo == "apk":
from apkkit import portage as apk_portage
retval = spawnebuild("install", actionmap, mysettings, debug,
alwaysdep=1, logfile=logfile, fd_pipes=fd_pipes,
returnpid=returnpid)
if retval == os.EX_OK:
_handle_self_update(mysettings, vartree.dbapi)
retval = apk_portage.native(mysettings, mydbapi=mydbapi)
else:
writemsg_stdout(_("!!! Unknown mydo: %s\n") % mydo, noiselevel=-1)
return 1
......
......@@ -7,5 +7,5 @@
# repoman manifest
# ...
export PATH="$(dirname ${BASH_SOURCE[0]})/bin:${PATH}"
export PYTHONPATH=PYTHONPATH="$(dirname $BASH_SOURCE[0])/pym:${PYTHONPATH:+:}${PYTHONPATH}"
export PYTHONPATH="$(dirname $BASH_SOURCE[0])/pym:${PYTHONPATH:+:}${PYTHONPATH}"
export PYTHONWARNINGS=d,i::ImportWarning
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment