summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPierre-Yves Chibon <pingou@pingoured.fr>2017-08-16 14:38:14 +0200
committerPierre-Yves Chibon <pingou@pingoured.fr>2017-08-16 14:38:23 +0200
commit5fda2de1f691c9d7ec2edb8c74b509cb282141f5 (patch)
treed6e6d1465a96402375d918d268d7d406c49e7089
parent6c476f82e7989c807dad6b2a8644058e1256088a (diff)
downloadansible-5fda2de1f691c9d7ec2edb8c74b509cb282141f5.tar.gz
ansible-5fda2de1f691c9d7ec2edb8c74b509cb282141f5.tar.xz
ansible-5fda2de1f691c9d7ec2edb8c74b509cb282141f5.zip
More fixes to make the mass-branching script work (was done yesterday)
-rw-r--r--roles/distgit/templates/pkgdb_sync_git_branches.py22
1 files changed, 11 insertions, 11 deletions
diff --git a/roles/distgit/templates/pkgdb_sync_git_branches.py b/roles/distgit/templates/pkgdb_sync_git_branches.py
index 2f42604e3..d84a1b1ec 100644
--- a/roles/distgit/templates/pkgdb_sync_git_branches.py
+++ b/roles/distgit/templates/pkgdb_sync_git_branches.py
@@ -60,7 +60,7 @@ fedmsg.init(name='relay_inbound', cert_prefix='shell', **config)
GIT_FOLDER = '/srv/git/repositories/'
NEW_BRANCH = 'f27'
-MKBRANCH = '/usr/share/dist-git/mkbranch'
+MKBRANCH = '/usr/share/dist-git/mkbranch_branching'
SETUP_PACKAGE = '/usr/share/dist-git/setup_git_package'
THREADS = 20
@@ -132,7 +132,7 @@ def _create_branch(ns, pkgname, branch, existing_branches):
branch, os.path.join(ns, pkgname))
if not TEST_ONLY:
- _invoke(MKBRANCH, [branch, os.path.join(ns, pkgname)])
+ _invoke(MKBRANCH, [branch, pkgname])# os.path.join(ns, pkgname)])
fedmsg.publish(
topic='branch',
modname='git',
@@ -215,9 +215,9 @@ def main():
branches and fix inconsistencies.
"""
- for ns in ['rpms', 'modules', 'container']:
+ for ns in ['rpms']:#, 'modules', 'container']:
- local_pkgs = set(os.listdir(os.path.join(GIT_FOLDER, namespace)))
+ local_pkgs = set(os.listdir(os.path.join(GIT_FOLDER, ns)))
local_pkgs = set([it.replace('.git', '') for it in local_pkgs])
if VERBOSE:
print "Found %i local packages (namespace: %s)" % (
@@ -229,26 +229,26 @@ def main():
start = time.time()
if THREADS == 1:
git_branch_lookup = map(get_git_branch,
- itertools.product([namespace], sorted(local_pkgs)))
+ itertools.product([ns], sorted(local_pkgs)))
else:
threadpool = multiprocessing.pool.ThreadPool(processes=THREADS)
git_branch_lookup = threadpool.map(get_git_branch,
- itertools.product([namespace], sorted(local_pkgs)))
+ itertools.product([ns], sorted(local_pkgs)))
# Zip that list of results up into a lookup dict.
git_branch_lookup = dict(zip(sorted(local_pkgs), git_branch_lookup))
if VERBOSE:
- print "Found all local git branches in %0.2fs" % (time.time() - start)
+ print "Found all local git branches in %0.2fs" % (
+ time.time() - start)
tofix = set()
for pkg in sorted(local_pkgs):
git_branches = git_branch_lookup[pkg]
- diff = (git_branches - set([NEW_BRANCH]))
- if diff:
- print '%s missing: %s' % (pkg, ','.join(sorted(diff)))
+ if NEW_BRANCH not in git_branches:
+ print 'Add %s to : %s' % (NEW_BRANCH, pkg)
tofix.add(pkg)
- #branch_package(namespace, pkg, diff, git_branches)
+ branch_package(ns, pkg, [NEW_BRANCH], git_branches)
if tofix:
print 'Packages fixed (%s): %s' % (