aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam James <sam@gentoo.org>2023-01-02 04:47:11 +0000
committerSam James <sam@gentoo.org>2023-01-02 05:25:51 +0000
commitf1d98b6dc36ff2b47c36427c9938999320352eb4 (patch)
tree5aa780df8cd8e3ba68d6690743c657260868cb0c
parentAdd a pre-commit config (diff)
downloadportage-f1d98b6d.tar.gz
portage-f1d98b6d.tar.bz2
portage-f1d98b6d.zip
news: fix value of profiles_base
This fixes matching profile paths in Display-If-Profile in news items. bad: kwargs['profile']='var/db/repos/gentoo/profiles/default/linux/amd64/17.1/hardened', self.profile='default/linux/amd64/17.1/hardened' good: kwargs['profile']='default/linux/amd64/17.1/hardened', self.profile='default/linux/amd64/17.1/hardened' os.path.join() treats paths differently based on the components given: 'os.path.join(portdir, "profiles", os.path.sep)' passes 3 different paths, whereas before 64d84ce2d9a333e83e2a5fba5e7ec95f936959e7, and now, we concat. profiles and os.path.sep first so that further splitting isn't carried out. Thanks to kurly for noticing a recent news item wasn't showing up. Fixes: 64d84ce2d9a333e83e2a5fba5e7ec95f936959e7 Signed-off-by: Sam James <sam@gentoo.org>
-rw-r--r--lib/portage/news.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/portage/news.py b/lib/portage/news.py
index 51d493cb7..14401814d 100644
--- a/lib/portage/news.py
+++ b/lib/portage/news.py
@@ -79,7 +79,7 @@ class NewsManager:
portdir = portdb.repositories.mainRepoLocation()
profiles_base = None
if portdir is not None:
- profiles_base = os.path.join(portdir, "profiles", os.path.sep)
+ profiles_base = os.path.join(portdir, ("profiles" + os.path.sep))
profile_path = None
if profiles_base is not None and portdb.settings.profile_path:
profile_path = normalize_path(