1
0
mirror of https://github.com/openSUSE/osc.git synced 2025-01-24 22:06:14 +01:00

Merge pull request #856 from bmwiedemann/verifymd5

Use verifymd5 to determine freshness
This commit is contained in:
Daniel Mach 2022-04-07 10:48:58 +02:00 committed by GitHub
commit 29fb9a2dce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1255,6 +1255,13 @@ class Package:
self.in_conflict.remove(fname)
self.write_conflictlist()
def _compute_verifymd5(self):
md5str = ''
for f in self.filelist:
if f.name != '_link':
md5str += f.md5+' '+f.name+"\n"
return hashlib.md5(md5str.encode('utf-8')).hexdigest()
def info(self):
source_url = makeurl(self.apiurl, ['source', self.prjname, self.name])
r = info_templ % (self.prjname, self.name, self.absdir, self.apiurl, source_url, self.srcmd5, self.rev, self.linkinfo)
@ -2263,6 +2270,8 @@ rev: %s
def update_needed(self, sinfo):
# this method might return a false-positive (that is a True is returned,
# even though no update is needed) (for details, see comments below)
if sinfo.get('verifymd5') == self._compute_verifymd5():
return False
if self.islink():
if self.isexpanded():
# check if both revs point to the same expanded sources