From 7b957158bbaffd22848f757d967e8dea58d54f21 Mon Sep 17 00:00:00 2001 From: Luis Sampaio Date: Fri, 16 Dec 2022 13:12:03 -0800 Subject: [PATCH] Reuse fix to not rebuild if no source changes build-pkgs --reuse rebuilds some packages even without source changes. This commit fixes the checksum comparison which was not working correctly for all package paths. Test Plan: Pass: build-pkgs --reuse and no packages were rebuilt Pass: build-pkgs (no packages were rebuilt) Pass: make changes to 1 package and call build-pkgs to rebuild it Pass: build-pkgs --clean (rebuilds all local packages) Closes-Bug: 1999941 Signed-off-by: Luis Sampaio Change-Id: Id93a692f6a69212967453e42809e66595ae01f59 --- build-tools/stx/dsccache.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/build-tools/stx/dsccache.py b/build-tools/stx/dsccache.py index 17838f38..ffbb0051 100755 --- a/build-tools/stx/dsccache.py +++ b/build-tools/stx/dsccache.py @@ -32,8 +32,8 @@ class DscCache(): with open(self.cache_file, 'rb') as fcache: dsc_cache = pickle.load(fcache) except Exception as e: - logger.error(str(e)) - logger.error("DscCache failed to open the cache file") + self.logger.error(str(e)) + self.logger.error("DscCache failed to open the cache file") else: if package in dsc_cache.keys(): dsc_file = dsc_cache[package].split(':')[0] @@ -50,11 +50,11 @@ class DscCache(): with open(self.cache_file, 'rb') as fcache: dsc_cache = pickle.load(fcache) except Exception as e: - logger.error(str(e)) - logger.error("DscCache failed to open the cache file") + self.logger.error(str(e)) + self.logger.error("DscCache failed to open the cache file") else: for pkg in dsc_cache.keys(): - if not pkg.endswith(package, len(package)): + if not pkg.endswith(package): continue match_item = dsc_cache[pkg] self.logger.debug("dscCache: Matched item %s" % match_item)