From 7e22c8c43c06d49594e895f4c775164541ae81cb Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Wed, 24 May 2023 07:35:23 +0200 Subject: Revert "revert shallow clone of git sources" This reverts commit f026f3947655aa8cb025a9bd04ee0ba567946c03. --- bin/build-packages | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/bin/build-packages b/bin/build-packages index a5cd235..821491a 100755 --- a/bin/build-packages +++ b/bin/build-packages @@ -492,6 +492,42 @@ while [ "${count}" -ne 0 ] && \ date -u --iso-8601=seconds | \ cut -d+ -f1 ).build-log" + ( # new shell is intentional + set -e + CARCH="${arch}" + . /usr/share/makepkg/util/source.sh + eval "$( + sed ' + :a + s/^\(\S\+\)-/\1_/ + ta + ' PKGBUILD + )" + printf '%s\n' "${source[@]}" \ + | grep '^git+' \ + | while read -r netfile; do + fragment=$(get_uri_fragment "$netfile") + [ -z "${fragment}" ] && continue + case "${fragment%%=*}" in + 'commit'|'tag') + ref="${fragment##*=}" + ;; + 'branch') + ref="origin/${fragment##*=}" + ;; + *) + continue + esac + path=$(get_filename "$netfile") + git init "${path}" + url=$(get_url "$netfile") + url=${url#git+} + url=${url%%#*} + url=${url%%\?*} + git -C "${path}" remote add origin "${url}" + git -C "${path}" fetch --depth=1 origin "${ref}" + done + ) if CARCH="${arch}" makepkg --verifysource 2> "${log_file}"; then success=true rm "${log_file}" -- cgit v1.2.3-70-g09d2