commit:     0fc01548b6c4242002a253a616de52a1c5a6c5ad
Author:     Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
AuthorDate: Tue Jan 20 20:06:45 2026 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Tue Jan 20 21:29:18 2026 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=0fc01548

PACKDEBUG: Add path to const.py

dbapi/vartree.py Import the path, replace hard coded instances.
This makes the path available to API consumers

Signed-off-by: Brian Dolbec <brian.dolbec <AT> gmail.com>
Part-of: https://github.com/gentoo/portage/pull/1544
Closes: https://github.com/gentoo/portage/pull/1544
Signed-off-by: Sam James <sam <AT> gentoo.org>

 lib/portage/const.py         | 1 +
 lib/portage/dbapi/vartree.py | 5 +++--
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/lib/portage/const.py b/lib/portage/const.py
index b8b17d5e1f..6aace0fca8 100644
--- a/lib/portage/const.py
+++ b/lib/portage/const.py
@@ -107,6 +107,7 @@ PRELINK_BINARY = f"{BINARY_PREFIX}/usr/sbin/prelink"
 
 INVALID_ENV_FILE = "/etc/spork/is/not/valid/profile.env"
 MERGING_IDENTIFIER = "-MERGING-"
+PACKDEBUG_PATH = "/usr/lib/debug/.tarball"
 REPO_NAME_FILE = "repo_name"
 REPO_NAME_LOC = f"profiles/{REPO_NAME_FILE}"
 

diff --git a/lib/portage/dbapi/vartree.py b/lib/portage/dbapi/vartree.py
index 2239fba271..87d4f34532 100644
--- a/lib/portage/dbapi/vartree.py
+++ b/lib/portage/dbapi/vartree.py
@@ -9,6 +9,7 @@ from portage.const import (
     CACHE_PATH,
     CONFIG_MEMORY_FILE,
     MERGING_IDENTIFIER,
+    PACKDEBUG_PATH,
     PORTAGE_PACKAGE_ATOM,
     PRIVATE_PATH,
     VDB_PATH,
@@ -2755,7 +2756,7 @@ class dblink:
                 # For packdebug, we don't want to clean up old debuginfo
                 # tarballs that we made, as we want to keep serving them
                 # to binhost clients for some time.
-                uninstall_ignore += " /usr/lib/debug/.tarball/*"
+                uninstall_ignore += f" {PACKDEBUG_PATH}/*"
 
             uninstall_ignore = shlex.split(uninstall_ignore)
 
@@ -3950,7 +3951,7 @@ class dblink:
         # packdebug tarballs are orphaned for management outside of Portage,
         # so it's expected that we may collide with an orphaned file. Ignore 
it.
         if "packdebug" in self.settings.features:
-            x = "/usr/lib/debug/.tarball"
+            x = PACKDEBUG_PATH
             if os.path.isdir(os.path.join(self._eroot, x.lstrip(os.sep))):
                 x = normalize_path(x)
                 x += "/*"

Reply via email to