When installing SVN snapshots, include the branch and revision in the version number.
author"Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Sun Feb 17 22:58:57 2008 +0000 (2008-02-17)
changeset 435ff598e5b4bb5
parent 434 3dc88c41b7a6
child 436 ecbb620acaa0
When installing SVN snapshots, include the branch and revision in the version number.
In case some random snapshot is installed and used for production, then this
will ease rewinding.
Makefile.in
configure
     1.1 --- a/Makefile.in	Sun Feb 17 22:19:26 2008 +0000
     1.2 +++ b/Makefile.in	Sun Feb 17 22:58:57 2008 +0000
     1.3 @@ -101,10 +101,10 @@
     1.4  	     tar cf - --exclude=.svn $${src_dir} |(cd $(LIBDIR); tar xf -); \
     1.5  	 done
     1.6  	@rm -f $(LIBDIR)/tools/addToolVersion.sh
     1.7 -	@for src_file in steps.mk .version; do                 \
     1.8 -	     echo "  INST   $${src_file}";                          \
     1.9 -	     install -m 644 $${src_file} $(LIBDIR)/$${src_file};    \
    1.10 -	 done
    1.11 +	@echo "  INST   steps.mk"
    1.12 +	@install -m 644 steps.mk $(LIBDIR)/steps.mk
    1.13 +	@echo "  INST   .version"
    1.14 +	@echo "$(VERSION)" >$(LIBDIR)/.version
    1.15  
    1.16  # Samples need a little love:
    1.17  #  - change every occurrence of CT_TOP_DIR to CT_LIB_DIR
     2.1 --- a/configure	Sun Feb 17 22:19:26 2008 +0000
     2.2 +++ b/configure	Sun Feb 17 22:58:57 2008 +0000
     2.3 @@ -121,6 +121,21 @@
     2.4  #---------------------------------------------------------------------
     2.5  # Some sanity checks, now
     2.6  
     2.7 +# If this version is a svn snapshot, try to get the revision number
     2.8 +# If we can't get the revision number, use date
     2.9 +case "${VERSION}" in
    2.10 +  *+svn)
    2.11 +    REVISION=$(LANG=C svn info 2>/dev/null |egrep 'Revision: ' |cut -d ' ' -f 2-)
    2.12 +    if [ -n "${REVISION}" ]; then
    2.13 +      URL=$(LANG=C svn info 2>/dev/null |egrep 'URL: ' |cut -d ' ' -f 2-)
    2.14 +      ROOT=$(LANG=C svn info 2>/dev/null |egrep 'Repository Root: ' |cut -d ' ' -f 3-)
    2.15 +      VERSION="${VERSION}:${URL#${ROOT}}@${REVISION}"
    2.16 +    else
    2.17 +      VERSION="${VERSION}:unknown@$(date +%Y%m%d.%H%M%S)"
    2.18 +    fi
    2.19 +    ;;
    2.20 +esac
    2.21 +
    2.22  # Check bash is present, and at least version 3.0
    2.23  [ -x /bin/bash ] || do_error "bash 3.0 or above was not found in /bin/bash"
    2.24  bash_version=$(/bin/bash -c 'echo ${BASH_VERSION}')