update owner-sync-pkgdb to sync fedora teh same as epel
Signed-off-by: Dennis Gilmore <ausil@fedoraproject.org>
This commit is contained in:
parent
b05439b995
commit
44cbf8450f
1 changed files with 42 additions and 59 deletions
|
@ -27,10 +27,7 @@ if not BASEURL.endswith('/'):
|
||||||
# Why do we have this? Seems insecure....
|
# Why do we have this? Seems insecure....
|
||||||
sys.path.append('.')
|
sys.path.append('.')
|
||||||
|
|
||||||
try:
|
import koji
|
||||||
import koji
|
|
||||||
except:
|
|
||||||
import brew as koji
|
|
||||||
|
|
||||||
extraArchList = {'kernel': ('i586', 'i686', 'noarch'),
|
extraArchList = {'kernel': ('i586', 'i686', 'noarch'),
|
||||||
'kernel-xen-2.6': ('i586', 'i686', 'noarch'),
|
'kernel-xen-2.6': ('i586', 'i686', 'noarch'),
|
||||||
|
@ -82,70 +79,56 @@ if __name__ == '__main__':
|
||||||
print "ERROR: no tag specified!\n"
|
print "ERROR: no tag specified!\n"
|
||||||
usage()
|
usage()
|
||||||
|
|
||||||
if tag.endswith('epel') or tag.startswith('epel'):
|
if tag.startswith('epel'):
|
||||||
if tag.startswith('epel'):
|
version = tag.split('epel')[1]
|
||||||
version = tag.split('epel')[1]
|
else:
|
||||||
else:
|
version = tag.split('-')[1][:-1]
|
||||||
version = tag.split('-')[1][:-1]
|
|
||||||
|
|
||||||
data = requests.get(urljoin(BASEURL, 'api/collections'), verify=VERIFY).json()
|
data = requests.get(urljoin(BASEURL, 'api/collections'), verify=VERIFY).json()
|
||||||
branch_names = set()
|
branch_names = set()
|
||||||
for collection in (c for c in data['collections'] if c['status'] != 'EOL'):
|
for collection in (c for c in data['collections'] if c['status'] != 'EOL'):
|
||||||
### TODO: check with pingou that this is now returning the same
|
### TODO: check with pingou that this is now returning the same
|
||||||
# format as the collection names in api/vcs
|
# format as the collection names in api/vcs
|
||||||
# By moving the data from gitbranchname into branchname, I think
|
# By moving the data from gitbranchname into branchname, I think
|
||||||
# that the data will now match
|
# that the data will now match
|
||||||
branch_names.add(collection['branchname'])
|
branch_names.add(collection['branchname'])
|
||||||
|
|
||||||
if tag.startswith('epel'):
|
if tag.startswith('epel'):
|
||||||
# Ex: epel7 => epel7
|
# Ex: epel7 => epel7
|
||||||
reponame = tag
|
reponame = tag
|
||||||
else:
|
arches = ["primary"]
|
||||||
# Ex: dist-6E-epel => el6
|
elif tag.endswith('epel'):
|
||||||
reponame = 'el%s' % version
|
# Ex: dist-6E-epel => el6
|
||||||
if reponame not in branch_names:
|
reponame = 'el%s' % version
|
||||||
print 'tag %s => repo %s: does not seem to be a non-EOL branch' % (tag, reponame)
|
|
||||||
sys.exit(1)
|
|
||||||
|
|
||||||
# EPEL needs a separate entry in koji for each epel version
|
|
||||||
|
|
||||||
data = requests.get(urljoin(BASEURL, 'api/vcs?format=json'), verify=VERIFY).json()
|
|
||||||
acls = data['rpms']
|
|
||||||
pkgs = {}
|
|
||||||
for pkg_name in acls:
|
|
||||||
try:
|
|
||||||
owners = acls[pkg_name][reponame]
|
|
||||||
except KeyError:
|
|
||||||
# Package is not branched for this release
|
|
||||||
continue
|
|
||||||
if len(owners['commit']['people']):
|
|
||||||
# Arbitrarily take the first committer listed as the owner in
|
|
||||||
# koji
|
|
||||||
pkgs[pkg_name] = owners['commit']['people'][0]
|
|
||||||
else:
|
|
||||||
pkgs[pkg_name] = 'orphan'
|
|
||||||
pkgList = pkgs.keys()
|
|
||||||
BuildEPEL = True
|
|
||||||
arches = ["primary"]
|
arches = ["primary"]
|
||||||
else:
|
else:
|
||||||
# Fedora only needs one entry per package for all Fedora releases
|
# Fedora
|
||||||
# Use the owner from bugzilla for simplicity
|
reponame = tag
|
||||||
data = requests.get(urljoin(BASEURL, 'api/bugzilla?format=json'), verify=VERIFY).json()
|
|
||||||
acls = data['bugzillaAcls']
|
|
||||||
pkgList = acls['Fedora'].keys()
|
|
||||||
pkgs = {}
|
|
||||||
for pkg in acls['Fedora']:
|
|
||||||
owner = acls['Fedora'][pkg]['owner']
|
|
||||||
owner = owner.replace('group::', '').replace('@', '')
|
|
||||||
pkgs[pkg] = owner
|
|
||||||
|
|
||||||
#pkgs = dict(((p, acls['Fedora'][p]['owner']) for p in acls['Fedora']))
|
|
||||||
BuildEPEL = False
|
|
||||||
{% if env == 'staging' %}
|
{% if env == 'staging' %}
|
||||||
arches = ["primary"]
|
arches = ["primary"]
|
||||||
{% else %}
|
{% else %}
|
||||||
arches = ["primary", "arm", "ppc", "s390"]
|
arches = ["primary", "arm", "ppc", "s390"]
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
if reponame not in branch_names:
|
||||||
|
print 'tag %s => repo %s: does not seem to be a non-EOL branch' % (tag, reponame)
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
|
data = requests.get(urljoin(BASEURL, 'api/vcs?format=json'), verify=VERIFY).json()
|
||||||
|
acls = data['rpms']
|
||||||
|
pkgs = {}
|
||||||
|
for pkg_name in acls:
|
||||||
|
try:
|
||||||
|
owners = acls[pkg_name][reponame]
|
||||||
|
except KeyError:
|
||||||
|
# Package is not branched for this release
|
||||||
|
continue
|
||||||
|
if len(owners['commit']['people']):
|
||||||
|
# Arbitrarily take the first committer listed as the owner in
|
||||||
|
# koji
|
||||||
|
pkgs[pkg_name] = owners['commit']['people'][0]
|
||||||
|
else:
|
||||||
|
pkgs[pkg_name] = 'orphan'
|
||||||
|
pkgList = pkgs.keys()
|
||||||
pkgList.sort()
|
pkgList.sort()
|
||||||
|
|
||||||
options = get_options()
|
options = get_options()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue