diff options
author | Mihai Moldovan <ionic@ionic.de> | 2017-12-15 12:55:17 +0100 |
---|---|---|
committer | Mihai Moldovan <ionic@ionic.de> | 2017-12-15 12:55:17 +0100 |
commit | 1dad092caf01d733990648e6df64cbf964df5143 (patch) | |
tree | 39de0e643e76754a3e23ca9dd0350b8ba4f76250 /version.sh | |
parent | 6d70b9e3c47f27a166f4aacb522c5c1e49092dd9 (diff) | |
parent | 2b9025f797ee322e21077e100c2ee27c2e7fa0e0 (diff) | |
download | nx-libs-1dad092caf01d733990648e6df64cbf964df5143.tar.gz nx-libs-1dad092caf01d733990648e6df64cbf964df5143.tar.bz2 nx-libs-1dad092caf01d733990648e6df64cbf964df5143.zip |
Merge branch '3.6.x'
Diffstat (limited to 'version.sh')
-rwxr-xr-x | version.sh | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/version.sh b/version.sh new file mode 100755 index 000000000..891536890 --- /dev/null +++ b/version.sh @@ -0,0 +1,34 @@ +#!/bin/sh + +# Copyright (C) 2015 Mihai Moldovan <ionic@ionic.de> +# Copyright (C) 2015 Mike Gabriel <mike.gabriel@das-netzwerkteam.de> +# +# This program 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 2 of the License, or +# (at your option) any later version. +# +# This program 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 this program; if not, write to the +# Free Software Foundation, Inc., +# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. + +COMPONENT="$1" +VERSION_FILE="VERSION" + +case "${COMPONENT}" in + (1|2|3|4) :;; + (*) echo "usage: $(basename ${0}) <position-in-version-number>" >&2; exit 1;; +esac + +# More than one line is not supported. +VER="$(head -n "1" "${VERSION_FILE}" | cut -d"." -f"${COMPONENT}")" + +[ "x${VER}" = "x" ] && VER="0" + +printf "${VER}" |