diff options
author | 2015-07-09 11:47:53 -0400 | |
---|---|---|
committer | 2015-07-09 15:37:31 -0400 | |
commit | 2e9bfdca7882a9fe8d0b45d23b18b55575493957 (patch) | |
tree | d465fdd7903e8f72770d80df48e7020edb062dbd | |
parent | test: drop global function list test (diff) | |
download | pkgcore-2e9bfdca7882a9fe8d0b45d23b18b55575493957.tar.gz pkgcore-2e9bfdca7882a9fe8d0b45d23b18b55575493957.tar.bz2 pkgcore-2e9bfdca7882a9fe8d0b45d23b18b55575493957.zip |
setup: generate bash function lists at install time
Instead of only during sdist creation. This fixes cases where installing
from live ebuilds or installing via pip without creating an sdist first
wouldn't generate the function lists.
-rwxr-xr-x | setup.py | 48 |
1 files changed, 26 insertions, 22 deletions
@@ -47,28 +47,6 @@ class mysdist(snk_distutils.sdist): snk_distutils.sdist.initialize_options(self) self.build_docs = True - def run(self): - # generate function lists used in env cleaning - bash_dir = os.path.join(os.getcwd(), 'bash') - with open(os.devnull, 'w') as devnull: - if subprocess.call( - ['bash', 'regenerate_dont_export_func_list.bash', - os.path.join(bash_dir, 'funcnames', 'global')], - cwd=bash_dir, stderr=devnull): - raise errors.DistutilsExecError("generating global list failed") - - eapis = (x.split('.')[0] for x in os.listdir(os.path.join(bash_dir, 'eapi')) - if x.split('.')[0].isdigit()) - for eapi in sorted(eapis): - with open(os.path.join(bash_dir, 'funcnames', eapi), 'w') as f: - if subprocess.call( - ['bash', 'generate_eapi_func_list.bash', eapi], - cwd=bash_dir, stdout=f): - raise errors.DistutilsExecError( - "generating EAPI %s list failed" % eapi) - - snk_distutils.sdist.run(self) - def make_release_tree(self, base_dir, files): """Create and populate the directory tree that is put in source tars. @@ -395,6 +373,32 @@ class pkgcore_install(_base_install): # rather than assuming it is running from a tarball/git repo. write_pkgcore_lookup_configs(self.install_purelib, target) + # Generate ebd function lists used for environment filtering. + print(self.root) + print(self.install_data) + print(os.path.join(self.install, target, EBD_INSTALL_OFFSET)) + write_pkgcore_ebd_funclists(os.path.join(root, target, EBD_INSTALL_OFFSET)) + + +def write_pkgcore_ebd_funclists(ebd_dir): + log.info("Writing ebd function lists to %s" % os.path.join(ebd_dir, 'funcnames')) + with open(os.devnull, 'w') as devnull: + if subprocess.call( + ['bash', 'regenerate_dont_export_func_list.bash', + os.path.join(ebd_dir, 'funcnames', 'global')], + cwd=ebd_dir, stderr=devnull): + raise errors.DistutilsExecError("generating global list failed") + + eapis = (x.split('.')[0] for x in os.listdir(os.path.join(ebd_dir, 'eapi')) + if x.split('.')[0].isdigit()) + for eapi in sorted(eapis): + with open(os.path.join(ebd_dir, 'funcnames', eapi), 'w') as f: + if subprocess.call( + ['bash', 'generate_eapi_func_list.bash', eapi], + cwd=ebd_dir, stdout=f): + raise errors.DistutilsExecError( + "generating EAPI %s list failed" % eapi) + def write_pkgcore_lookup_configs(python_base, install_prefix, injected_bin_path=()): path = os.path.join(python_base, "pkgcore", "_const.py") |