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