xref: /freebsd/contrib/ntp/scripts/build/VersionName (revision 0b3105a37d7adcadcb720112fed4dc4e8040be99)
1#! /bin/sh
2
3packageinfo='./packageinfo.sh'
4case "$#" in
5 2)
6    case "$1" in
7     -p|--packageinfo)
8	packageinfo="$2"
9    esac
10    ;;
11 0)
12    ;;
13 *) echo "Usage: $0 [-p packageinfo.sh]"
14    exit 1
15    ;;
16esac
17
18# This script must be executed from the TLD of the source tree...
19. "$packageinfo"
20
21NAME="$version"
22case "$repotype::$point" in
23 dev::)
24    case "${proto}.${major}" in
25     4.[012])
26	NAME="${NAME}p${point}"
27        ;;
28     *) NAME="${NAME}"
29        ;;
30    esac
31    ;;
32 stable::[1-9]* | dev::[0-9]*)
33    case "${proto}.${major}" in
34     4.[012])
35	NAME="${NAME}p${point}"
36        ;;
37     *) NAME="${NAME}.${point}"
38        ;;
39    esac
40    ;;
41 NEW) ;;
42 '') ;;
43 *) echo "Unexpected value for 'point' <$point>! (repotype is <$repotype>)"
44    exit 1
45    ;;
46esac
47
48case $special in
49 '') ;;
50 *) NAME="${NAME}-${special}" ;;
51esac
52
53case "$prerelease::$repotype" in
54 ''::*)
55    ;;
56 beta::stable)
57    NAME="${NAME}-beta${betapoint}"
58    ;;
59 rc::dev|RC::dev)
60    NAME="${NAME}-RC"
61    ;;
62 rc::stable|RC::stable)
63    NAME="${NAME}-RC${rcpoint}"
64    ;;
65 *) echo "Unexpected value for 'prerelease::repotype' <$prerelease::$repotype>!"
66    exit 1
67    ;;
68esac
69
70echo "$NAME"
71