- Correct and neaten options.

* syncpackage:
   - Add -u parameter, to disable signing.
This commit is contained in:
Stefano Rivera 2010-10-26 12:33:38 +02:00
parent 19399b71c9
commit cf6c2356b1
4 changed files with 31 additions and 18 deletions

View File

@ -53,7 +53,8 @@ def LogCall(command):
logging.info("Running %s", " ".join(command)) logging.info("Running %s", " ".join(command))
return command return command
def get_source(package, version, section, dist, uploader_name, uploader_email, bug, key): def get_source(package, version, section, dist, uploader_name, uploader_email,
bug, key, upload):
if os.path.isdir("/tmpfs"): if os.path.isdir("/tmpfs"):
workdir = "/tmpfs/ack-sync" workdir = "/tmpfs/ack-sync"
else: else:
@ -69,7 +70,9 @@ def get_source(package, version, section, dist, uploader_name, uploader_email, b
cmd += ["-e", uploader_email] cmd += ["-e", uploader_email]
if uploader_name is not None: if uploader_name is not None:
cmd += ["-n", uploader_name] cmd += ["-n", uploader_name]
if key is not None: if not upload:
cmd += ['-u',]
if upload and key is not None:
cmd += ["-k", key] cmd += ["-k", key]
subprocess.check_call(cmd) subprocess.check_call(cmd)
@ -238,7 +241,8 @@ def main(bug_numbers, all_package, all_version, all_section, update,
print "package:", package print "package:", package
print "version:", version print "version:", version
dsc_file = get_source(package, version, all_section, dist, dsc_file = get_source(package, version, all_section, dist,
uploader_name, uploader_email, bug_number, key) uploader_name, uploader_email, bug_number, key,
upload)
# extract source # extract source
subprocess.check_call(["dpkg-source", "-x", dsc_file]) subprocess.check_call(["dpkg-source", "-x", dsc_file])

5
debian/changelog vendored
View File

@ -18,8 +18,11 @@ ubuntu-dev-tools (0.105) UNRELEASED; urgency=low
[ Stefano Rivera ] [ Stefano Rivera ]
* doc/syncpackage.1: * doc/syncpackage.1:
- Add a warning that the use of syncpackage is discouraged. - Add a warning that the use of syncpackage is discouraged.
- Correct and neaten options.
* syncpackage:
- Add -u parameter, to disable signing.
-- Stefano Rivera <stefanor@ubuntu.com> Fri, 22 Oct 2010 17:23:58 +0200 -- Stefano Rivera <stefanor@ubuntu.com> Tue, 26 Oct 2010 12:31:55 +0200
ubuntu-dev-tools (0.104) experimental; urgency=low ubuntu-dev-tools (0.104) experimental; urgency=low

View File

@ -27,31 +27,34 @@ where possible.
\fB\-h\fR, \fB\-\-help\fR \fB\-h\fR, \fB\-\-help\fR
Show help message and exit Show help message and exit
.TP .TP
\fB\-d\fR DIST, \fB\-\-distribution\fR=\fIDIST\fR \fB\-d\fI DIST\fR, \fB\-\-distribution\fR=\fIDIST\fR
Debian distribution to sync from. Debian distribution to sync from.
.TP .TP
\fB\-r\fR RELEASE, \fB\-\-release\fR=\fIRELEASE\fR \fB\-r\fI RELEASE\fR, \fB\-\-release\fR=\fIRELEASE\fR
Specify target Ubuntu release. Specify target Ubuntu release.
.TP .TP
\fB\-V\fR DEBVERSION, \fB\-\-debian\-version\fR=\fIDEBVERSION\fR \fB\-V\fI DEBVERSION\fR, \fB\-\-debian\-version\fR=\fIDEBVERSION\fR
Specify the version to sync from. Specify the version to sync from.
.TP .TP
\fB\-c\fR COMPONENT, \fB\-\-component\fR=\fICOMPONENT\fR \fB\-c\fI COMPONENT\fR, \fB\-\-component\fR=\fICOMPONENT\fR
Specify the component to sync from. Specify the component to sync from.
.TP .TP
\fB\-v\fR, \fB\-\-verbose\fR \fB\-v\fR, \fB\-\-verbose\fR
print more information print more information
.TP .TP
\fB\-u\fR UPLOADER, \fB\-\-uploader\fR=\fIUPLOADER\fR \fB\-n\fI UPLOADER\fR, \fB\-\-uploader\fR=\fIUPLOADER\fR
Use UPLOADER as the name and email address of the Use UPLOADER as the name and email address of the
maintainer for this upload instead of evaluating maintainer for this upload instead of evaluating
DEBFULLNAME and DEBEMAIL. DEBFULLNAME and DEBEMAIL.
.TP .TP
\fB\-k\fR KEYID, \fB\-\-key\fR=\fIKEYID\fR \fB\-k\fI KEYID\fR, \fB\-\-key\fR=\fIKEYID\fR
Specify the key ID to be used for signing. Specify the key ID to be used for signing.
.TP .TP
\fB\-b\fR BUG, \fB\-\-bug\fR=\fIBUG\fR \fB\-u\fR, \fB\-\-unsigned\fR
Mark a Launchpad bug as being fixed by this upload Do not sign the upload.
.TP
\fB\-b\fI BUG\fR, \fB\-\-bug\fR=\fIBUG\fR
Mark a Launchpad bug as being fixed by this upload.
.PP .PP
.SH AUTHOR .SH AUTHOR
\fBsyncpackage\fR was written by Martin Pitt <martin.pitt@canonical.com> and Benjamin Drung <bdrung@ubuntu.com>. \fBsyncpackage\fR was written by Martin Pitt <martin.pitt@canonical.com> and Benjamin Drung <bdrung@ubuntu.com>.

View File

@ -315,12 +315,13 @@ def sync_dsc(script_name, dscurl, debian_dist, release, name, email, bugs, keyid
# remove signature and sign package # remove signature and sign package
remove_signature(dscname) remove_signature(dscname)
cmd = ["debsign", changes_file] if keyid is not False:
if not keyid is None: cmd = ["debsign", changes_file]
cmd.insert(1, "-k" + keyid) if not keyid is None:
if verbose: cmd.insert(1, "-k" + keyid)
print_command(script_name, cmd) if verbose:
subprocess.check_call(cmd) print_command(script_name, cmd)
subprocess.check_call(cmd)
else: else:
# Create fakesync changelog entry # Create fakesync changelog entry
new_ver = Version(new_ver.full_version + "fakesync1") new_ver = Version(new_ver.full_version + "fakesync1")
@ -413,6 +414,8 @@ if __name__ == "__main__":
default = os.environ["DEBEMAIL"]) default = os.environ["DEBEMAIL"])
parser.add_option("-k", "--key", dest="keyid", parser.add_option("-k", "--key", dest="keyid",
help="Specify the key ID to be used for signing.", default=None) help="Specify the key ID to be used for signing.", default=None)
parser.add_option('-u', '--unsigned', dest='keyid', action='store_false',
help='Do not sign the upload')
parser.add_option("-b", "--bug", metavar="BUG", parser.add_option("-b", "--bug", metavar="BUG",
help="Mark a Launchpad bug as being fixed by this upload", help="Mark a Launchpad bug as being fixed by this upload",
dest="bugs", action="append", default=list()) dest="bugs", action="append", default=list())