mirror of
https://git.launchpad.net/ubuntu-dev-tools
synced 2025-03-13 08:01:09 +00:00
* doc/lp-project-upload.1, lp-project-upload:
- add support for optionally specifying files containing the changelog and release notes for the release - allows scripts to avoid the interactive editors - document these changes in the manpage
This commit is contained in:
parent
6aee8410eb
commit
4349bcad39
7
debian/changelog
vendored
7
debian/changelog
vendored
@ -9,6 +9,13 @@ ubuntu-dev-tools (0.125) UNRELEASED; urgency=low
|
|||||||
* ubuntutools.archive: Display any errors rmadison emits, rather than
|
* ubuntutools.archive: Display any errors rmadison emits, rather than
|
||||||
guessing at the cause. (LP: #788447)
|
guessing at the cause. (LP: #788447)
|
||||||
|
|
||||||
|
[ Dustin Kirkland ]
|
||||||
|
* doc/lp-project-upload.1, lp-project-upload:
|
||||||
|
- add support for optionally specifying files containing the changelog
|
||||||
|
and release notes for the release
|
||||||
|
- allows scripts to avoid the interactive editors
|
||||||
|
- document these changes in the manpage
|
||||||
|
|
||||||
-- Benjamin Drung <bdrung@debian.org> Sat, 28 May 2011 19:43:10 +0200
|
-- Benjamin Drung <bdrung@debian.org> Sat, 28 May 2011 19:43:10 +0200
|
||||||
|
|
||||||
ubuntu-dev-tools (0.124) unstable; urgency=low
|
ubuntu-dev-tools (0.124) unstable; urgency=low
|
||||||
|
@ -4,7 +4,7 @@ lp\-project\-upload \- Upload a release tarball to a Launchpad project.
|
|||||||
|
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
.B lp\-project\-upload
|
.B lp\-project\-upload
|
||||||
.I project-name version tarball [new milestone]
|
.I <project name> <version> <tarball> [new milestone] [changelog file] [releasenotes file]
|
||||||
|
|
||||||
.SH DESCRIPTION
|
.SH DESCRIPTION
|
||||||
\fBlp\-project\-upload\fR uploads a tarball release of a project to Launchpad.
|
\fBlp\-project\-upload\fR uploads a tarball release of a project to Launchpad.
|
||||||
@ -13,8 +13,12 @@ It can create milestones and releases on the fly after confirmation.
|
|||||||
If there is a file \fItarball\fB.asc\fR, it is uploaded as the signature of the
|
If there is a file \fItarball\fB.asc\fR, it is uploaded as the signature of the
|
||||||
tarball.
|
tarball.
|
||||||
|
|
||||||
|
You can optionally provide the name of the next milestone, which will be created if specified.
|
||||||
|
|
||||||
|
You can optionally provide filename(s) specifying the changelog and release notes entries for this release. Note that these might be /dev/null, if you do not want to provide changelog or release notes information. If these are not specified, an interactive editor will allow you to compose these.
|
||||||
|
|
||||||
.SH AUTHORS
|
.SH AUTHORS
|
||||||
\fBlp\-project\-upload\fR was written by Martin Pitt <martin.pitt@ubuntu.com>.
|
\fBlp\-project\-upload\fR was written by Martin Pitt <martin.pitt@ubuntu.com> and enhanced by Dustin Kirkland <kirkland@ubuntu.com>.
|
||||||
.PP
|
.PP
|
||||||
It is released under the terms of the GNU General Public License, version 2
|
It is released under the terms of the GNU General Public License, version 2
|
||||||
or (at your option) any later version.
|
or (at your option) any later version.
|
||||||
|
@ -15,6 +15,8 @@
|
|||||||
# Authors:
|
# Authors:
|
||||||
# Martin Pitt <martin.pitt@ubuntu.com>, based on
|
# Martin Pitt <martin.pitt@ubuntu.com>, based on
|
||||||
# http://blog.launchpad.net/api/recipe-for-uploading-files-via-the-api
|
# http://blog.launchpad.net/api/recipe-for-uploading-files-via-the-api
|
||||||
|
# Dustin Kirkland <kirkland@ubuntu.com>
|
||||||
|
# - support files for changelog and release notes
|
||||||
|
|
||||||
'''Upload a release tarball to a Launchpad project.'''
|
'''Upload a release tarball to a Launchpad project.'''
|
||||||
|
|
||||||
@ -70,25 +72,33 @@ def edit_file(prefix, description):
|
|||||||
'Lines which start with "#" are ignored.\n' % description)
|
'Lines which start with "#" are ignored.\n' % description)
|
||||||
os.close(fd)
|
os.close(fd)
|
||||||
subprocess.call(['sensible-editor', f])
|
subprocess.call(['sensible-editor', f])
|
||||||
|
return cat_file(f)
|
||||||
|
|
||||||
|
def cat_file(f):
|
||||||
content = ''
|
content = ''
|
||||||
for line in open(f):
|
for line in open(f):
|
||||||
if line.startswith('#'):
|
if line.startswith('#'):
|
||||||
continue
|
continue
|
||||||
content += line
|
content += line
|
||||||
|
|
||||||
return content.strip()
|
return content.strip()
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
if len(sys.argv) != 4 and len(sys.argv) != 5:
|
if len(sys.argv) < 4 or len(sys.argv) > 7:
|
||||||
print >> sys.stderr, '''Upload a release tarball to a Launchpad project.
|
print >> sys.stderr, '''Upload a release tarball to a Launchpad project.
|
||||||
|
|
||||||
Usage: %s <project name> <version> <tarball> [new milestone]''' % sys.argv[0]
|
Usage: %s <project name> <version> <tarball> [new milestone] [changelog file] [releasenotes file]''' % sys.argv[0]
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
|
changelog_file = None
|
||||||
|
releasenotes_file = None
|
||||||
if len(sys.argv) == 4:
|
if len(sys.argv) == 4:
|
||||||
(project, version, tarball) = sys.argv[1:]
|
(project, version, tarball) = sys.argv[1:]
|
||||||
else:
|
elif len(sys.argv) == 5:
|
||||||
(project, version, tarball, new_milestone) = sys.argv[1:]
|
(project, version, tarball, new_milestone) = sys.argv[1:]
|
||||||
|
elif len(sys.argv) == 6:
|
||||||
|
(project, version, tarball, new_milestone, changelog_file) = sys.argv[1:]
|
||||||
|
elif len(sys.argv) == 7:
|
||||||
|
(project, version, tarball, new_milestone, changelog_file, releasenotes_file) = sys.argv[1:]
|
||||||
|
|
||||||
try:
|
try:
|
||||||
launchpad = Launchpad.login_with('ubuntu-dev-tools', 'production')
|
launchpad = Launchpad.login_with('ubuntu-dev-tools', 'production')
|
||||||
@ -135,10 +145,17 @@ def main():
|
|||||||
file_type='Code Release Tarball', signature_filename=signature,
|
file_type='Code Release Tarball', signature_filename=signature,
|
||||||
signature_content=signature_content)
|
signature_content=signature_content)
|
||||||
|
|
||||||
changelog = edit_file('changelog', 'changelog')
|
if changelog_file is not None:
|
||||||
|
changelog = cat_file(changelog_file)
|
||||||
|
else:
|
||||||
|
changelog = edit_file('changelog', 'changelog')
|
||||||
if changelog:
|
if changelog:
|
||||||
release.changelog = changelog
|
release.changelog = changelog
|
||||||
release_notes = edit_file('releasenotes', 'release notes')
|
|
||||||
|
if releasenotes_file is not None:
|
||||||
|
release_notes = cat_file(releasenotes_file)
|
||||||
|
else:
|
||||||
|
release_notes = edit_file('releasenotes', 'release notes')
|
||||||
if release_notes:
|
if release_notes:
|
||||||
release.release_notes = release_notes
|
release.release_notes = release_notes
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user