From a9a1434d31db938282c6a4e2bc5c655479fe072c Mon Sep 17 00:00:00 2001 From: Botanid-Zade Date: Mon, 10 Apr 2023 03:27:51 +0300 Subject: [PATCH] Fix native packages detection. --- lib/fpm/package/pyfpm_wheel/get_metadata_wheel.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/fpm/package/pyfpm_wheel/get_metadata_wheel.py b/lib/fpm/package/pyfpm_wheel/get_metadata_wheel.py index b7c147e8f6..f5a72e4b64 100644 --- a/lib/fpm/package/pyfpm_wheel/get_metadata_wheel.py +++ b/lib/fpm/package/pyfpm_wheel/get_metadata_wheel.py @@ -47,9 +47,8 @@ def __wheel_root_is_pure(self): for name in names: if name.endswith('.dist-info/WHEEL'): for line in archive.read(name).split(b"\n"): - line_lower = str(line).lower().strip() - if line_lower.startswith('root-is-purelib') and \ - line_lower.endswith('true'): + line_lower = str(line.decode()).lower().strip() + if line_lower.startswith('root-is-purelib') and line_lower.endswith('true'): return True return False @@ -76,10 +75,11 @@ def run(self, output_path): data["url"] = self.get_home_url(fpm_wheel.project_urls) # @todo Can anyone provide a package, where fpm_wheel.requires_external is 'true'? - if fpm_wheel.requires_external or not self.__wheel_root_is_pure(): - data["architecture"] = "native" - else: +# print('REQ-TOML EXTERNAL:', fpm_wheel.requires_external, file=sys.stderr) + if self.__wheel_root_is_pure() and not fpm_wheel.requires_external: data["architecture"] = "all" + else: + data["architecture"] = "native" # print('REQ-TOML:', fpm_wheel.requires, file=sys.stderr) # print('REQ-TOML DIST:', fpm_wheel.requires_dist, file=sys.stderr)