~ubuntu-branches/ubuntu/utopic/golang-go-patricia/utopic-proposed

« back to all changes in this revision

Viewing changes to debian/helpers/tag-upstream-version.sh

  • Committer: Package Import Robot
  • Author(s): Tianon Gravi
  • Date: 2014-08-23 22:27:28 UTC
  • Revision ID: package-import@ubuntu.com-20140823222728-xprp6r8eafo0ljy7
Tags: 1.0.1-1
Initial release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/bash
 
2
set -e
 
3
 
 
4
version="$1"
 
5
 
 
6
dir="$(dirname "$(readlink -f "$BASH_SOURCE")")"
 
7
"$dir/setup-upstream-remote.sh"
 
8
 
 
9
debian="$(readlink -f "$(dirname "$BASH_SOURCE")/..")"
 
10
packageLine="$(head -n1 "$debian/changelog")"
 
11
packageDebianVersion="$(echo "$packageLine" | cut -d'(' -f2 | cut -d')' -f1)"
 
12
packageVersion="${packageDebianVersion%-*}" # strip off the "debian version" suffix (-1, -2, -3, etc)
 
13
 
 
14
if [ -z "$version" ]; then
 
15
        echo >&2 "version not specified, using '$packageVersion' from d/changelog"
 
16
        version="$packageVersion"
 
17
fi
 
18
 
 
19
git fetch -qn upstream "+refs/tags/v$version:refs/tags/upstream/$version"
 
20
 
 
21
echo
 
22
echo "local tag 'upstream/$version' updated"
 
23
echo
 
24
echo 'use the following to push it:'
 
25
echo
 
26
echo "  git push -f origin upstream/$version:upstream/$version"
 
27
echo
 
28
echo 'if this upstream version has not been merged into master yet, use:'
 
29
echo
 
30
echo "  git merge upstream/$version"
 
31
echo