1 |
On 24 Nov 2015 15:41, Joakim Tjernlund wrote: |
2 |
> Emerging on my embedded gentoo ppc target I see this: |
3 |
> .... |
4 |
> dev-lang/python-exec-2.0.1-r1::x-portage |
5 |
> sys-apps/install-xattr-0.5::x-portage |
6 |
> sys-libs/timezone-data-2015f::x-portage |
7 |
> |
8 |
> Where does the name x-portage come from? I do not have a repo |
9 |
> named x-portage, it is still named gentoo. |
10 |
|
11 |
it has no name so one is auto-created using the path. |
12 |
pym/portage/repository/config.py: |
13 |
@staticmethod |
14 |
def _read_valid_repo_name(repo_path): |
15 |
name, missing = RepoConfig._read_repo_name(repo_path) |
16 |
# We must ensure that the name conforms to PMS 3.1.5 |
17 |
# in order to avoid InvalidAtom exceptions when we |
18 |
# use it to generate atoms. |
19 |
name = _gen_valid_repo(name) |
20 |
if not name: |
21 |
# name only contains invalid characters |
22 |
name = "x-" + os.path.basename(repo_path) |
23 |
name = _gen_valid_repo(name) |
24 |
# If basename only contains whitespace then the |
25 |
# end result is name = 'x-'. |
26 |
return name, missing |
27 |
|
28 |
@staticmethod |
29 |
def _read_repo_name(repo_path): |
30 |
""" |
31 |
Read repo_name from repo_path. |
32 |
Returns repo_name, missing. |
33 |
""" |
34 |
repo_name_path = os.path.join(repo_path, REPO_NAME_LOC) |
35 |
f = None |
36 |
try: |
37 |
f = io.open( |
38 |
_unicode_encode(repo_name_path, |
39 |
encoding=_encodings['fs'], errors='strict'), |
40 |
mode='r', encoding=_encodings['repo.content'], |
41 |
errors='replace') |
42 |
return f.readline().strip(), False |
43 |
except EnvironmentError: |
44 |
return "x-" + os.path.basename(repo_path), True |
45 |
finally: |
46 |
if f is not None: |
47 |
f.close() |
48 |
-mike |