Files
eden/tools/cpm/package/util/url.sh
T

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

28 lines
630 B
Bash
Raw Normal View History

2026-06-26 02:22:04 +02:00
#!/bin/sh -e
2025-12-31 17:16:46 +01:00
2026-06-26 02:22:04 +02:00
# SPDX-FileCopyrightText: Copyright 2026 crueter
2025-12-31 17:16:46 +01:00
# SPDX-License-Identifier: LGPL-3.0-or-later
2026-06-26 02:22:04 +02:00
# Get the download URL for a package
2025-12-31 17:16:46 +01:00
if [ "$URL" != "null" ]; then
DOWNLOAD="$URL"
elif [ "$REPO" != "null" ]; then
GIT_URL="https://$GIT_HOST/$REPO"
2026-06-26 02:22:04 +02:00
if [ "$SHA" != "null" ]; then
DOWNLOAD="${GIT_URL}/archive/${SHA}.tar.gz"
elif [ "$TAG" != "null" ]; then
2025-12-31 17:16:46 +01:00
if [ "$ARTIFACT" != "null" ]; then
DOWNLOAD="${GIT_URL}/releases/download/${TAG}/${ARTIFACT}"
else
DOWNLOAD="${GIT_URL}/archive/refs/tags/${TAG}.tar.gz"
fi
fi
else
echo "!! No repo or URL defined for $PACKAGE_NAME"
exit 1
fi
export DOWNLOAD