[DVDnav-discuss] [PATCH] Create version.h with released version number when SVN not known

Dan Nicholson dbn.lists at gmail.com
Mon Apr 28 23:53:40 CEST 2008


---
 Makefile   |    2 +-
 version.sh |    6 +++++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index 85108e5..c76c72c 100644
--- a/Makefile
+++ b/Makefile
@@ -79,7 +79,7 @@ version.h: $(SVN_ENTRIES)
 endif
 
 version.h:
-	sh $(SRC_PATH)/version.sh $(SRC_PATH)
+	sh $(SRC_PATH)/version.sh $(SRC_PATH) "$(SHLIB_VERSION)"
 
 $(SRCS) $(DVDREAD_SRCS): version.h
 
diff --git a/version.sh b/version.sh
index 6ef2323..6b4e52e 100755
--- a/version.sh
+++ b/version.sh
@@ -6,7 +6,11 @@ test $svn_revision || svn_revision=`cd "$1" && \
     grep revision .svn/entries 2> /dev/null | cut -d '"' -f2 2> /dev/null`
 test $svn_revision || svn_revision=UNKNOWN
 
-NEW_REVISION="#define VERSION \"SVN-r$svn_revision\""
+if test "$svn_revision" = UNKNOWN && test -n "$2"; then
+    NEW_REVISION="#define VERSION \"$2\""
+else
+    NEW_REVISION="#define VERSION \"SVN-r$svn_revision\""
+fi
 OLD_REVISION=`cat version.h 2> /dev/null`
 
 # Update version.h only on revision changes to avoid spurious rebuilds
-- 
1.5.3.2




More information about the DVDnav-discuss mailing list