diff --git a/scripts/pkgdb_bulk_comaint/comaint.py b/scripts/pkgdb_bulk_comaint/comaint.py index 0746c98..e52fb4c 100644 --- a/scripts/pkgdb_bulk_comaint/comaint.py +++ b/scripts/pkgdb_bulk_comaint/comaint.py @@ -1,785 +1,22 @@ - - - - #2101: comaint.py - Fedora Infrastructure - Trac - - - - - - - - -
- - - - - - -
- - -

Ticket #2101: comaint.py

- - - - -
- File comaint.py, 0.8 kB - (added by toshio, 2 months ago) -

-Script to add comtainer to packages -

-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Line 
1#!/usr/bin/python -tt
2
3import sys
4import getpass
5
6from fedora.client import PackageDB
7
8if __name__ == '__main__':
9    print 'Username: ',
10    username = sys.stdin.readline().strip()
11    password = getpass.getpass('Password: ')
12
13    pkgdb = PackageDB(username=username, password=password)
14    collections = dict([(c[0]['id'], c[0]) for c in pkgdb.get_collection_list(eol=False)])
15    pkgs = pkgdb.user_packages('mmaslano', acls=['owner', 'approveacls']).pkgs
16
17    for pkg in (p for p in pkgs if p['name'].startswith('perl-')):
18        c_ids = (p['collectionid'] for p in pkg['listings'] if p['collectionid'] in collections)
19        branches = [collections[c]['branchname'] for c in c_ids]
20        pkgdb.edit_package(pkg['name'], comaintainers=['ppisar'], branches=branches)
21
22    sys.exit(0)
-
- - - -
- - - -
- - - - - - - + for pkg in (p for p in pkgs if p['name'].startswith('perl-')): + c_ids = (p['collectionid'] for p in pkg['listings'] if p['collectionid'] in collections) + branches = [collections[c]['branchname'] for c in c_ids] + pkgdb.edit_package(pkg['name'], comaintainers=['ppisar'], branches=branches) + sys.exit(0)