diff --git a/scripts/pkgdb_bulk_comaint/comaint.py b/scripts/pkgdb_bulk_comaint/comaint.py new file mode 100644 index 0000000..0746c98 --- /dev/null +++ b/scripts/pkgdb_bulk_comaint/comaint.py @@ -0,0 +1,785 @@ + + + + #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)
+
+ + + +
+ + + +
+ + + + + + + +