Skip to content

Commit a7afe45

Browse files
committed
make Git versioning resilient to non-git tarballs
closes #24
1 parent 6fec1c5 commit a7afe45

File tree

5 files changed

+28
-2
lines changed

5 files changed

+28
-2
lines changed

.gitversionmark

Whitespace-only changes.

CHANGES

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
CHANGES FOR VERSION 2.13
2+
binaries now track which git version they are
23
support for LaTeX is updated to use \rmfamily, \bfseries, and so on
34
Fixed indentation issue https://github.com/nrnrnr/noweb/issues/24
45
add \@nwbegincodelinewidth to help typeset code chunks in list items

src/INSTALL

+7
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,13 @@ either Icon or Awk, but Icon is better:
2323
(This breaking change was put in to enable the Awk and Icon codes
2424
to generate *identical* outputs, for regression testing.)
2525

26+
- As of version 2.13, the `c/Makefile` contains a GNU-ism.
27+
If you don't have GNU Make, you'll need to find the use of
28+
`$(wildcard ...)` and expand it manually. If you're not using
29+
`git`, remove the dependency. If you are using git,
30+
change the invocation of `wildcard` to hold just the path
31+
name to `master`.
32+
2633

2734
To build noweb:
2835

src/c/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ doc.ps: doc.dvi
9292
markup.ps: markmain.nw
9393
notangle -Rmarkup.dot markmain.nw | dot -Tps > $@
9494

95-
gitversion.c: ../gitversion ../../.git/refs/heads/master
95+
gitversion.c: ../gitversion $(wildcard ../../.git/refs/heads/master)
9696
echo 'const char gitversion[] = "'"$$(../gitversion -prefix)"'";' > $@
9797

9898

src/gitversion

+19-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,22 @@ case $1 in
55
*) prefix="" ;;
66
esac
77

8-
echo "$prefix$(git describe --abbrev=20 --dirty --always --tags)"
8+
notversioned="${prefix}Not under Git versioning"
9+
10+
search=.
11+
12+
while [ ! -r "$search/.gitversionmark" ]; do
13+
search="$search/.."
14+
case $search in
15+
./../../../../../../..*) echo "$0: Cannot find git version mark"
16+
echo "$notversioned"
17+
exit
18+
;;
19+
esac
20+
done
21+
22+
if [ -r "$search/.git/refs/heads/master" ]; then
23+
echo "$prefix$(git describe --abbrev=20 --dirty --always --tags)"
24+
else
25+
echo "$notversioned"
26+
fi

0 commit comments

Comments
 (0)