Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Always generate some sort of include/serno.h

If no .hg directory is present or hg fails, fall back
to .hg_archival.txt (for tarballs downloaded from the
hg web interface or via 'hg archive') or the string
"unknown" otherwise.

Release tarballs have no .hg but have a good
include/serno.h, so only overwrite an existing
serno.h with information from hg. The .hg_archival.txt
file only has the revision hash, not the local
revision number.

This should fix the build for tarballs downloaded from
the hg web interface.
  • Loading branch information...
commit 51754f725ad0e7d254d157107c309c71dfbeee5d 1 parent 025a63b
@jillest jillest authored
Showing with 9 additions and 4 deletions.
  1. +9 −4 Makefile
View
13 Makefile
@@ -5,10 +5,15 @@ SUBDIRS=$(LIBMOWGLI) modules src $(PODIR)
CLEANDIRS = ${SUBDIRS}
pre-depend: include/hooktypes.h
- @if [ -d .hg ] ; then \
- revh=`hg parent --template '#define SERNO "{rev}:{node|short}"\n' 2>/dev/null`;\
- [ -z "$$revh" ] || echo "$$revh" >include/serno.h ; \
- fi
+ @revh=; \
+ if [ -d .hg ]; then \
+ revh=`hg parent --template '{rev}:{node|short}' 2>/dev/null` || :; \
+ fi; \
+ if [ -z "$$revh" ] && [ ! -r include/serno.h ]; then \
+ revh=`sed -ne 's/^node: \(............\).*/\1/p' .hg_archival.txt 2>/dev/null` || :; \
+ [ -n "$$revh" ] || revh=unknown; \
+ fi; \
+ [ -z "$$revh" ] || echo "#define SERNO \"$$revh\"" >include/serno.h
install-extra:
@echo "----------------------------------------------------------------"
Please sign in to comment.
Something went wrong with that request. Please try again.