From ea37d4c0729057b01c0e0b82b3bef7030379da2f Mon Sep 17 00:00:00 2001 From: Dominik Riebeling Date: Mon, 22 Jan 2007 23:09:07 +0000 Subject: Use the svn revision number for version information too, version string is now "r- unless there is a static version file (e.g. created by tools/release). git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12090 a1c6a512-1295-4272-9138-f99709370657 --- tools/configure | 2 +- tools/release | 12 +++++++++++- tools/svnversion.sh | 25 +++++++++++++++++++++++++ 3 files changed, 37 insertions(+), 2 deletions(-) create mode 100755 tools/svnversion.sh (limited to 'tools') diff --git a/tools/configure b/tools/configure index 26d41404c6..174beed644 100755 --- a/tools/configure +++ b/tools/configure @@ -1579,7 +1579,7 @@ export OBJDIR=@PWD@ export BUILDDIR=@PWD@ export LANGUAGE=@LANGUAGE@ export MEMORYSIZE=@MEMORY@ -export VERSION=\$(shell date -u +%y%m%d-%H%M) +export VERSION=\$(shell \$(TOOLSDIR)/svnversion.sh \$(ROOTDIR)) export BUILDDATE=\$(shell date -u +'-DYEAR=%Y -DMONTH=%m -DDAY=%d') export MKFIRMWARE=@TOOL@ export BMP2RB_MONO=@BMP2RB_MONO@ diff --git a/tools/release b/tools/release index 1a0b245a2f..3c5d5037fe 100755 --- a/tools/release +++ b/tools/release @@ -11,6 +11,10 @@ if(!-f "apps/version.h") { print "run this script in the root dir\n"; exit; } +# save the complete version string for VERSION file, +# strip everything after space / hyphen for filename +$longversion = $ARGV[0]; +$version =~ s/[ -].+//; # -L allows find to follow symbolic links @files=`find -L . -name FILES`; @@ -84,7 +88,6 @@ for(@entries) { `cp -p $_ $dir 2>/dev/null`; } - if(!open(VERSION, ") { close(VERSION); close(THIS); +if(!open(VER, ">rockbox-$version/docs/VERSION")) { + print "Can't create new docs/VERSION file\n"; + exit; +} +print VER $version; +close(VER); + `tar -cjf rockbox-$version.tar.bz2 rockbox-$version`; `rm -rf rockbox-$version`; diff --git a/tools/svnversion.sh b/tools/svnversion.sh new file mode 100755 index 0000000000..5e96bf925c --- /dev/null +++ b/tools/svnversion.sh @@ -0,0 +1,25 @@ +#!/bin/bash +# __________ __ ___. +# Open \______ \ ____ ____ | | _\_ |__ _______ ___ +# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / +# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < +# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ +# \/ \/ \/ \/ \/ +# $Id:$ +# + +# Usage: svnversion.sh [source-root] + +VERSIONFILE=docs/VERSION +if [ -n "$1" ]; then TOP=$1; else TOP=..; fi +if [ -r $TOP/$VERSIONFILE ]; then SVNVER=`cat $TOP/$VERSIONFILE`; +else if [ `which svnversion 2>/dev/null` ]; + then SVNVER=r`svnversion $1`; + if [ $SVNVER = "rexported" ]; then + SVNVER=unknown; + fi +else SVNVER="unknown"; fi +fi +VERSION=$SVNVER-`date -u +%y%m%d` +echo $VERSION + -- cgit v1.2.3