freebsd-dev/contrib/ntp/scripts/build/VersionName
Cy Schubert 2b15cb3d09 MFV ntp 4.2.8p1 (r258945, r275970, r276091, r276092, r276093, r278284)
Thanks to roberto for providing pointers to wedge this into HEAD.

Approved by:	roberto
2015-03-30 13:30:15 +00:00

71 lines
1.1 KiB
Bash
Executable File

#! /bin/sh
packageinfo='./packageinfo.sh'
case "$#" in
2)
case "$1" in
-p|--packageinfo)
packageinfo="$2"
esac
;;
0)
;;
*) echo "Usage: $0 [-p packageinfo.sh]"
exit 1
;;
esac
# This script must be executed from the TLD of the source tree...
. "$packageinfo"
NAME="$version"
case "$repotype::$point" in
dev::)
case "${proto}.${major}" in
4.[012])
NAME="${NAME}p${point}"
;;
*) NAME="${NAME}"
;;
esac
;;
stable::[1-9]* | dev::[0-9]*)
case "${proto}.${major}" in
4.[012])
NAME="${NAME}p${point}"
;;
*) NAME="${NAME}.${point}"
;;
esac
;;
NEW) ;;
'') ;;
*) echo "Unexpected value for 'point' <$point>! (repotype is <$repotype>)"
exit 1
;;
esac
case $special in
'') ;;
*) NAME="${NAME}-${special}" ;;
esac
case "$prerelease::$repotype" in
''::*)
;;
beta::stable)
NAME="${NAME}-beta${betapoint}"
;;
rc::dev|RC::dev)
NAME="${NAME}-RC"
;;
rc::stable|RC::stable)
NAME="${NAME}-RC${rcpoint}"
;;
*) echo "Unexpected value for 'prerelease::repotype' <$prerelease::$repotype>!"
exit 1
;;
esac
echo "$NAME"