mirror of
https://git.launchpad.net/ubuntu-dev-tools
synced 2025-05-12 01:11:29 +00:00
Fix encoding.
This commit is contained in:
parent
a8b6ad1d4f
commit
9e228e499b
109
ack-sync
Executable file → Normal file
109
ack-sync
Executable file → Normal file
@ -1,32 +1,32 @@
|
|||||||
#!/usr/bin/python
|
#!/usr/bin/python
|
||||||
#
|
#
|
||||||
# Copyright (C) 2007, Canonical Ltd.
|
# Copyright (C) 2007, Canonical Ltd.
|
||||||
# Copyright (C) 2010, Benjamin Drung <bdrung@ubuntu.com>
|
# Copyright (C) 2010, Benjamin Drung <bdrung@ubuntu.com>
|
||||||
#
|
#
|
||||||
# It was initial written by Daniel Holbach.
|
# It was initial written by Daniel Holbach.
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
# as published by the Free Software Foundation; version 3.
|
# as published by the Free Software Foundation; version 3.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# This program is distributed in the hope that it will be useful,
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
#
|
#
|
||||||
# See file /usr/share/common-licenses/GPL-3 for more details.
|
# See file /usr/share/common-licenses/GPL-3 for more details.
|
||||||
|
|
||||||
import getopt
|
import getopt
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
from ubuntutools.lp.libsupport import get_launchpad
|
from ubuntutools.lp.libsupport import get_launchpad
|
||||||
from ubuntutools.requestsync.common import raw_input_exit_on_ctrlc
|
from ubuntutools.requestsync.common import raw_input_exit_on_ctrlc
|
||||||
|
|
||||||
COMMAND_LINE_SYNTAX_ERROR = 1
|
COMMAND_LINE_SYNTAX_ERROR = 1
|
||||||
VERSION_DETECTION_FAILED = 2
|
VERSION_DETECTION_FAILED = 2
|
||||||
|
|
||||||
def get_version(title):
|
def get_version(title):
|
||||||
m = re.search("[() ][0-9][0-9a-zA-Z.:+-]*", title)
|
m = re.search("[() ][0-9][0-9a-zA-Z.:+-]*", title)
|
||||||
@ -69,12 +69,12 @@ def build_source(dsc_file):
|
|||||||
except subprocess.CalledProcessError:
|
except subprocess.CalledProcessError:
|
||||||
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 main(bug_number, package, version, update, verbose=False, silent=False):
|
def main(bug_number, package, version, update, verbose=False, silent=False):
|
||||||
launchpad = get_launchpad("ubuntu-dev-tools")
|
launchpad = get_launchpad("ubuntu-dev-tools")
|
||||||
|
|
||||||
bug = launchpad.bugs[bug_number]
|
bug = launchpad.bugs[bug_number]
|
||||||
|
|
||||||
task = list(bug.bug_tasks)[0]
|
task = list(bug.bug_tasks)[0]
|
||||||
|
|
||||||
if package is None:
|
if package is None:
|
||||||
@ -90,30 +90,30 @@ def main(bug_number, package, version, update, verbose=False, silent=False):
|
|||||||
subprocess.call(["sudo", "env", "DIST=lucid", "pbuilder", "update"])
|
subprocess.call(["sudo", "env", "DIST=lucid", "pbuilder", "update"])
|
||||||
|
|
||||||
build_source(dsc_file)
|
build_source(dsc_file)
|
||||||
|
|
||||||
print bug.title
|
print bug.title
|
||||||
print task.assignee
|
print task.assignee
|
||||||
print task.status
|
print task.status
|
||||||
raw_input_exit_on_ctrlc('Press [Enter] to continue or [Ctrl-C] to abort. ')
|
raw_input_exit_on_ctrlc('Press [Enter] to continue or [Ctrl-C] to abort. ')
|
||||||
|
|
||||||
people = launchpad.people
|
people = launchpad.people
|
||||||
uus = people['ubuntu-universe-sponsors']
|
uus = people['ubuntu-universe-sponsors']
|
||||||
bug.unsubscribe(person=uus)
|
bug.unsubscribe(person=uus)
|
||||||
print "uus unsubscribed"
|
print "uus unsubscribed"
|
||||||
task.transitionToAssignee(assignee=None)
|
task.transitionToAssignee(assignee=None)
|
||||||
print "unassigned me"
|
print "unassigned me"
|
||||||
task.transitionToStatus (status="Confirmed")
|
task.transitionToStatus (status="Confirmed")
|
||||||
print "status set to Confirmed"
|
print "status set to Confirmed"
|
||||||
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")
|
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)
|
||||||
print "Archive admin subscribed"
|
print "Archive admin subscribed"
|
||||||
bug.subscribe(person=launchpad.me)
|
bug.subscribe(person=launchpad.me)
|
||||||
print "subscribed me"
|
print "subscribed me"
|
||||||
|
|
||||||
def usage():
|
def usage():
|
||||||
print """ack-sync <bug numbers>
|
print """ack-sync <bug numbers>
|
||||||
@ -124,8 +124,8 @@ def usage():
|
|||||||
-u, --update updates pbuilder before building
|
-u, --update updates pbuilder before building
|
||||||
-v, --verbose be more verbosive
|
-v, --verbose be more verbosive
|
||||||
-V, --version=<version> set the version"""
|
-V, --version=<version> set the version"""
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
try:
|
try:
|
||||||
long_opts = ["help", "package", "silent", "update", "verbose", "version"]
|
long_opts = ["help", "package", "silent", "update", "verbose", "version"]
|
||||||
opts, args = getopt.gnu_getopt(sys.argv[1:], "hp:suvV:", long_opts)
|
opts, args = getopt.gnu_getopt(sys.argv[1:], "hp:suvV:", long_opts)
|
||||||
@ -142,7 +142,7 @@ if __name__ == '__main__':
|
|||||||
|
|
||||||
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 ("-p", "--package"):
|
elif o in ("-p", "--package"):
|
||||||
package = a
|
package = a
|
||||||
@ -162,10 +162,11 @@ if __name__ == '__main__':
|
|||||||
print >> sys.stderr, "E: You must specify bug number."
|
print >> sys.stderr, "E: You must specify bug number."
|
||||||
sys.exit(COMMAND_LINE_SYNTAX_ERROR)
|
sys.exit(COMMAND_LINE_SYNTAX_ERROR)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
bug_number = int(args[0])
|
bug_number = int(args[0])
|
||||||
except:
|
except:
|
||||||
if not silent:
|
if not silent:
|
||||||
print >> sys.stderr, "E: '%s' is not a valid bug number." % args[0]
|
print >> sys.stderr, "E: '%s' is not a valid bug number." % args[0]
|
||||||
sys.exit(COMMAND_LINE_SYNTAX_ERROR)
|
sys.exit(COMMAND_LINE_SYNTAX_ERROR)
|
||||||
main(bug_number, package, version, update, verbose, silent)
|
main(bug_number, package, version, update, verbose, silent)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user