Raymond Toy pushed to branch issue-363-add-version-number at cmucl / cmucl

Commits:

1 changed file:

Changes:

  • bin/git-version.sh
    1 1
     #!/bin/sh 
    
    2 2
     
    
    3
    -# If no, just print out the version.  If yes, print out the version as
    
    4
    -# a C file #define.
    
    5
    -
    
    3
    +# If FILE=yes, print out the version as a C file #define.  Otherwise,
    
    4
    +# just print the version to stdout and exit.
    
    6 5
     FILE=""
    
    7 6
     
    
    8
    -while getopts "f" arg
    
    9
    -do
    
    7
    +while getopts "f" arg; do
    
    10 8
         case $arg in
    
    11 9
     	f) FILE=yes
    
    12 10
     	   ;;
    
    ... ... @@ -15,15 +13,12 @@ done
    15 13
     
    
    16 14
     # Script to determine the cmucl version based on git describe
    
    17 15
     GIT_HASH="`(git describe --dirty 2>/dev/null || git describe 2>/dev/null)`"
    
    18
    -# echo GIT_HASH = ${GIT_HASH}
    
    19 16
     
    
    20
    -if [ `expr "X${GIT_HASH}" : 'Xsnapshot-[0-9][0-9][0-9][0-9]-[01][0-9]'` != 0 ]; then
    
    17
    +if [ `expr "X$GIT_HASH" : 'Xsnapshot-[0-9][0-9][0-9][0-9]-[01][0-9]'` != 0 ]; then
    
    21 18
         # The git hash looks like snapshot-yyyy-mm-<stuff>.  Remove the
    
    22 19
         # "snapshot-" part.
    
    23
    -    DEFAULT_VERSION=`expr "${GIT_HASH}" : "snapshot-\(.*\)"`
    
    24
    -fi
    
    25
    -
    
    26
    -if [ `expr "X${GIT_HASH}" : 'X[0-9][0-9][a-f]'` != 0 ]; then
    
    20
    +    DEFAULT_VERSION=`expr "$GIT_HASH" : "snapshot-\(.*\)"`
    
    21
    +elif [ `expr "X$GIT_HASH" : 'X[0-9][0-9][a-f]'` != 0 ]; then
    
    27 22
         # The git hash looks like a release which is 3 hex digits.  Use it as is.
    
    28 23
         DEFAULT_VERSION="${GIT_HASH}"
    
    29 24
     fi