]> jfr.im git - irc/weechat/weechat.git/blob - version.sh
core: add CVE id in ChangeLog
[irc/weechat/weechat.git] / version.sh
1 #!/bin/sh
2 #
3 # Copyright (C) 2015-2020 Sébastien Helleu <flashcode@flashtux.org>
4 #
5 # This file is part of WeeChat, the extensible chat client.
6 #
7 # WeeChat is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 3 of the License, or
10 # (at your option) any later version.
11 #
12 # WeeChat is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License for more details.
16 #
17 # You should have received a copy of the GNU General Public License
18 # along with WeeChat. If not, see <https://www.gnu.org/licenses/>.
19 #
20
21 #
22 # Returns current stable or devel version of WeeChat.
23 #
24 # Syntax:
25 # version.sh stable|devel|devel-full|devel-major|devel-minor|devel-patch
26 #
27 # stable the current stable (e.g. 1.3)
28 # devel the current devel (e.g. 1.4)
29 # devel-full the full name of devel (e.g. 1.4-dev or 1.4-rc1)
30 # devel-major the major version of devel (e.g. 1)
31 # devel-minor the minor version of devel (e.g. 4-dev)
32 # devel-patch the patch version of devel (e.g. 2 for version 1.4.2)
33 #
34
35 WEECHAT_STABLE=3.0.1
36 WEECHAT_DEVEL=3.0.2
37 WEECHAT_DEVEL_FULL=3.0.2-dev
38
39 if [ $# -lt 1 ]; then
40 echo >&2 "Syntax: $0 stable|devel|devel-full|devel-major|devel-minor|devel-patch"
41 exit 1
42 fi
43
44 case $1 in
45 stable ) echo $WEECHAT_STABLE ;;
46 devel ) echo $WEECHAT_DEVEL ;;
47 devel-full ) echo $WEECHAT_DEVEL_FULL ;;
48 devel-major ) echo $WEECHAT_DEVEL_FULL | cut -d'.' -f1 ;;
49 devel-minor ) echo $WEECHAT_DEVEL_FULL | cut -d'.' -f2 ;;
50 devel-patch ) echo $WEECHAT_DEVEL_FULL | cut -d'.' -f3- ;;
51 * ) echo >&2 "ERROR: unknown version."
52 exit 1 ;;
53 esac