pkg: Switch from find -exec to find | xargs

This ensures that the script fails early if one of the subcommands fails
This commit is contained in:
Dorian Stoll 2023-08-01 21:25:36 +02:00
parent 3507e00ec0
commit 01f7028bcf
No known key found for this signature in database
GPG key ID: F1DACD02C619442A
6 changed files with 18 additions and 17 deletions

View file

@ -53,7 +53,7 @@ build-packages)
# Prepare release # Prepare release
mkdir release mkdir release
find . -name '*.pkg.tar.zst' -type f -exec mv {} release \; find . -name '*.pkg.tar.zst' -type f -print0 | xargs -0 -I '{}' mv {} release
popd || exit 1 popd || exit 1
;; ;;
@ -69,8 +69,8 @@ sign-packages)
echo "${GPG_KEY}" | base64 -d | gpg --import --no-tty --batch --yes echo "${GPG_KEY}" | base64 -d | gpg --import --no-tty --batch --yes
# sign packages # sign packages
find . -name '*.pkg.tar.zst' -type f -exec \ find . -name '*.pkg.tar.zst' -type f -print0 | xargs -0 -I '{}' \
gpg --detach-sign --batch --no-tty -u "${GPG_KEY_ID}" {} \; gpg --detach-sign --batch --no-tty -u "${GPG_KEY_ID}" {}
popd || exit 1 popd || exit 1
;; ;;

View file

@ -76,7 +76,8 @@ build-packages)
pushd linux || exit 1 pushd linux || exit 1
# apply surface build/packaging patches # apply surface build/packaging patches
find .. -name '*.patch' -type f -exec git apply --index --reject {} \; find .. -name '*.patch' -type f -print0 | xargs -0 -I '{}' \
git apply --index --reject {}
git add . git add .
git commit --allow-empty -m "Apply linux-surface packaging patches" git commit --allow-empty -m "Apply linux-surface packaging patches"
@ -84,8 +85,8 @@ build-packages)
KERNEL_MAJORVER="${KERNEL_VERSION%.*}" KERNEL_MAJORVER="${KERNEL_VERSION%.*}"
# apply surface patches # apply surface patches
find "../../../../patches/${KERNEL_MAJORVER}" -name '*.patch' -type f -exec \ find "../../../../patches/${KERNEL_MAJORVER}" -name '*.patch' -type f -print0 | xargs -0 -I '{}' \
git apply --index --reject {} \; git apply --index --reject {}
git add . git add .
git commit --allow-empty -m "Apply linux-surface patches" git commit --allow-empty -m "Apply linux-surface patches"
@ -124,8 +125,8 @@ build-packages)
mkdir release mkdir release
find . -name 'linux-libc-dev*.deb' -type f -exec rm {} \; find . -name 'linux-libc-dev*.deb' -type f -print0 | xargs -0 -I '{}' rm {}
find . -name '*.deb' -type f -exec cp {} release \; find . -name '*.deb' -type f -print0 | xargs -0 -I '{}' cp {} release
popd || exit 1 popd || exit 1
;; ;;
@ -141,8 +142,8 @@ sign-packages)
echo "${GPG_KEY}" | base64 -d | gpg --import --no-tty --batch --yes echo "${GPG_KEY}" | base64 -d | gpg --import --no-tty --batch --yes
# sign packages # sign packages
find . -name '*.deb' -type f -exec \ find . -name '*.deb' -type f -print0 | xargs -0 -I '{}' \
dpkg-sig -g "--batch --no-tty" --sign builder -k "${GPG_KEY_ID}" {} \; dpkg-sig -g "--batch --no-tty" --sign builder -k "${GPG_KEY_ID}" {}
popd || exit 1 popd || exit 1
;; ;;

View file

@ -51,8 +51,8 @@ build-packages)
rm -rf kernel-ark rm -rf kernel-ark
# Build binary RPM packages # Build binary RPM packages
find srpm -name '*.src.rpm' -type f -exec rpmbuild -rb \ find srpm -name '*.src.rpm' -type f -print0 | xargs -0 -I '{}' \
--define "_topdir ${PWD}/rpmbuild" --define "_rpmdir ${PWD}/out" {} \; rpmbuild -rb --define "_topdir ${PWD}/rpmbuild" --define "_rpmdir ${PWD}/out" {}
popd || exit 1 popd || exit 1
;; ;;
@ -68,8 +68,8 @@ sign-packages)
echo "${GPG_KEY}" | base64 -d | gpg --import --no-tty --batch --yes echo "${GPG_KEY}" | base64 -d | gpg --import --no-tty --batch --yes
# sign packages # sign packages
find . -name '*.rpm' -type f -exec \ find . -name '*.rpm' -type f -print0 | xargs -0 -I '{}' \
rpm --resign {} --define "_gpg_name ${GPG_KEY_ID}" \; rpm --resign {} --define "_gpg_name ${GPG_KEY_ID}"
popd || exit 1 popd || exit 1
;; ;;

View file

@ -41,7 +41,7 @@ pacman -S base-devel git openssl
git clone -b "${BRANCH_STAGING}" "${REPO}" repo git clone -b "${BRANCH_STAGING}" "${REPO}" repo
# copy packages # copy packages
find arch-latest -type f -exec cp {} repo/arch \; find arch-latest -type f -print0 | xargs -0 -I '{}' cp {} repo/arch
pushd repo/arch || exit 1 pushd repo/arch || exit 1
# convert packages into references # convert packages into references

View file

@ -41,7 +41,7 @@ apt-get install git openssl
git clone -b "${BRANCH_STAGING}" "${REPO}" repo git clone -b "${BRANCH_STAGING}" "${REPO}" repo
# copy packages # copy packages
find debian-latest -type f -exec cp {} repo/debian \; find debian-latest -type f -print0 | xargs -0 -I '{}' cp {} repo/debian
pushd repo/debian || exit 1 pushd repo/debian || exit 1
# convert packages into references # convert packages into references

View file

@ -47,7 +47,7 @@ dnf install git findutils openssl
git clone -b "${BRANCH_STAGING}" "${REPO}" repo git clone -b "${BRANCH_STAGING}" "${REPO}" repo
# copy packages # copy packages
find "fedora-${FEDORA}-latest" -type f -exec cp {} "repo/fedora/f${FEDORA}" \; find "fedora-${FEDORA}-latest" -type f -print0 | xargs -0 -I '{}' cp {} "repo/fedora/f${FEDORA}"
pushd "repo/fedora/f${FEDORA}" || exit 1 pushd "repo/fedora/f${FEDORA}" || exit 1
# convert packages into references # convert packages into references