From 63f79d205109ec894084c9fcb6fa1f248e901947 Mon Sep 17 00:00:00 2001 From: Matt Jenkins Date: Sat, 20 Sep 2025 17:22:39 +0100 Subject: [PATCH] Added git support --- bin/makepkg | 35 ++++++++++++++++++++++++++++------- 1 file changed, 28 insertions(+), 7 deletions(-) diff --git a/bin/makepkg b/bin/makepkg index 38c90d4..7a9dd76 100755 --- a/bin/makepkg +++ b/bin/makepkg @@ -54,17 +54,38 @@ mkdir -p "${SRCDIR}" mkdir -p "${DESTDIR}" mkdir -p "${PKGDIR}" + +URL_PROTO=`echo "$URL" | cut -f1 -d':'` + download() { - ( cd "${SRCDIR}" && /usr/sfw/bin/wget -c "${URL}" ) + cd "${SRCDIR}" + + case $URL_PROTO in + http|https|ftp) + /usr/sfw/bin/wget -c "${URL}" + ;; + git) + P=`echo "${URL}" | cut -f2 -d':'` + H=`echo "$P" | cut -f1 -d'@'` + T=`echo "$P" | cut -f2 -d'@'` + git clone --depth 1 --branch "$T" https:$H "${PACKAGE}-${VERSION}" + cd "${PACKAGE}-${VERSION}" + git submodule init && git submodule update + ;; + esac + + cd "${HERE}" } extract() { - printf "Extracting ${SRC} ... " - ( - cd "${SRCDIR}" - gzip -d < "${SRC}" | tar xf - - ) - echo "done" + if [ "$URL_PROTO" != "git" ]; then + printf "Extracting ${SRC} ... " + ( + cd "${SRCDIR}" + gzip -d < "${SRC}" | tar xf - + ) + echo "done" + fi } package() {