mirror of
https://git.launchpad.net/ubuntu-dev-tools
synced 2025-05-27 16:51:28 +00:00
piuparts support:
- added test_install function - adde -S and --with_piuparts to run piuparts test after compilation - added -l and --lvm parameter to pass the lvm partition to use for piuparts
This commit is contained in:
parent
8a0396377b
commit
99afb52d19
36
ack-sync
36
ack-sync
@ -79,6 +79,24 @@ def build_source(dsc_file):
|
|||||||
print >> sys.stderr, "E: %s failed to build." % (dsc_file)
|
print >> sys.stderr, "E: %s failed to build." % (dsc_file)
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
|
def test_install(dsc_file):
|
||||||
|
# TODO: add piuparts pbuilder support
|
||||||
|
changes_file=os.path.splitext(dsc_file)[0]+"_i386.changes"
|
||||||
|
|
||||||
|
if not (os.path.isfile(changes_file)): # if the _i386.changes file doe not exists, try with amd64
|
||||||
|
changes_file=os.path.splitext(dsc_file)[0]+"_amd64.changes"
|
||||||
|
|
||||||
|
if not (os.path.isfile(changes_file)): # if no file exists at all => exit
|
||||||
|
print >> sys.stderr, "E: No .changes file has been generated."
|
||||||
|
sys.exit(1)
|
||||||
|
if sbuild:
|
||||||
|
try:
|
||||||
|
subprocess.check_call(LogCall(["sudo", "piuparts", "--lvm-volume="+lvm, "-N", "-W", "--single-changes-list", "--log-level=info", "--ignore=/var/log/apt/history.log", "--mirror=http://archive.ubuntu.com/ubuntu main universe restricted multiverse", changes_file]))
|
||||||
|
except subprocess.CalledProcessError:
|
||||||
|
print >> sys.stderr, "E: %s failed to install. Please check log" % (changes_file)
|
||||||
|
else:
|
||||||
|
print >> sys.stderr, "W: piuparts only work with sbuild ATM"
|
||||||
|
|
||||||
def main(bug_number, package, version, section, update, verbose=False, silent=False):
|
def main(bug_number, package, version, section, update, verbose=False, silent=False):
|
||||||
launchpad = get_launchpad("ubuntu-dev-tools")
|
launchpad = get_launchpad("ubuntu-dev-tools")
|
||||||
|
|
||||||
@ -103,6 +121,9 @@ def main(bug_number, package, version, section, update, verbose=False, silent=Fa
|
|||||||
|
|
||||||
build_source(dsc_file)
|
build_source(dsc_file)
|
||||||
|
|
||||||
|
if piuparts:
|
||||||
|
test_install(dsc_file)
|
||||||
|
|
||||||
print bug.title
|
print bug.title
|
||||||
print task.assignee
|
print task.assignee
|
||||||
print task.status
|
print task.status
|
||||||
@ -119,7 +140,10 @@ def main(bug_number, package, version, section, update, verbose=False, silent=Fa
|
|||||||
if task.importance == "Undecided":
|
if task.importance == "Undecided":
|
||||||
task.transitionToImportance(importance="Wishlist")
|
task.transitionToImportance(importance="Wishlist")
|
||||||
print "importance set to Wishlist"
|
print "importance set to Wishlist"
|
||||||
bug.newMessage(content="package builds, sync request ACK'd")
|
if piuparts:
|
||||||
|
bug.newMessage(content="package builds and installs, sync request ACK'd")
|
||||||
|
else:
|
||||||
|
bug.newMessage(content="package builds, sync request ACK'd")
|
||||||
print "Ack comment added"
|
print "Ack comment added"
|
||||||
aa = people['ubuntu-archive']
|
aa = people['ubuntu-archive']
|
||||||
bug.subscribe(person=aa)
|
bug.subscribe(person=aa)
|
||||||
@ -131,7 +155,9 @@ def usage():
|
|||||||
print """ack-sync <bug numbers>
|
print """ack-sync <bug numbers>
|
||||||
|
|
||||||
-h, --help displays this help
|
-h, --help displays this help
|
||||||
|
-l, --lvm lvm partition to use for sbuild and piuparts
|
||||||
-p, --package=<package> set the package
|
-p, --package=<package> set the package
|
||||||
|
-P, --with_piuparts use piuparts to check the instalability of the package
|
||||||
--section=<section> Debian section (one of main, contrib, non-free)
|
--section=<section> Debian section (one of main, contrib, non-free)
|
||||||
-s, --silent be more silent
|
-s, --silent be more silent
|
||||||
-S, --with_sbuild use sbuild instead of pbuilder
|
-S, --with_sbuild use sbuild instead of pbuilder
|
||||||
@ -142,7 +168,7 @@ def usage():
|
|||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
try:
|
try:
|
||||||
long_opts = ["help", "package=", "section=", "silent", "update",
|
long_opts = ["help", "package=", "section=", "silent", "update",
|
||||||
"verbose", "version=", "with_sbuild"]
|
"verbose", "version=", "with_sbuild", "with_piuparts", "lvm"]
|
||||||
opts, args = getopt.gnu_getopt(sys.argv[1:], "hp:sSuvV:", long_opts)
|
opts, args = getopt.gnu_getopt(sys.argv[1:], "hp:sSuvV:", long_opts)
|
||||||
except getopt.GetoptError, e:
|
except getopt.GetoptError, e:
|
||||||
# print help information and exit:
|
# print help information and exit:
|
||||||
@ -156,13 +182,19 @@ if __name__ == '__main__':
|
|||||||
update = False
|
update = False
|
||||||
verbose = False
|
verbose = False
|
||||||
version = None
|
version = None
|
||||||
|
piuparts = False
|
||||||
|
lvm = None
|
||||||
|
|
||||||
for o, a in opts:
|
for o, a in opts:
|
||||||
if o in ("-h", "--help"):
|
if o in ("-h", "--help"):
|
||||||
usage()
|
usage()
|
||||||
sys.exit()
|
sys.exit()
|
||||||
|
elif o in ("-l", "--lvm"):
|
||||||
|
lvm = a
|
||||||
elif o in ("-p", "--package"):
|
elif o in ("-p", "--package"):
|
||||||
package = a
|
package = a
|
||||||
|
elif o in ("-P", "--with_piuparts"):
|
||||||
|
piuparts = True
|
||||||
elif o in ("--section"):
|
elif o in ("--section"):
|
||||||
section = a
|
section = a
|
||||||
elif o in ("-s", "--silent"):
|
elif o in ("-s", "--silent"):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user