mirror of
https://git.launchpad.net/ubuntu-dev-tools
synced 2025-05-18 12:21:28 +00:00
revuput:
- arguments checking in separate function - -n argument to file a new bug - whitespace changes
This commit is contained in:
parent
7445cc9826
commit
3b5d8a0eda
66
revuput
66
revuput
@ -6,7 +6,7 @@
|
|||||||
#
|
#
|
||||||
#
|
#
|
||||||
# Notes:
|
# Notes:
|
||||||
# - needs dput, python-launchpad-bugs (>= 0.2.4)
|
# - needs dput, python-launchpad-bugs (>= 0.2.9)
|
||||||
# - needs http://launchpad.net/bugs/137767 to get fixed
|
# - needs http://launchpad.net/bugs/137767 to get fixed
|
||||||
#
|
#
|
||||||
|
|
||||||
@ -19,7 +19,7 @@ try:
|
|||||||
import launchpadbugs.connector as Connector
|
import launchpadbugs.connector as Connector
|
||||||
except:
|
except:
|
||||||
print >> sys.stderr, \
|
print >> sys.stderr, \
|
||||||
"You need python-launchpad-bugs (>= 0.2.4) installed to use revuput."
|
"You need python-launchpad-bugs (>= 0.2.9) installed to use revuput."
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
#try:
|
#try:
|
||||||
@ -29,7 +29,7 @@ except:
|
|||||||
# sys.exit(1)
|
# sys.exit(1)
|
||||||
|
|
||||||
|
|
||||||
USAGE = 'Usage: revuput <location> [<debuild options>]'
|
USAGE = 'Usage: revuput [-n] [<location>] [<debuild options>]'
|
||||||
|
|
||||||
|
|
||||||
def dput_check():
|
def dput_check():
|
||||||
@ -148,23 +148,55 @@ def deal_with_bugreport(bugnumbers, host, incoming, sourcepackage, version):
|
|||||||
bug.commit()
|
bug.commit()
|
||||||
|
|
||||||
|
|
||||||
|
def check_arguments(args):
|
||||||
|
new_bug = False
|
||||||
|
location = 'default'
|
||||||
|
debuild_args = list()
|
||||||
|
|
||||||
|
if len(sys.argv) == 1:
|
||||||
|
return (new_bug, location, debuild_args)
|
||||||
|
|
||||||
|
if sys.argv[1] == "-n":
|
||||||
|
new_bug = True
|
||||||
|
if len(sys.argv)>2:
|
||||||
|
if sys.argv[2].startswith("-"):
|
||||||
|
debuild_args = sys.argv[2:]
|
||||||
|
else:
|
||||||
|
location = sys.argv[2]
|
||||||
|
if len(sys.argv)>3:
|
||||||
|
debuild_args = sys.argv[3:]
|
||||||
|
else:
|
||||||
|
if sys.argv[1].startswith("-"):
|
||||||
|
debuild_args.append(sys.argv[1:])
|
||||||
|
else:
|
||||||
|
location = sys.argv[1]
|
||||||
|
if len(sys.argv)>2:
|
||||||
|
debuild_args = sys.argv[2:]
|
||||||
|
|
||||||
|
return (new_bug, location, debuild_args)
|
||||||
|
|
||||||
|
|
||||||
|
def file_bug(sourcepackage, version):
|
||||||
|
Bug = Connector.ConnectBug()
|
||||||
|
Bug.authentication = os.path.expanduser("~/.lpcookie")
|
||||||
|
|
||||||
|
bug = Bug.New(product={"name": sourcepackage, "target": "ubuntu"},
|
||||||
|
summary="Please sponsor %s %s" % (sourcepackage, version),
|
||||||
|
description=\
|
||||||
|
"The new package will be uploaded to PPA shortly.")
|
||||||
|
return bug.bugnumber
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
location = ""
|
(new_bug, location, debuild_args) = check_arguments(sys.argv)
|
||||||
options = []
|
|
||||||
|
|
||||||
if len(sys.argv)<2:
|
|
||||||
print >> sys.stderr, USAGE
|
|
||||||
sys.exit(1)
|
|
||||||
|
|
||||||
location = sys.argv[1]
|
|
||||||
if len(sys.argv) > 2:
|
|
||||||
options = sys.argv[2:]
|
|
||||||
|
|
||||||
if not call_debuild(options):
|
|
||||||
sys.exit(1)
|
|
||||||
|
|
||||||
(sourcepackage, version) = get_name_and_version()[0]
|
(sourcepackage, version) = get_name_and_version()[0]
|
||||||
|
|
||||||
|
if new_bug:
|
||||||
|
bugnumber = file_bug(sourcepackage, version)
|
||||||
|
os.system("dch -a 'Fixes (LP: #%s)'" % bugnumber)
|
||||||
|
if not call_debuild(debuild_args):
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
changesfile = "../%s_%s_source.changes" % (sourcepackage, version)
|
changesfile = "../%s_%s_source.changes" % (sourcepackage, version)
|
||||||
if not os.path.exists(os.path.expanduser(changesfile)):
|
if not os.path.exists(os.path.expanduser(changesfile)):
|
||||||
print >> sys.stderr, "%s does not exist." % \
|
print >> sys.stderr, "%s does not exist." % \
|
||||||
|
Loading…
x
Reference in New Issue
Block a user