diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 17:40:56 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 17:40:56 +0000 |
commit | c248d29056abbc1fc4c5dc178bab48fb8d2c1fcb (patch) | |
tree | 4a13fc30604509224504e1911bc976e5df7bdf05 /get-version.sh | |
parent | Initial commit. (diff) | |
download | libhtp-upstream/1%0.5.47.tar.xz libhtp-upstream/1%0.5.47.zip |
Adding upstream version 1:0.5.47.upstream/1%0.5.47
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rwxr-xr-x | get-version.sh | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/get-version.sh b/get-version.sh new file mode 100755 index 0000000..f962146 --- /dev/null +++ b/get-version.sh @@ -0,0 +1,32 @@ +#!/bin/sh + +# Needed to remove the new line when echoing the version +nl=' +' + +VERSION= + +usage="\ +Usage: $0 version_file +Print a version string. +" + +version_file="$1" +if test -z "$version_file"; then + echo "$usage" + exit 1 +fi +if test -f $version_file; then + . ./$version_file +else + echo "Version file $version_file not found" + exit 1 +fi + +if test -z $PKG_VERSION; then + echo "No version found in $version_file" + exit 1 +fi + +# Omit the trailing newline +echo "$PKG_VERSION" | tr -d "$nl" |