Skip to content

Commit

Permalink
Merge pull request #691 from nilxam/check_pre_ver
Browse files Browse the repository at this point in the history
Do not add the package exists in the previous version
  • Loading branch information
nilxam committed Feb 16, 2017
2 parents b3129e9 + f45fb1f commit 2236096
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions fcc_submitter.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
from osclib.memoize import memoize

OPENSUSE = 'openSUSE:Leap:42.3'
OPENSUSE_PREVERSION = 'openSUSE:Leap:42.2'
FCC = 'openSUSE:42:Factory-Candidates-Check'

makeurl = osc.core.makeurl
Expand All @@ -59,7 +60,7 @@ def list_packages(self, project):

return set(pkglist)

def check_one_source(self, flink, si, pkglist):
def check_one_source(self, flink, si, pkglist, pkglist_prever):
"""
Insert package information to the temporary frozenlinks.
Return package name if the package can not fit the condition
Expand All @@ -74,7 +75,7 @@ def check_one_source(self, flink, si, pkglist):

for linked in si.findall('linked'):
if linked.get('project') == self.factory:
if linked.get('package') in pkglist:
if linked.get('package') in pkglist or linked.get('package') in pkglist_prever:
return package
url = makeurl(self.apiurl, ['source', self.factory, package], {'view': 'info', 'nofilename': '1'})
# print(package, linked.get('package'), linked.get('project'))
Expand All @@ -86,7 +87,7 @@ def check_one_source(self, flink, si, pkglist):
ET.SubElement(flink, 'package', {'name': package, 'srcmd5': lsrcmd5, 'vrev': si.get('vrev')})
return None

if package in pkglist:
if package in pkglist or package in pkglist_prever:
return package

if package in ['rpmlint-mini-AGGR']:
Expand All @@ -99,13 +100,15 @@ def check_one_source(self, flink, si, pkglist):
def receive_sources(self, flink):
ignored_sources = []
pkglist = self.list_packages(OPENSUSE)
# we also don't want the package is exist in the previous version
pkglist_prever = self.list_packages(OPENSUSE_PREVERSION)

url = makeurl(self.apiurl, ['source', self.factory], {'view': 'info', 'nofilename': '1'})
f = http_GET(url)
root = ET.parse(f).getroot()

for si in root.findall('sourceinfo'):
package = self.check_one_source(flink, si, pkglist)
package = self.check_one_source(flink, si, pkglist, pkglist_prever)
if package is not None:
ignored_sources.append(str(package))
return ignored_sources
Expand Down

0 comments on commit 2236096

Please sign in to comment.