add packaging information to version

Summary:
Add a "source version" when generating source packages for Ubuntu. The source
version is a part of the software version, which is encoded in the original
tarball. This allows some flexibility when uploading to Launchpad, which will
reject changes for the same software version. For example, the source version
can be bumped to upload a fix for a broken package (without bumping the actual
software version). Note that the package version cannot be used to accomplish
this; it is not part of the source tarball, so bumping this version does not
pervent Launchpad from rejecting the changes.

Rename the script, since this is a bit specific for Ubuntu and Launchpad.

See: http://askubuntu.com/a/391751

Reviewers: jacko

Reviewed By: jacko

Differential Revision: https://phabricator.buildinspace.com/D163
This commit is contained in:
Sean Olson 2015-01-04 15:09:33 -08:00
parent 3fb8057ac5
commit 2a315178f0
1 changed files with 10 additions and 5 deletions

View File

@ -1,6 +1,6 @@
#! /usr/bin/env bash
# $ build_debian_source_package.sh [series [package-version]]
# $ build_ubuntu_source_package.sh [series [package-version [source-version]]]
# Generates a Debian source package suitable for upload to a Launchpad PPA. This
# script only builds the package artifacts, it does NOT upload them. Use dput to
# upload to a PPA after building.
@ -19,11 +19,16 @@ if [ -n "$(git status --porcelain)" ] ; then
exit 1
fi
# Get the current version from the repo. Get the series and package version from
# the command line, otherwise assume "utopic" and version "1".
peru_version=$(<peru/VERSION)
package_version="${2:-1}"
# Get the series and package version from the command line, otherwise assume
# "utopic" and version "1". Get the current version from the repo and append
# package versioning information. Launchpad will reject changes to uploads for
# the same version as derived from the source tarball. Bump the source version
# to upload changes for the same version of peru (do not bump the package
# version for this).
series="${1:-utopic}"
package_version="${2:-1}"
source_version="${3:-"$package_version"}" # Default to package version.
peru_version="$(<peru/VERSION)"ubuntu~"$series""$source_version"
# Create a temporary directory for the build.
tmp=/tmp/peru/ppa