[Pkg-javascript-commits] [sockjs-client] 67/434: Versioning, prepration for the first release

Tonnerre Lombard tonnerre-guest at moszumanska.debian.org
Wed Jan 8 00:47:02 UTC 2014


This is an automated email from the git hooks/post-receive script.

tonnerre-guest pushed a commit to branch master
in repository sockjs-client.

commit 3858aa850c5d6b79fbba0dd5a4f1295523c745da
Author: Marek Majkowski <majek04 at gmail.com>
Date:   Thu Aug 11 15:31:36 2011 +0100

    Versioning, prepration for the first release
---
 Makefile    | 27 +++++++++++++++++++--------
 VERSION-GEN | 30 ++++++++++++++++++++++++++++++
 2 files changed, 49 insertions(+), 8 deletions(-)

diff --git a/Makefile b/Makefile
index 5253efb..49083ae 100644
--- a/Makefile
+++ b/Makefile
@@ -25,19 +25,30 @@ tests: tests/html/lib/sockjs.js tests/html/lib/tests.js
 
 
 serve:
-	@if [ -e .pidfile.pid ]; then	\
-		kill `cat .pidfile.pid`;	\
+	@if [ -e .pidfile.pid ]; then			\
+		kill `cat .pidfile.pid`;		\
 		rm .pidfile.pid;			\
 	fi
 
-	@while [ 1 ]; do							\
+	@while [ 1 ]; do				\
 	        echo " [*] Running http server";	\
-	        make test &							\
-	        SRVPID=$$!;							\
+	        make test &				\
+	        SRVPID=$$!;				\
 	        echo $$SRVPID > .pidfile.pid;		\
 	        echo " [*] Server pid: $$SRVPID";	\
-	    inotifywait -r -q -e modify .;			\
-	    kill `cat .pidfile.pid`;		\
+	    inotifywait -r -q -e modify .;		\
+	    kill `cat .pidfile.pid`;			\
 	    rm -f .pidfile.pid;				\
-	    sleep 0.1;						\
+	    sleep 0.1;					\
 	done
+
+VER:=$(shell ./VERSION-GEN)
+upload: build
+	[ -e ../sockjs-client-gh-pages ] || 				\
+		git clone `git remote -v|tr "[:space:]" "\t"|cut -f 2`	\
+			--branch gh-pages ../sockjs-client-gh-pages
+	(cd ../sockjs-client-gh-pages; git pull;)
+	for f in sock*js; do						\
+		cp $$f ../sockjs-client-gh-pages/`echo $$f|sed 's|\(sockjs\)\(.*[.]js\)|\1-$(VER)\2|g'`; \
+	done
+	(cd ../sockjs-client-gh-pages; node generate_index.js > index.html;)
diff --git a/VERSION-GEN b/VERSION-GEN
new file mode 100755
index 0000000..8c3eeb3
--- /dev/null
+++ b/VERSION-GEN
@@ -0,0 +1,30 @@
+#!/bin/sh
+
+DEF_VER=unknown
+
+LF='
+'
+
+# First see if there is a version file (included in release tarballs),
+# then try git-describe, then default.
+if test -f version
+then
+	VN=$(cat version) || VN="$DEF_VER"
+elif test -d .git -o -f .git &&
+	VN=$(git describe --match "v[0-9]*" --abbrev=4 HEAD 2>/dev/null) &&
+	case "$VN" in
+	*$LF*) (exit 1) ;;
+	v[0-9]*)
+		git update-index -q --refresh
+		test -z "$(git diff-index --name-only HEAD --)" ||
+		VN="$VN-dirty" ;;
+	esac
+then
+	VN=$(echo "$VN" | sed -e 's/-/./g');
+else
+	VN="$DEF_VER"
+fi
+
+VN=$(expr "$VN" : v*'\(.*\)')
+
+echo "$VN"

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/sockjs-client.git



More information about the Pkg-javascript-commits mailing list