- 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))
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"):
workdir = "/tmpfs/ack-sync"
else:
@ -69,7 +70,9 @@ def get_source(package, version, section, dist, uploader_name, uploader_email, b
cmd += ["-e", uploader_email]
if uploader_name is not None:
cmd += ["-n", uploader_name]
if key is not None:
if not upload:
cmd += ['-u',]
if upload and key is not None:
cmd += ["-k", key]
subprocess.check_call(cmd)
@ -238,7 +241,8 @@ def main(bug_numbers, all_package, all_version, all_section, update,
print "package:", package
print "version:", version
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
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 ]
* doc/syncpackage.1:
- 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

View File

@ -27,31 +27,34 @@ where possible.
\fB\-h\fR, \fB\-\-help\fR
Show help message and exit
.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.
.TP
\fB\-r\fR RELEASE, \fB\-\-release\fR=\fIRELEASE\fR
\fB\-r\fI RELEASE\fR, \fB\-\-release\fR=\fIRELEASE\fR
Specify target Ubuntu release.
.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.
.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.
.TP
\fB\-v\fR, \fB\-\-verbose\fR
print more information
.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
maintainer for this upload instead of evaluating
DEBFULLNAME and DEBEMAIL.
.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.
.TP
\fB\-b\fR BUG, \fB\-\-bug\fR=\fIBUG\fR
Mark a Launchpad bug as being fixed by this upload
\fB\-u\fR, \fB\-\-unsigned\fR
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
.SH AUTHOR
\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(dscname)
cmd = ["debsign", changes_file]
if not keyid is None:
cmd.insert(1, "-k" + keyid)
if verbose:
print_command(script_name, cmd)
subprocess.check_call(cmd)
if keyid is not False:
cmd = ["debsign", changes_file]
if not keyid is None:
cmd.insert(1, "-k" + keyid)
if verbose:
print_command(script_name, cmd)
subprocess.check_call(cmd)
else:
# Create fakesync changelog entry
new_ver = Version(new_ver.full_version + "fakesync1")
@ -413,6 +414,8 @@ if __name__ == "__main__":
default = os.environ["DEBEMAIL"])
parser.add_option("-k", "--key", dest="keyid",
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",
help="Mark a Launchpad bug as being fixed by this upload",
dest="bugs", action="append", default=list())