lp-project-upload: Generate tarball signature if it is not present yet.

This commit is contained in:
Martin Pitt 2009-11-20 16:35:56 -06:00
parent d97b54fc0a
commit 471fb39dbe
2 changed files with 9 additions and 2 deletions

3
debian/changelog vendored
View File

@ -20,6 +20,9 @@ ubuntu-dev-tools (0.83) UNRELEASED; urgency=low
- Add "--debug-echo" option which prints the resulting pbuilder/cowbuilder
commands instead of executing it.
[ Martin Pitt ]
* lp-project-upload: Generate tarball signature if it is not present yet.
-- Siegfried-Angel Gevatter Pujals <rainct@ubuntu.com> Tue, 17 Nov 2009 19:44:44 +0100
ubuntu-dev-tools (0.82) lucid; urgency=low

View File

@ -18,7 +18,7 @@
'''Upload a release tarball to a Launchpad project.'''
import sys, datetime, os.path
import sys, datetime, os.path, subprocess
from ubuntutools.lp.libsupport import get_launchpad
from launchpadlib.errors import HTTPError
@ -73,10 +73,14 @@ try:
file_content = open(tarball, 'r').read()
# Get the signature, if available.
signature = tarball + '.asc'
if not os.path.exists(signature):
print 'Calling GPG to create tarball signature...'
if subprocess.call(['gpg', '--armor', '--sign', '--detach-sig', tarball]) != 0:
print >> sys.stderr, 'gpg failed, aborting'
if os.path.exists(signature):
signature_content = open(signature, 'r').read()
else:
print 'WARNING: no signature found (%s)' % signature
signature_content = None
# Create a new product release file.