diff options
author | Rafael G. Martins <rafael@rafaelmartins.eng.br> | 2022-02-13 15:42:33 +0100 |
---|---|---|
committer | Rafael G. Martins <rafael@rafaelmartins.eng.br> | 2022-02-13 15:42:38 +0100 |
commit | 5c825231aaf28abd3f1fd020bcb1ebaebc4e7f9b (patch) | |
tree | 5f624cca40a018cc14fb9faea2f56c6259c16108 | |
parent | cb0e788e98482b3cbf983bbecfb802a9cfaf2447 (diff) | |
download | blogc-5c825231aaf28abd3f1fd020bcb1ebaebc4e7f9b.tar.gz blogc-5c825231aaf28abd3f1fd020bcb1ebaebc4e7f9b.tar.bz2 blogc-5c825231aaf28abd3f1fd020bcb1ebaebc4e7f9b.zip |
build: debian: always build against same source file
this will avoid problems with debian source repositories.
-rwxr-xr-x | build-aux/build-debian.sh | 36 |
1 files changed, 31 insertions, 5 deletions
diff --git a/build-aux/build-debian.sh b/build-aux/build-debian.sh index 048912a..f96336e 100755 --- a/build-aux/build-debian.sh +++ b/build-aux/build-debian.sh @@ -50,6 +50,36 @@ download_pbuilder_chroot() { popd > /dev/null } +download_orig() { + local i=0 + local out=0 + local url="https://distfiles.rgm.io/${PN}/${P}/${P}.tar.xz" + + while [[ $i -lt 20 ]]; do + set +ex + ((i++)) + echo "waiting for ${P}.tar.xz: $i/20" + wget -q --spider --tries 1 "${url}" + out=$? + set -ex + + if [[ $out -eq 0 ]]; then + wget -c "${url}" + mv "${P}.tar.xz" "${BUILDDIR}/${MY_P}.orig.tar.xz" + return + fi + + if [[ $out -ne 8 ]]; then + exit $out + fi + + sleep 30 + done + + echo "failed to find orig distfile. please check if that task succeeded." + exit 1 +} + create_reprepro_conf() { echo "Origin: blogc" echo "Label: blogc" @@ -60,11 +90,7 @@ create_reprepro_conf() { echo } -${MAKE_CMD:-make} dist-xz - -MY_P="${PN}_${PV}" - -mv ${P}.tar.xz "${BUILDDIR}/${MY_P}.orig.tar.xz" +download_orig rm -rf "${BUILDDIR}/${P}" tar -xf "${BUILDDIR}/${MY_P}.orig.tar.xz" -C "${BUILDDIR}" |