From 4503d29e720bc5b35955eb720d5b28aeca7f7551 Mon Sep 17 00:00:00 2001 From: Elias Batek Date: Sat, 27 Jul 2024 05:49:36 +0200 Subject: [PATCH] Add DUB version scraping scripts --- tools/determine-dub-version-of-dmd-release.sh | 25 +++++++++++++++++++ tools/determine-dub-version-of-ldc-release.sh | 13 ++++++++++ 2 files changed, 38 insertions(+) create mode 100755 tools/determine-dub-version-of-dmd-release.sh create mode 100755 tools/determine-dub-version-of-ldc-release.sh diff --git a/tools/determine-dub-version-of-dmd-release.sh b/tools/determine-dub-version-of-dmd-release.sh new file mode 100755 index 0000000..a803a45 --- /dev/null +++ b/tools/determine-dub-version-of-dmd-release.sh @@ -0,0 +1,25 @@ +#!/bin/sh +set -e +if [ -z "$1" ]; then + echo "No DMD version provided." + echo "Usage: ${0} " + exit 1 +fi + +echo "DMD version ${1}" + +# Create temporary directory. +tmpDir=$(mktemp -d) + +# Download + unpack. +curl -Ssf \ + -o "${tmpDir}/dmd.tar.xz" \ + "https://download.dlang.org/releases/2.x/${1}/dmd.${1}.linux.tar.xz" +tar -C $tmpDir \ + -xf "${tmpDir}/dmd.tar.xz" + +# Query DUB for its version. +${tmpDir}/dmd2/linux/bin64/dub --version + +# Cleanup. +rm -rf $tmpDir diff --git a/tools/determine-dub-version-of-ldc-release.sh b/tools/determine-dub-version-of-ldc-release.sh new file mode 100755 index 0000000..7b3bbb3 --- /dev/null +++ b/tools/determine-dub-version-of-ldc-release.sh @@ -0,0 +1,13 @@ +#!/bin/sh +set -e +if [ -z "$1" ]; then + echo "No LDC version provided." + echo "Usage: ${0} " + exit 1 +fi + +echo "v${1} - LDC" + +curl -LSsf \ + "https://github.com/ldc-developers/ldc/raw/v${1}/packaging/dub_version" +echo ' - DUB'