Home | History | Annotate | Line # | Download | only in mantools
check-snapshot-nonprod revision 1.1
      1  1.1  christos #!/bin/sh
      2  1.1  christos 
      3  1.1  christos version=$(basename $(env - pwd)) || exit 1
      4  1.1  christos case "$version" in
      5  1.1  christos postfix-[0-9]*.[0-9]*.[0-9]*) 
      6  1.1  christos     test -f conf/makedefs.out || {
      7  1.1  christos 	echo "Error: no conf/makedefs.out" 1>&2; exit 1; }
      8  1.1  christos     grep 'CCARGS.*-DSNAPSHOT' conf/makedefs.out && {
      9  1.1  christos 	echo "Error: stable release builds with -DSNAPSHOT" 1>&2; exit 1; }
     10  1.1  christos     grep 'CCARGS.*-DNONPROD' conf/makedefs.out && {
     11  1.1  christos 	echo "Error: stable release builds with -DNONPROD" 1>&2; exit 1; }
     12  1.1  christos     mail_version=$(sh postfix-env.sh bin/postconf -h mail_version) || exit 1
     13  1.1  christos     test "postfix-$mail_version" = "$version" || {
     14  1.1  christos 	echo "Error: version '$mail_version' in src/global/mail_version.h does not match version in pathname '$(env - pwd)'" 1>&2; exit 1; }
     15  1.1  christos     ;;
     16  1.1  christos postfix-[0-9]*.[0-9]*-*nonprod*)
     17  1.1  christos     grep 'CCARGS.*-DNONPROD' conf/makedefs.out || {
     18  1.1  christos 	echo "Error: non-prod release builds without -DNONPROD" 1>&2; exit 1; }
     19  1.1  christos     mail_version=$(sh postfix-env.sh bin/postconf -h mail_version) || exit 1
     20  1.1  christos     test "postfix-$mail_version" = "$version" || {
     21  1.1  christos 	echo "Error: version '$mail_version' in src/global/mail_version.h does not match version in pathname '$(env - pwd)'" 1>&2; exit 1; }
     22  1.1  christos     ;;
     23  1.1  christos postfix-[0-9]*.[0-9]*-*)
     24  1.1  christos     grep 'CCARGS.*-DNONPROD' conf/makedefs.out && {
     25  1.1  christos 	echo "Error: snapshot release builds with -DNONPROD" 1>&2; exit 1; }
     26  1.1  christos     mail_version=$(sh postfix-env.sh bin/postconf -h mail_version) || exit 1
     27  1.1  christos     test "postfix-$mail_version" = "$version" || {
     28  1.1  christos 	echo "Error: version '$mail_version' in src/global/mail_version.h does not match version in pathname '$(env - pwd)'" 1>&2; exit 1; }
     29  1.1  christos     ;;
     30  1.1  christos esac
     31