author | FUJIWARA Katsunori <foozy@lares.dti.ne.jp> |
Wed, 15 Jul 2015 04:45:58 +0900 | |
changeset 25798 | 08f2177b15c7 |
parent 24972 | 56c64c91b429 |
child 26833 | 6474b64045fb |
permissions | -rw-r--r-- |
24972
56c64c91b429
packaging: extract packagelib for common code from builddeb and buildrpm
Augie Fackler <augie@google.com>
parents:
diff
changeset
|
1 |
gethgversion() { |
56c64c91b429
packaging: extract packagelib for common code from builddeb and buildrpm
Augie Fackler <augie@google.com>
parents:
diff
changeset
|
2 |
make clean |
56c64c91b429
packaging: extract packagelib for common code from builddeb and buildrpm
Augie Fackler <augie@google.com>
parents:
diff
changeset
|
3 |
make local || make local PURE=--pure |
56c64c91b429
packaging: extract packagelib for common code from builddeb and buildrpm
Augie Fackler <augie@google.com>
parents:
diff
changeset
|
4 |
HG="$PWD/hg" |
56c64c91b429
packaging: extract packagelib for common code from builddeb and buildrpm
Augie Fackler <augie@google.com>
parents:
diff
changeset
|
5 |
|
56c64c91b429
packaging: extract packagelib for common code from builddeb and buildrpm
Augie Fackler <augie@google.com>
parents:
diff
changeset
|
6 |
$HG version > /dev/null || { echo 'abort: hg version failed!'; exit 1 ; } |
56c64c91b429
packaging: extract packagelib for common code from builddeb and buildrpm
Augie Fackler <augie@google.com>
parents:
diff
changeset
|
7 |
|
56c64c91b429
packaging: extract packagelib for common code from builddeb and buildrpm
Augie Fackler <augie@google.com>
parents:
diff
changeset
|
8 |
hgversion=`$HG version | sed -ne 's/.*(version \(.*\))$/\1/p'` |
56c64c91b429
packaging: extract packagelib for common code from builddeb and buildrpm
Augie Fackler <augie@google.com>
parents:
diff
changeset
|
9 |
|
56c64c91b429
packaging: extract packagelib for common code from builddeb and buildrpm
Augie Fackler <augie@google.com>
parents:
diff
changeset
|
10 |
if echo $hgversion | grep -- '-' > /dev/null 2>&1; then |
56c64c91b429
packaging: extract packagelib for common code from builddeb and buildrpm
Augie Fackler <augie@google.com>
parents:
diff
changeset
|
11 |
# nightly build case, version is like 1.3.1+250-20b91f91f9ca |
56c64c91b429
packaging: extract packagelib for common code from builddeb and buildrpm
Augie Fackler <augie@google.com>
parents:
diff
changeset
|
12 |
version=`echo $hgversion | cut -d- -f1` |
56c64c91b429
packaging: extract packagelib for common code from builddeb and buildrpm
Augie Fackler <augie@google.com>
parents:
diff
changeset
|
13 |
release=`echo $hgversion | cut -d- -f2 | sed -e 's/+.*//'` |
56c64c91b429
packaging: extract packagelib for common code from builddeb and buildrpm
Augie Fackler <augie@google.com>
parents:
diff
changeset
|
14 |
else |
56c64c91b429
packaging: extract packagelib for common code from builddeb and buildrpm
Augie Fackler <augie@google.com>
parents:
diff
changeset
|
15 |
# official tag, version is like 1.3.1 |
56c64c91b429
packaging: extract packagelib for common code from builddeb and buildrpm
Augie Fackler <augie@google.com>
parents:
diff
changeset
|
16 |
version=`echo $hgversion | sed -e 's/+.*//'` |
56c64c91b429
packaging: extract packagelib for common code from builddeb and buildrpm
Augie Fackler <augie@google.com>
parents:
diff
changeset
|
17 |
release='0' |
56c64c91b429
packaging: extract packagelib for common code from builddeb and buildrpm
Augie Fackler <augie@google.com>
parents:
diff
changeset
|
18 |
fi |
56c64c91b429
packaging: extract packagelib for common code from builddeb and buildrpm
Augie Fackler <augie@google.com>
parents:
diff
changeset
|
19 |
} |