1 |
commit: 1733e574716d2e904dcd9b0338a61fbfe0a798e7 |
2 |
Author: Zac Medico <zmedico <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sat Apr 7 00:32:43 2018 +0000 |
4 |
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Apr 7 01:42:01 2018 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=1733e574 |
7 |
|
8 |
ResolverPlayground: create ${EPREFIX}/usr/share/repoman |
9 |
|
10 |
This solves the following issue when running the tests with |
11 |
an installed instance of repoman like we do in travis: |
12 |
|
13 |
testSimple (repoman.tests.simple.test_simple.SimpleRepomanTestCase) ... Traceback (most recent call last): |
14 |
File "/usr/bin/repoman", line 44, in <module> |
15 |
repoman_main(sys.argv[1:]) |
16 |
File "/home/travis/virtualenv/python2.7.14/lib/python2.7/site-packages/repoman/main.py", line 95, in repoman_main |
17 |
repoman_settings, vcs_settings, options, qadata) |
18 |
File "/home/travis/virtualenv/python2.7.14/lib/python2.7/site-packages/repoman/repos.py", line 56, in __init__ |
19 |
if not self.qadata.load_repo_config(self.masters_list, options, repoman_settings.valid_versions): |
20 |
File "/home/travis/virtualenv/python2.7.14/lib/python2.7/site-packages/repoman/qa_data.py", line 46, in load_repo_config |
21 |
repomanpaths = [os.path.join(cnfdir, _file_) for _file_ in os.listdir(cnfdir)] |
22 |
OSError: [Errno 2] No such file or directory: '/tmp/tmpWkrEvP/usr/share/repoman/qa_data' |
23 |
|
24 |
pym/portage/tests/resolver/ResolverPlayground.py | 10 ++++++++++ |
25 |
repoman/pym/repoman/tests/__init__.py | 3 +++ |
26 |
2 files changed, 13 insertions(+) |
27 |
|
28 |
diff --git a/pym/portage/tests/resolver/ResolverPlayground.py b/pym/portage/tests/resolver/ResolverPlayground.py |
29 |
index d3a5d8092..e2e061669 100644 |
30 |
--- a/pym/portage/tests/resolver/ResolverPlayground.py |
31 |
+++ b/pym/portage/tests/resolver/ResolverPlayground.py |
32 |
@@ -26,6 +26,11 @@ from _emerge.create_depgraph_params import create_depgraph_params |
33 |
from _emerge.depgraph import backtrack_depgraph |
34 |
from _emerge.RootConfig import RootConfig |
35 |
|
36 |
+try: |
37 |
+ from repoman.tests import cnf_path_repoman |
38 |
+except ImportError: |
39 |
+ cnf_path_repoman = None |
40 |
+ |
41 |
if sys.hexversion >= 0x3000000: |
42 |
# pylint: disable=W0622 |
43 |
basestring = str |
44 |
@@ -457,6 +462,11 @@ class ResolverPlayground(object): |
45 |
for line in lines: |
46 |
f.write("%s\n" % line) |
47 |
|
48 |
+ if cnf_path_repoman is not None: |
49 |
+ #Create /usr/share/repoman |
50 |
+ repoman_share_dir = os.path.join(self.eroot, 'usr', 'share', 'repoman') |
51 |
+ os.symlink(cnf_path_repoman, repoman_share_dir) |
52 |
+ |
53 |
def _create_world(self, world, world_sets): |
54 |
#Create /var/lib/portage/world |
55 |
var_lib_portage = os.path.join(self.eroot, "var", "lib", "portage") |
56 |
|
57 |
diff --git a/repoman/pym/repoman/tests/__init__.py b/repoman/pym/repoman/tests/__init__.py |
58 |
index 3421493f4..d57ca9b10 100644 |
59 |
--- a/repoman/pym/repoman/tests/__init__.py |
60 |
+++ b/repoman/pym/repoman/tests/__init__.py |
61 |
@@ -33,11 +33,14 @@ from portage.const import EPREFIX, GLOBAL_CONFIG_PATH, PORTAGE_BIN_PATH |
62 |
|
63 |
if repoman._not_installed: |
64 |
cnf_path = os.path.join(REPOMAN_BASE_PATH, 'cnf') |
65 |
+ cnf_path_repoman = cnf_path |
66 |
cnf_etc_path = cnf_path |
67 |
cnf_bindir = os.path.join(REPOMAN_BASE_PATH, 'bin') |
68 |
cnf_sbindir = cnf_bindir |
69 |
else: |
70 |
cnf_path = os.path.join(EPREFIX or '/', GLOBAL_CONFIG_PATH) |
71 |
+ cnf_path_repoman = os.path.join(EPREFIX or '/', |
72 |
+ sys.prefix.lstrip(os.sep), 'share', 'repoman') |
73 |
cnf_etc_path = os.path.join(EPREFIX or '/', 'etc') |
74 |
cnf_eprefix = EPREFIX |
75 |
cnf_bindir = os.path.join(EPREFIX or '/', 'usr', 'bin') |