#!/usr/bin/python2.7 # Rescore all builds in a PPA. # # Copyright (C) 2012 Canonical Ltd. # Author: Martin Pitt # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; version 3 of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . from __future__ import print_function from optparse import OptionParser from launchpadlib.launchpad import Launchpad parser = OptionParser(usage="usage: %prog ") parser.add_option( "-l", "--launchpad", dest="launchpad_instance", default="production") options, args = parser.parse_args() if len(args) != 2: parser.error("need both PPA owner and PPA name") owner, name = args launchpad = Launchpad.login_with( 'rescore-ppa-builds', options.launchpad_instance) ppa = launchpad.people[owner].getPPAByName(name=name) for build in ppa.getBuildRecords(build_state='Needs building'): if build.can_be_rescored: print('Rescoring %s' % build.title) build.rescore(score=5000)