mirror of
https://git.launchpad.net/ubuntu-dev-tools
synced 2025-05-20 21:31:35 +00:00
sponsor-patch: Add --workdir parameter to set the working directory.
This commit is contained in:
parent
3622e2f028
commit
7921cac14a
6
debian/changelog
vendored
6
debian/changelog
vendored
@ -1,7 +1,9 @@
|
|||||||
ubuntu-dev-tools (0.103) UNRELEASED; urgency=low
|
ubuntu-dev-tools (0.103) UNRELEASED; urgency=low
|
||||||
|
|
||||||
[ Benjamin Drung ]
|
[ Benjamin Drung ]
|
||||||
* sponsor-patch: Fix NameError: global name 'debdiff_filename' is not defined.
|
* sponsor-patch:
|
||||||
|
- Fix NameError: global name 'debdiff_filename' is not defined.
|
||||||
|
- Add --workdir parameter to set the working directory.
|
||||||
|
|
||||||
[ Luca Falavigna ]
|
[ Luca Falavigna ]
|
||||||
* debian/control:
|
* debian/control:
|
||||||
@ -27,7 +29,7 @@ ubuntu-dev-tools (0.103) UNRELEASED; urgency=low
|
|||||||
[ Stefano Rivera ]
|
[ Stefano Rivera ]
|
||||||
* Add manpages for sponsor-patch and import-bug-from-debian.
|
* Add manpages for sponsor-patch and import-bug-from-debian.
|
||||||
|
|
||||||
-- Siegfried-Angel Gevatter Pujals <rainct@ubuntu.com> Tue, 21 Sep 2010 20:43:27 +0200
|
-- Benjamin Drung <bdrung@ubuntu.com> Tue, 21 Sep 2010 23:52:46 +0200
|
||||||
|
|
||||||
ubuntu-dev-tools (0.102) experimental; urgency=low
|
ubuntu-dev-tools (0.102) experimental; urgency=low
|
||||||
|
|
||||||
|
@ -441,17 +441,24 @@ def apply_patch(task, patch):
|
|||||||
edit = True
|
edit = True
|
||||||
return edit
|
return edit
|
||||||
|
|
||||||
def main(script_name, bug_number, build, edit, keyid, upload, verbose=False):
|
def main(script_name, bug_number, build, edit, keyid, upload, workdir,
|
||||||
if "SPONSOR_PATCH_WORKDIR" in os.environ:
|
verbose=False):
|
||||||
# FIXME: add command line parameter
|
if not workdir:
|
||||||
workdir = os.path.abspath(os.environ["SPONSOR_PATCH_WORKDIR"])
|
if "SPONSOR_PATCH_WORKDIR" in os.environ:
|
||||||
if not os.path.isdir(workdir):
|
workdir = os.path.abspath(os.environ["SPONSOR_PATCH_WORKDIR"])
|
||||||
|
else:
|
||||||
|
workdir = os.getcwd()
|
||||||
|
workdir = os.path.expanduser(workdir)
|
||||||
|
if not os.path.isdir(workdir):
|
||||||
|
try:
|
||||||
os.makedirs(workdir)
|
os.makedirs(workdir)
|
||||||
# FIXME: Print nice error message on failure
|
except os.error, e:
|
||||||
|
Print.error("Failed to create the working directory %s " \
|
||||||
|
"[Errno %i]: %s." % (workdir, e.errno, e.strerror))
|
||||||
|
sys.exit(1)
|
||||||
|
if workdir != os.getcwd():
|
||||||
Print.command(["cd", workdir])
|
Print.command(["cd", workdir])
|
||||||
os.chdir(workdir)
|
os.chdir(workdir)
|
||||||
else:
|
|
||||||
workdir = os.getcwd()
|
|
||||||
|
|
||||||
script_name = os.path.basename(sys.argv[0])
|
script_name = os.path.basename(sys.argv[0])
|
||||||
launchpad = launchpadlib.launchpad.Launchpad.login_anonymously(script_name,
|
launchpad = launchpadlib.launchpad.Launchpad.login_anonymously(script_name,
|
||||||
@ -729,6 +736,8 @@ if __name__ == "__main__":
|
|||||||
help="Specify an upload destination (default none).")
|
help="Specify an upload destination (default none).")
|
||||||
parser.add_option("-v", "--verbose", help="print more information",
|
parser.add_option("-v", "--verbose", help="print more information",
|
||||||
dest="verbose", action="store_true", default=False)
|
dest="verbose", action="store_true", default=False)
|
||||||
|
parser.add_option("-w", "--workdir", dest="workdir", default=None,
|
||||||
|
help="Specify a working directory.")
|
||||||
|
|
||||||
(options, args) = parser.parse_args()
|
(options, args) = parser.parse_args()
|
||||||
Print.set_verbosity(options.verbose)
|
Print.set_verbosity(options.verbose)
|
||||||
@ -752,4 +761,4 @@ if __name__ == "__main__":
|
|||||||
options.upload = "ubuntu"
|
options.upload = "ubuntu"
|
||||||
|
|
||||||
main(script_name, bug_number, options.build, options.edit, options.keyid,
|
main(script_name, bug_number, options.build, options.edit, options.keyid,
|
||||||
options.upload, options.verbose)
|
options.upload, options.workdir, options.verbose)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user