mirror of
https://github.com/openSUSE/osc.git
synced 2025-02-04 02:26:16 +01:00
Merge pull request #856 from bmwiedemann/verifymd5
Use verifymd5 to determine freshness
This commit is contained in:
commit
29fb9a2dce
@ -1255,6 +1255,13 @@ class Package:
|
|||||||
self.in_conflict.remove(fname)
|
self.in_conflict.remove(fname)
|
||||||
self.write_conflictlist()
|
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):
|
def info(self):
|
||||||
source_url = makeurl(self.apiurl, ['source', self.prjname, self.name])
|
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)
|
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):
|
def update_needed(self, sinfo):
|
||||||
# this method might return a false-positive (that is a True is returned,
|
# this method might return a false-positive (that is a True is returned,
|
||||||
# even though no update is needed) (for details, see comments below)
|
# 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.islink():
|
||||||
if self.isexpanded():
|
if self.isexpanded():
|
||||||
# check if both revs point to the same expanded sources
|
# check if both revs point to the same expanded sources
|
||||||
|
Loading…
Reference in New Issue
Block a user