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 <luis.sampaio@windriver.com>
Change-Id: Id93a692f6a69212967453e42809e66595ae01f59
This commit is contained in:
Luis Sampaio 2022-12-16 13:12:03 -08:00
parent d158236274
commit 7b957158bb
1 changed files with 5 additions and 5 deletions

View File

@ -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)