Version 4.80.1
[exim.git] / src / scripts / reversion
1 #!/bin/sh
2
3 # Update Exim's version header file.
4
5 # Compatibility gross-ness for non-POSIX systems
6 if [ -z "$EXIM_REVERSION_ADJUSTED" ]
7 then
8   SHELL=/bin/sh
9   EXIM_REVERSION_ADJUSTED=yes
10   export SHELL EXIM_REVERSION_ADJUSTED
11   # Solaris:
12   if [ -x /usr/xpg4/bin/sh ]
13   then
14     PATH="/usr/xpg4/bin:$PATH"
15     SHELL=/usr/xpg4/bin/sh
16     export PATH SHELL
17   fi
18   # Irix:
19   _XPG=1 ; export _XPG
20   #
21   exec "$SHELL" "$0" "$@"
22 fi
23
24 # Read version information that was generated by a previous run of
25 # this script, or during the release process.
26
27 if   [ -f ./version.sh ]
28 then .    ./version.sh
29 elif [ -f ../src/version.sh ]
30 then .    ../src/version.sh
31 fi
32
33 # If this tree is a git working directory, use that to get version information.
34
35 #if [ -d ../../.git ] || [ "$1" = "release" ]
36 #then
37 #       # Modify the output of git describe into separate parts for
38 #       # the name "exim" and the release and variant versions.
39 #       # Put a dot in the version number and remove a spurious g.
40 #       set $(git describe --dirty=-XX --match 'exim-4*' |
41 #               sed 's|-| |;s|_|.|;s|[-_]| _|;s|-g|-|')
42 #       # Only update if we need to
43 #       if [ "$2 $3" != "$EXIM_RELEASE_VERSION $EXIM_VARIANT_VERSION" ]
44 #       then
45 #               EXIM_RELEASE_VERSION="$2"
46 #               EXIM_VARIANT_VERSION="$3"
47 #               rm -f version.h
48 #       fi
49 #fi
50 EXIM_RELEASE_VERSION="4.80.1"
51 EXIM_VARIANT_VERSION=""
52
53 # If you are maintaining a patched version of Exim, you can either
54 # create your own version.sh as part of your release process, or you
55 # can modify EXIM_VARIANT_VERSION at this point in this script.
56
57 case "$EXIM_RELEASE_VERSION" in
58 '')     echo "*** Your copy of Exim lacks any version information."
59         exit 1
60 esac
61
62 EXIM_COMPILE_NUMBER=$(expr "${EXIM_COMPILE_NUMBER:-0}" + 1)
63
64 echo "$EXIM_COMPILE_NUMBER" >cnumber.h
65
66 ( echo '# automatically generated file - see ../scripts/reversion'
67   echo EXIM_RELEASE_VERSION='"'"$EXIM_RELEASE_VERSION"'"'
68   echo EXIM_VARIANT_VERSION='"'"$EXIM_VARIANT_VERSION"'"'
69   echo EXIM_COMPILE_NUMBER='"'"$EXIM_COMPILE_NUMBER"'"'
70 ) >version.sh
71
72 if [ ! -f version.h ]
73 then
74 ( echo '/* automatically generated file - see ../scripts/reversion */'
75   echo '#define EXIM_RELEASE_VERSION "'"$EXIM_RELEASE_VERSION"'"'
76   echo '#define EXIM_VARIANT_VERSION "'"$EXIM_VARIANT_VERSION"'"'
77   echo '#define EXIM_VERSION_STR EXIM_RELEASE_VERSION EXIM_VARIANT_VERSION'
78 ) >version.h
79 fi
80
81 echo ">>> version $EXIM_RELEASE_VERSION$EXIM_VARIANT_VERSION #$EXIM_COMPILE_NUMBER"
82 echo