From: Ian Jackson Date: Tue, 9 Feb 2021 13:03:32 +0000 (+0000) Subject: mg-debian-installer-update: Honour redirect for dtbs X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=90cce22b4ad4b3e444b5c46b2a63180c097346ce;p=osstest.git mg-debian-installer-update: Honour redirect for dtbs When using snapshots, we can get a redirect and then we don't recurse. There doesn't seem to be a suitable option for wget, so do this by hand before we call wget -m. Signed-off-by: Ian Jackson --- diff --git a/mg-debian-installer-update b/mg-debian-installer-update index fb4fe2a..5e890d3 100755 --- a/mg-debian-installer-update +++ b/mg-debian-installer-update @@ -89,7 +89,12 @@ if [ "x$dtbs" != "x" ] ; then # Can't seem to get curl to globs. rm -rf dtbs mkdir dtbs - ( cd dtbs && wget -nv -A README,\*.dtb -nd -nH -np -m $dtbs ) + dtbs_redir="$(curl -sSI -o /dev/null -w '%{redirect_url}' $dtbs)" + if [ "x$dtbs_redir" != x ]; then + dtbs=$dtbs_redir + echo "Redirected for dtbs, to $dtbs" + fi + ( cd dtbs && wget -nv -A README,\*.dtb -nd -nH -np -m "$dtbs" ) tar --mtime=./dtbs/README -cf dtbs.tar dtbs gzip -9nf dtbs.tar fi