commit:     52411290c67535d94c7b20fa996ae7108014adfb
Author:     Sheng Yu <syu.os <AT> protonmail <DOT> com>
AuthorDate: Fri Aug 19 20:24:59 2022 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Fri Sep  9 10:15:57 2022 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=52411290

Detect binary package format if not in database

Signed-off-by: Sheng Yu <syu.os <AT> protonmail.com>
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 lib/portage/dbapi/bintree.py | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/lib/portage/dbapi/bintree.py b/lib/portage/dbapi/bintree.py
index b441fff9a..0857ff21a 100644
--- a/lib/portage/dbapi/bintree.py
+++ b/lib/portage/dbapi/bintree.py
@@ -1039,6 +1039,12 @@ class binarytree:
                     if match:
                         binpkg_format = match.get("BINPKG_FORMAT", None)
 
+                    if not binpkg_format:
+                        if myfile.endswith(SUPPORTED_XPAK_EXTENSIONS):
+                            binpkg_format = "xpak"
+                        elif myfile.endswith(SUPPORTED_GPKG_EXTENSIONS):
+                            binpkg_format = "gpkg"
+
                     if gpkg_only:
                         if binpkg_format != "gpkg":
                             if not gpkg_only_warned:

Reply via email to