3 # Update Exim's version header file.
5 # Compatibility gross-ness for non-POSIX systems
6 if [ -z "$EXIM_REVERSION_ADJUSTED" ]
9 EXIM_REVERSION_ADJUSTED
=yes
10 export SHELL EXIM_REVERSION_ADJUSTED
12 if [ -x /usr
/xpg
4/bin
/sh
]
14 PATH
="/usr/xpg4/bin:$PATH"
15 SHELL
=/usr
/xpg
4/bin
/sh
21 exec "$SHELL" "$0" "$@"
24 # Read version information that was generated by a previous run of
25 # this script, or during the release process.
27 if [ -f .
/version.sh
]
29 elif [ -f ..
/src
/version.sh
]
30 then . ..
/src
/version.sh
33 # If this tree is a git working directory, use that to get version information.
35 if [ -d ..
/..
/.git
] ||
[ "$1" = "release" ]
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" ]
45 EXIM_RELEASE_VERSION
="$2"
46 EXIM_VARIANT_VERSION
="$3"
51 # If you are maintaining a patched version of Exim, you can either
52 # create your own version.sh as part of your release process, or you
53 # can modify EXIM_VARIANT_VERSION at this point in this script.
55 case "$EXIM_RELEASE_VERSION" in
56 '') echo "*** Your copy of Exim lacks any version information."
60 EXIM_COMPILE_NUMBER
=$
(expr "${EXIM_COMPILE_NUMBER:-0}" + 1)
62 echo "$EXIM_COMPILE_NUMBER" >cnumber.h
64 ( echo '# automatically generated file - see ../scripts/reversion'
65 echo EXIM_RELEASE_VERSION
='"'"$EXIM_RELEASE_VERSION"'"'
66 echo EXIM_VARIANT_VERSION
='"'"$EXIM_VARIANT_VERSION"'"'
67 echo EXIM_COMPILE_NUMBER
='"'"$EXIM_COMPILE_NUMBER"'"'
72 ( echo '/* automatically generated file - see ../scripts/reversion */'
73 echo '#define EXIM_RELEASE_VERSION "'"$EXIM_RELEASE_VERSION"'"'
74 echo '#define EXIM_VARIANT_VERSION "'"$EXIM_VARIANT_VERSION"'"'
75 echo '#define EXIM_VERSION_STR EXIM_RELEASE_VERSION EXIM_VARIANT_VERSION'
79 echo ">>> version $EXIM_RELEASE_VERSION$EXIM_VARIANT_VERSION #$EXIM_COMPILE_NUMBER"