1
0
Fork 0
postfix/mantools/check-snapshot-nonprod
Daniel Baumann 75cf244379
Adding upstream version 3.10.2.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
2025-06-21 14:19:32 +02:00

30 lines
1.5 KiB
Bash
Executable file

#!/bin/sh
version=$(basename $(env - pwd)) || exit 1
case "$version" in
postfix-[0-9]*.[0-9]*.[0-9]*)
test -f conf/makedefs.out || {
echo "Error: no conf/makedefs.out" 1>&2; exit 1; }
grep 'CCARGS.*-DSNAPSHOT' conf/makedefs.out && {
echo "Error: stable release builds with -DSNAPSHOT" 1>&2; exit 1; }
grep 'CCARGS.*-DNONPROD' conf/makedefs.out && {
echo "Error: stable release builds with -DNONPROD" 1>&2; exit 1; }
mail_version=$(sh postfix-env.sh bin/postconf -h mail_version) || exit 1
test "postfix-$mail_version" = "$version" || {
echo "Error: version '$mail_version' in src/global/mail_version.h does not match version in pathname '$(env - pwd)'" 1>&2; exit 1; }
;;
postfix-[0-9]*.[0-9]*-*nonprod*)
grep 'CCARGS.*-DNONPROD' conf/makedefs.out || {
echo "Error: non-prod release builds without -DNONPROD" 1>&2; exit 1; }
mail_version=$(sh postfix-env.sh bin/postconf -h mail_version) || exit 1
test "postfix-$mail_version" = "$version" || {
echo "Error: version '$mail_version' in src/global/mail_version.h does not match version in pathname '$(env - pwd)'" 1>&2; exit 1; }
;;
postfix-[0-9]*.[0-9]*-*)
grep 'CCARGS.*-DNONPROD' conf/makedefs.out && {
echo "Error: snapshot release builds with -DNONPROD" 1>&2; exit 1; }
mail_version=$(sh postfix-env.sh bin/postconf -h mail_version) || exit 1
test "postfix-$mail_version" = "$version" || {
echo "Error: version '$mail_version' in src/global/mail_version.h does not match version in pathname '$(env - pwd)'" 1>&2; exit 1; }
;;
esac