1 |
commit: f1d98b6dc36ff2b47c36427c9938999320352eb4 |
2 |
Author: Sam James <sam <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon Jan 2 04:47:11 2023 +0000 |
4 |
Commit: Sam James <sam <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Jan 2 05:25:51 2023 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=f1d98b6d |
7 |
|
8 |
news: fix value of profiles_base |
9 |
|
10 |
This fixes matching profile paths in Display-If-Profile in news items. |
11 |
|
12 |
bad: kwargs['profile']='var/db/repos/gentoo/profiles/default/linux/amd64/17.1/hardened', self.profile='default/linux/amd64/17.1/hardened' |
13 |
good: kwargs['profile']='default/linux/amd64/17.1/hardened', self.profile='default/linux/amd64/17.1/hardened' |
14 |
|
15 |
os.path.join() treats paths differently based on the components given: |
16 |
'os.path.join(portdir, "profiles", os.path.sep)' passes 3 different paths, |
17 |
whereas before 64d84ce2d9a333e83e2a5fba5e7ec95f936959e7, and now, we concat. |
18 |
profiles and os.path.sep first so that further splitting isn't carried out. |
19 |
|
20 |
Thanks to kurly for noticing a recent news item wasn't showing up. |
21 |
|
22 |
Fixes: 64d84ce2d9a333e83e2a5fba5e7ec95f936959e7 |
23 |
Signed-off-by: Sam James <sam <AT> gentoo.org> |
24 |
|
25 |
lib/portage/news.py | 2 +- |
26 |
1 file changed, 1 insertion(+), 1 deletion(-) |
27 |
|
28 |
diff --git a/lib/portage/news.py b/lib/portage/news.py |
29 |
index 51d493cb7..14401814d 100644 |
30 |
--- a/lib/portage/news.py |
31 |
+++ b/lib/portage/news.py |
32 |
@@ -79,7 +79,7 @@ class NewsManager: |
33 |
portdir = portdb.repositories.mainRepoLocation() |
34 |
profiles_base = None |
35 |
if portdir is not None: |
36 |
- profiles_base = os.path.join(portdir, "profiles", os.path.sep) |
37 |
+ profiles_base = os.path.join(portdir, ("profiles" + os.path.sep)) |
38 |
profile_path = None |
39 |
if profiles_base is not None and portdb.settings.profile_path: |
40 |
profile_path = normalize_path( |