diff options
| author | 2017-11-14 13:11:22 -0800 | |
|---|---|---|
| committer | 2017-11-14 13:14:13 -0800 | |
| commit | 4c4559f45b653a6b816ae66b1a6c4e7dd2ef7e8c (patch) | |
| tree | 1564d6846120d66c3aa7bc51b86d4c2e0f69cdc2 | |
| parent | repoman: Update for a repoman-2.3.5 release (diff) | |
| download | portage-4c4559f45b653a6b816ae66b1a6c4e7dd2ef7e8c.tar.gz portage-4c4559f45b653a6b816ae66b1a6c4e7dd2ef7e8c.tar.bz2 portage-4c4559f45b653a6b816ae66b1a6c4e7dd2ef7e8c.zip | |
repoman/setup.py: create pym -> lib symlink for unit tests (bug 637460)
Various code involving the .repoman_not_installed file assumes
that the 'pym' directory should be added to sys.path, therefore
create a pym -> lib symlink during unit tests.
Bug: https://bugs.gentoo.org/637460
| -rwxr-xr-x | repoman/setup.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/repoman/setup.py b/repoman/setup.py index 6411231e0..ce0bc493a 100755 --- a/repoman/setup.py +++ b/repoman/setup.py @@ -147,6 +147,11 @@ class x_clean(clean): print('removing %s symlink' % repr(conf_dir)) os.unlink(conf_dir) + pym_dir = os.path.join(top_dir, 'pym') + if os.path.islink(pym_dir): + print('removing %s sylink' % repr(pym_dir)) + os.unlink(pym_dir) + pni_file = os.path.join(top_dir, '.repoman_not_installed') if os.path.exists(pni_file): print('removing %s' % repr(pni_file)) @@ -393,6 +398,17 @@ class build_tests(x_build_scripts_custom): print('Symlinking %s -> %s' % (conf_dir, conf_src)) os.symlink(conf_src, conf_dir) + # symlink 'pym' directory + pym_dir = os.path.join(self.top_dir, 'pym') + if os.path.exists(pym_dir): + if not os.path.islink(pym_dir): + raise SystemError('%s exists and is not a symlink (collision)' + % repr(pym_dir)) + os.unlink(pym_dir) + pym_src = 'lib' + print('Symlinking %s -> %s' % (pym_dir, pym_src)) + os.symlink(pym_src, pym_dir) + # create $build_lib/../.repoman_not_installed # to enable proper paths in tests with open(os.path.join(self.top_dir, '.repoman_not_installed'), 'w'): |
