annotate mcabber/hgcset.sh @ 2320:dff24f3d007f tip

Fix bogus indent
author Mikael Berthe <mikael@lilotux.net>
date Sun, 25 Jun 2017 22:50:43 +0200
parents e8f2db654e67
children
rev   line source
777
e6d42f239541 "/version" shows Mercurial changeset (if there's one)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
1 #! /bin/sh
e6d42f239541 "/version" shows Mercurial changeset (if there's one)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
2
2041
e8f2db654e67 Fix building from separate directory
Myhailo Danylenko <isbear@ukrpost.net>
parents: 1668
diff changeset
3 srcdir="$1"
e8f2db654e67 Fix building from separate directory
Myhailo Danylenko <isbear@ukrpost.net>
parents: 1668
diff changeset
4 builddir="$2"
e8f2db654e67 Fix building from separate directory
Myhailo Danylenko <isbear@ukrpost.net>
parents: 1668
diff changeset
5
e8f2db654e67 Fix building from separate directory
Myhailo Danylenko <isbear@ukrpost.net>
parents: 1668
diff changeset
6 if [ ! -f "$srcdir/logprint.h" ]; then
e8f2db654e67 Fix building from separate directory
Myhailo Danylenko <isbear@ukrpost.net>
parents: 1668
diff changeset
7 echo "Unable to find mcabber sources!" >&2
777
e6d42f239541 "/version" shows Mercurial changeset (if there's one)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
8 exit 1
e6d42f239541 "/version" shows Mercurial changeset (if there's one)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
9 fi
e6d42f239541 "/version" shows Mercurial changeset (if there's one)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
10
2041
e8f2db654e67 Fix building from separate directory
Myhailo Danylenko <isbear@ukrpost.net>
parents: 1668
diff changeset
11 cd "$srcdir"
e8f2db654e67 Fix building from separate directory
Myhailo Danylenko <isbear@ukrpost.net>
parents: 1668
diff changeset
12
777
e6d42f239541 "/version" shows Mercurial changeset (if there's one)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
13 if which hg > /dev/null 2>&1; then
e6d42f239541 "/version" shows Mercurial changeset (if there's one)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
14 cs=$(hg id 2> /dev/null | cut -d' ' -f1)
e6d42f239541 "/version" shows Mercurial changeset (if there's one)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
15 if test $? -eq 0; then
1249
6cb8edbda6d2 Fix hgcset.sh when Mercurial is installed but there is no repository
Mikael Berthe <mikael@lilotux.net>
parents: 777
diff changeset
16 if [ x"$cs" != x ]; then
2041
e8f2db654e67 Fix building from separate directory
Myhailo Danylenko <isbear@ukrpost.net>
parents: 1668
diff changeset
17 grep -q "$cs" "$builddir/hgcset.h" > /dev/null 2>&1 || \
e8f2db654e67 Fix building from separate directory
Myhailo Danylenko <isbear@ukrpost.net>
parents: 1668
diff changeset
18 echo "#define HGCSET \"$cs\"" > "$builddir/hgcset.h"
1249
6cb8edbda6d2 Fix hgcset.sh when Mercurial is installed but there is no repository
Mikael Berthe <mikael@lilotux.net>
parents: 777
diff changeset
19 exit 0
6cb8edbda6d2 Fix hgcset.sh when Mercurial is installed but there is no repository
Mikael Berthe <mikael@lilotux.net>
parents: 777
diff changeset
20 fi
777
e6d42f239541 "/version" shows Mercurial changeset (if there's one)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
21 fi
e6d42f239541 "/version" shows Mercurial changeset (if there's one)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
22 fi
e6d42f239541 "/version" shows Mercurial changeset (if there's one)
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
23
2041
e8f2db654e67 Fix building from separate directory
Myhailo Danylenko <isbear@ukrpost.net>
parents: 1668
diff changeset
24 echo > "$builddir/hgcset.h"