diff options
author | Pawel Hajdan, Jr <phajdan.jr@gentoo.org> | 2012-05-30 16:34:40 +0200 |
---|---|---|
committer | Pawel Hajdan, Jr <phajdan.jr@gentoo.org> | 2012-05-30 16:34:40 +0200 |
commit | 520c9782541d2e3fa509b1a2d470889a6d26bef7 (patch) | |
tree | 61ee7afa1b00bdc49d59e65a500ff5229f68b0c7 /stabilization-candidates.py | |
parent | Process stabilization candidates incrementally, (diff) | |
download | arch-tools-520c9782541d2e3fa509b1a2d470889a6d26bef7.tar.gz arch-tools-520c9782541d2e3fa509b1a2d470889a6d26bef7.tar.bz2 arch-tools-520c9782541d2e3fa509b1a2d470889a6d26bef7.zip |
Make bugzilla-viewer and maintainer-timeout work
by bundling old pybugz.
Diffstat (limited to 'stabilization-candidates.py')
-rwxr-xr-x | stabilization-candidates.py | 35 |
1 files changed, 21 insertions, 14 deletions
diff --git a/stabilization-candidates.py b/stabilization-candidates.py index 04b6dee..7989a84 100755 --- a/stabilization-candidates.py +++ b/stabilization-candidates.py @@ -51,7 +51,7 @@ if __name__ == "__main__": best_stable = portage.versions.best(portage.portdb.match(cp)) if not best_stable: continue - print 'Working on %s...' % cp + print 'Working on %s...' % cp, candidates = [] for cpv in portage.portdb.cp_list(cp): # Only consider higher versions than best stable. @@ -79,6 +79,7 @@ if __name__ == "__main__": candidates.append(cpv) if not candidates: + print 'no candidates' continue candidates.sort(key=portage.versions.cpv_sort_key()) @@ -94,9 +95,11 @@ if __name__ == "__main__": regex = '\*%s \((.*)\)' % re.escape(pv) match = re.search(regex, changelog_file.read()) if not match: + print 'error parsing ChangeLog' continue changelog_date = datetime.datetime.strptime(match.group(1), '%d %b %Y') if now - changelog_date < datetime.timedelta(days=options.days): + print 'not old enough' continue keywords = portage.db["/"]["porttree"].dbapi.aux_get(best_candidate, ['KEYWORDS'])[0] @@ -106,6 +109,22 @@ if __name__ == "__main__": missing_arch = True break if missing_arch: + print 'not keyworded ~arch' + continue + + # Do not risk trying to stabilize a package with known bugs. + params = {} + params['summary'] = [cp]; + bugs = bugzilla.Bug.search(params) + if len(bugs['bugs']): + print 'has bugs' + continue + + # Protection against filing a stabilization bug twice. + params['summary'] = [best_candidate] + bugs = bugzilla.Bug.search(params) + if len(bugs['bugs']): + print 'version has closed bugs' continue cvs_path = os.path.join(options.repo, cp) @@ -124,6 +143,7 @@ if __name__ == "__main__": subprocess.check_output(["repoman", "manifest"], cwd=cvs_path) subprocess.check_output(["repoman", "full"], cwd=cvs_path) except subprocess.CalledProcessError: + print 'repoman error' continue finally: f = open(ebuild_path, "w") @@ -133,19 +153,6 @@ if __name__ == "__main__": f.write(manifest_contents) f.close() - # Do not risk trying to stabilize a package with known bugs. - params = {} - params['summary'] = [cp]; - bugs = bugzilla.Bug.search(params) - if len(bugs['bugs']): - continue - - # Protection against filing a stabilization bug twice. - params['summary'] = [best_candidate] - bugs = bugzilla.Bug.search(params) - if len(bugs['bugs']): - continue - metadata = MetaDataXML(os.path.join(cvs_path, 'metadata.xml'), '/usr/portage/metadata/herds.xml') maintainer_split = metadata.format_maintainer_string().split(' ', 1) maintainer = maintainer_split[0] |