4
# Use of this source code is governed by a BSD-style
5
# license that can be found in the LICENSE file.
7
-# Check that we can use 'hg'
8
-if ! hg version > /dev/null 2>&1; then
9
- echo 'hg not installed' 1>&2
14
# Get numerical revision
15
-VERSION=$(hg identify -n 2>/dev/null)
17
- OLD=$(hg identify | sed 1q)
18
- VERSION=$(echo $OLD | awk '{print $1}')
20
+# DEBIAN: We don't have a numerical revision
24
+# DEBIAN: Get release/weekly from source package name
26
-if [ "$(hg identify -b 2>/dev/null)" == "default" ]; then
27
+if [ "$(dpkg-parsechangelog | sed -n 's/Source: golang-//p;')" == "" ]; then
31
# Find most recent known release or weekly tag.
36
- awk -v ver=$VERSION '$2 <= ver && $1~/^(release|weekly)\./ {print $1}' |
38
+# DEBIAN: get tag from Debian changelog version
39
+TAG=$BRANCH.$(dpkg-parsechangelog | sed -n 's/Version: \([^-]*\)-.*/\1/p;')
41
if [ "$TAG" != "" ]; then
42
VERSION="$TAG $VERSION"