stagingapi: Add list_packages method
* Lists all the packages in a project and use the new API call in check_pkgs
This commit is contained in:
parent
46aceb4301
commit
5c8aa3944f
@ -1145,20 +1145,20 @@ class StagingAPI(object):
|
|||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def check_pkgs(self, rebuild_list):
|
def list_packages(self, project):
|
||||||
url = self.makeurl(['source', self.project])
|
url = self.makeurl(['source', project])
|
||||||
pkglist = []
|
pkglist = []
|
||||||
|
|
||||||
root = ET.parse(http_GET(url)).getroot()
|
root = ET.parse(http_GET(url)).getroot()
|
||||||
|
|
||||||
xmllines = root.findall("./entry")
|
xmllines = root.findall("./entry")
|
||||||
|
|
||||||
for pkg in xmllines:
|
for pkg in xmllines:
|
||||||
if pkg.attrib['name'] in rebuild_list:
|
pkglist.append(pkg.attrib['name'])
|
||||||
pkglist.append(pkg.attrib['name'])
|
|
||||||
|
|
||||||
return pkglist
|
return pkglist
|
||||||
|
|
||||||
|
def check_pkgs(self, rebuild_list):
|
||||||
|
return list(set(rebuild_list) & set(self.list_packages(self.project)))
|
||||||
|
|
||||||
def rebuild_pkg(self, package, prj, arch, code=None):
|
def rebuild_pkg(self, package, prj, arch, code=None):
|
||||||
query = {
|
query = {
|
||||||
'cmd': 'rebuild',
|
'cmd': 'rebuild',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user