diff options
author | Oto Šťáva <oto.stava@nic.cz> | 2024-08-23 14:57:31 +0200 |
---|---|---|
committer | Aleš Mrázek <ales.mrazek@nic.cz> | 2024-08-26 14:28:10 +0200 |
commit | a8da26abcf9217c437cab31457714e2222f1711b (patch) | |
tree | f23e3e9ebc0e37b3a38bfe3ae85b268061a9b64f /scripts/lib | |
parent | tests/integration/deckard: update to latest master (diff) | |
download | knot-resolver-a8da26abcf9217c437cab31457714e2222f1711b.tar.xz knot-resolver-a8da26abcf9217c437cab31457714e2222f1711b.zip |
scripts: organize into subdirs and clean up unused
Diffstat (limited to 'scripts/lib')
-rwxr-xr-x | scripts/lib/get-date.sh | 14 | ||||
-rwxr-xr-x | scripts/lib/upstream-version.sh | 9 |
2 files changed, 23 insertions, 0 deletions
diff --git a/scripts/lib/get-date.sh b/scripts/lib/get-date.sh new file mode 100755 index 00000000..1480f984 --- /dev/null +++ b/scripts/lib/get-date.sh @@ -0,0 +1,14 @@ +#!/usr/bin/env bash +# SPDX-License-Identifier: GPL-3.0-or-later +set -o nounset +cd "$(dirname $0)/../.." + +# Get date from NEWS if possible (regular release) +DATE=$(head -n1 < NEWS | sed 's/.*(\(.*\)).*/\1/' | grep -E '^[0-9]{4}-[0-9]{2}-[0-9]{2}$$') + +if [[ $? -ne 0 ]]; then + # or use last modification time of NEWS (dev versions) + DATE=$(date -u -r NEWS +%F) +fi + +echo -n $DATE diff --git a/scripts/lib/upstream-version.sh b/scripts/lib/upstream-version.sh new file mode 100755 index 00000000..4efa42db --- /dev/null +++ b/scripts/lib/upstream-version.sh @@ -0,0 +1,9 @@ +#!/usr/bin/env bash +# SPDX-License-Identifier: GPL-3.0-or-later +# +# return latest upstream version of Knot Resolver +set -o errexit + +REPO=https://gitlab.nic.cz/knot/knot-resolver.git + +git ls-remote --tags --refs $REPO | cut -f2- | sed -n "s#^refs/tags/v##p" | sort -V | tail -1 |