~ubuntu-branches/ubuntu/vivid/golang/vivid

« back to all changes in this revision

Viewing changes to debian/patches/010-getgoversion_from_debian_changelog.patch

  • Committer: Bazaar Package Importer
  • Author(s): Ondřej Surý
  • Date: 2011-08-03 17:04:59 UTC
  • mfrom: (14.1.2 sid)
  • Revision ID: james.westby@ubuntu.com-20110803170459-wzd99m3567y80ila
Tags: 1:59-1
* Imported Upstream version 59
* Refresh patches to a new release
* Fix FTBFS on ARM (Closes: #634270)
* Update version.bash to work with Debian packaging and not hg
  repository

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
--- a/src/version.bash
 
2
+++ b/src/version.bash
 
3
@@ -3,36 +3,25 @@
 
4
 # Use of this source code is governed by a BSD-style
 
5
 # license that can be found in the LICENSE file.
 
6
 
 
7
-# Check that we can use 'hg'
 
8
-if ! hg version > /dev/null 2>&1; then
 
9
-       echo 'hg not installed' 1>&2
 
10
-       exit 2
 
11
-fi
 
12
+cd $(dirname $0)/..
 
13
 
 
14
 # Get numerical revision
 
15
-VERSION=$(hg identify -n 2>/dev/null)
 
16
-if [ $? != 0 ]; then
 
17
-       OLD=$(hg identify | sed 1q)
 
18
-       VERSION=$(echo $OLD | awk '{print $1}')
 
19
-fi
 
20
+# DEBIAN: We don't have a numerical revision
 
21
+VERSION=
 
22
 
 
23
 # Get branch type
 
24
+# DEBIAN: Get release/weekly from source package name
 
25
 BRANCH=release
 
26
-if [ "$(hg identify -b 2>/dev/null)" == "default" ]; then
 
27
+if [ "$(dpkg-parsechangelog | sed -n 's/Source: golang-//p;')" == "" ]; then
 
28
        BRANCH=weekly
 
29
 fi
 
30
 
 
31
 # Find most recent known release or weekly tag.
 
32
-TAG=$(hg tags |
 
33
-       grep $BRANCH |
 
34
-       sed 's/:.*//' |
 
35
-       sort -rn -k2 |
 
36
-       awk -v ver=$VERSION '$2 <= ver && $1~/^(release|weekly)\./ {print $1}' |
 
37
-       sed -n 1p)
 
38
+# DEBIAN: get tag from Debian changelog version
 
39
+TAG=$BRANCH.$(dpkg-parsechangelog | sed -n 's/Version: \([^-]*\)-.*/\1/p;')
 
40
 
 
41
 if [ "$TAG" != "" ]; then
 
42
        VERSION="$TAG $VERSION"
 
43
 fi
 
44
 
 
45
 echo $VERSION
 
46
-