From a0c89f8d0c7ecdd79481ddbb33e9574e12c7f936 Mon Sep 17 00:00:00 2001 From: Tim Harder Date: Mon, 1 Jan 2018 05:30:38 -0500 Subject: ebd: move all file compression to the python side --- ebd/eapi/common.lib | 9 +++++++++ ebd/helpers/common/doinfo | 1 - src/pkgcore/ebuild/ebd.py | 3 ++- src/pkgcore/ebuild/ebd_ipc.py | 11 +++++++++++ 4 files changed, 22 insertions(+), 2 deletions(-) diff --git a/ebd/eapi/common.lib b/ebd/eapi/common.lib index 18e427a72..327d61f11 100644 --- a/ebd/eapi/common.lib +++ b/ebd/eapi/common.lib @@ -386,6 +386,15 @@ __phase_pre_src_install() { __phase_pre_phase } +__phase_post_src_install() { + # trigger python side to handle file compression + __ebd_write_line 'compress numargs=2' + __IFS_push $'\a' + __ebd_write_line "targets=${PKGCORE_DOCOMPRESS[*]}" + __ebd_write_line "skip=${PKGCORE_DOCOMPRESS_SKIP[*]}" + __IFS_pop +} + unpack() { local file file_match filename myfail srcdir taropts tar_subdir taropts='--no-same-owner' diff --git a/ebd/helpers/common/doinfo b/ebd/helpers/common/doinfo index 7e3ca1810..156cba12d 100755 --- a/ebd/helpers/common/doinfo +++ b/ebd/helpers/common/doinfo @@ -5,4 +5,3 @@ check_args 1 - check_command install -m0644 -D -t "${ED}usr/share/info" -- "$@" -check_command "${PORTAGE_COMPRESS}" "${PORTAGE_COMPRESS_FLAGS}" -f "${ED}usr/share/info/${x##*/}" diff --git a/src/pkgcore/ebuild/ebd.py b/src/pkgcore/ebuild/ebd.py index 1507f98ac..0cf6f0293 100644 --- a/src/pkgcore/ebuild/ebd.py +++ b/src/pkgcore/ebuild/ebd.py @@ -30,7 +30,7 @@ from snakeoil.process.spawn import ( spawn_bash, spawn, is_sandbox_capable, is_userpriv_capable, spawn_get_output) from pkgcore.ebuild import ebuild_built, const -from pkgcore.ebuild.ebd_ipc import Doins, Dodoc, Dohtml +from pkgcore.ebuild.ebd_ipc import Doins, Dodoc, Dohtml, Compress from pkgcore.ebuild.processor import ( request_ebuild_processor, release_ebuild_processor, expected_ebuild_env, chuck_UnhandledCommand, inherit_handler) @@ -800,6 +800,7 @@ class buildable(ebd, setup_mixin, format.build): 'dohtml': Dohtml(self), 'doins': Doins(self), 'dodoc': Dodoc(self), + 'compress': Compress(self, async=True), } # TODO: replace print() usage with observer diff --git a/src/pkgcore/ebuild/ebd_ipc.py b/src/pkgcore/ebuild/ebd_ipc.py index 8978615c7..b24ee1782 100644 --- a/src/pkgcore/ebuild/ebd_ipc.py +++ b/src/pkgcore/ebuild/ebd_ipc.py @@ -153,3 +153,14 @@ class Dohtml(Doins): def run(self): return 0 + + +class Compress(IpcCommand): + """Compress files tagged on the bash side.""" + + def parse_args(self, targets='', skip=''): + self.targets = set(x for x in targets.split('\x07') if x) + self.skip = set(x for x in skip.split('\x07') if x) + + def run(self): + return 0 -- cgit v1.2.3-65-gdbad