3 # Update Exim's version header file.
5 # Read version information that was generated by a previous run of
6 # this script, or during the release process.
10 elif [ -f ../src/version.sh ]
11 then . ../src/version.sh
14 # If this tree is a git working directory, use that to get version information.
16 if [ -e ../../.git ] || [ "$1" = "release" ]
18 # Modify the output of git describe into separate parts for
19 # the name "exim" and the release and variant versions.
20 # Put a dot in the version number and remove a spurious g.
21 set $(git describe --dirty=-XX --match 'exim-4*' |
22 sed 's|-| |;s|_|.|;s|[-_]| _|;s|-g|-|')
23 # Only update if we need to
24 if [ "$2 $3" != "$EXIM_RELEASE_VERSION $EXIM_VARIANT_VERSION" ]
26 EXIM_RELEASE_VERSION="$2"
27 EXIM_VARIANT_VERSION="$3"
32 # If you are maintaining a patched version of Exim, you can either
33 # create your own version.sh as part of your release process, or you
34 # can modify EXIM_VARIANT_VERSION at this point in this script.
36 case $EXIM_RELEASE_VERSION in
37 '') echo "*** Your copy of Exim lacks any version information."
41 EXIM_COMPILE_NUMBER=$(expr "${EXIM_COMPILE_NUMBER:-0}" + 1)
43 echo "$EXIM_COMPILE_NUMBER" >cnumber.h
45 ( echo '# automatically generated file - see ../scripts/reversion'
46 echo EXIM_RELEASE_VERSION='"'"$EXIM_RELEASE_VERSION"'"'
47 echo EXIM_VARIANT_VERSION='"'"$EXIM_VARIANT_VERSION"'"'
48 echo EXIM_COMPILE_NUMBER='"'"$EXIM_COMPILE_NUMBER"'"'
53 ( echo '/* automatically generated file - see ../scripts/reversion */'
54 echo '#define EXIM_RELEASE_VERSION "'"$EXIM_RELEASE_VERSION"'"'
55 echo '#define EXIM_VARIANT_VERSION "'"$EXIM_VARIANT_VERSION"'"'
56 echo '#define EXIM_VERSION_STR EXIM_RELEASE_VERSION EXIM_VARIANT_VERSION'
60 echo ">>> version $EXIM_RELEASE_VERSION$EXIM_VARIANT_VERSION #$EXIM_COMPILE_NUMBER"