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

Commits:

1 changed file:

Changes:

  • bin/cmucl-version.sh
    1
    +#!/bin/sh 
    
    2
    +
    
    3
    +# Script to determine the cmucl version based on git describe
    
    4
    +GIT_HASH="`(cd src; git describe --dirty 2>/dev/null || git describe 2>/dev/null)`"
    
    5
    +# echo GIT_HASH = ${GIT_HASH}
    
    6
    +
    
    7
    +if expr "X${GIT_HASH}" : 'Xsnapshot-[0-9][0-9][0-9][0-9]-[01][0-9]' > /dev/null; then
    
    8
    +    # The git hash looks like snapshot-yyyy-mm-<stuff>.  Remove the
    
    9
    +    # "snapshot-" part.
    
    10
    +    DEFAULT_VERSION=`expr "${GIT_HASH}" : "snapshot-\(.*\)"`
    
    11
    +fi
    
    12
    +
    
    13
    +if expr "X${GIT_HASH}" : 'X[0-9][0-9][a-f]' > /dev/null; then
    
    14
    +    # The git hash looks like a release which is 3 hex digits.  Use it as is.
    
    15
    +    DEFAULT_VERSION="${GIT_HASH}"
    
    16
    +fi
    
    17
    +
    
    18
    +echo $DEFAULT_VERSION