Mercurial > hg
annotate contrib/packagelib.sh @ 26357:6979a1369185
lock: add a method to prepare the lock for inheritance
This is part of a series that will allow locks to be inherited by subprocesses
in limited circumstances.
author | Siddharth Agarwal <sid0@fb.com> |
---|---|
date | Thu, 24 Sep 2015 10:37:13 -0700 |
parents | 56c64c91b429 |
children | 6474b64045fb |
rev | line source |
---|---|
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 } |