[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[OSSTEST PATCH 1/7] 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 <iwj@xxxxxxxxxxxxxx>
---
 mg-debian-installer-update | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/mg-debian-installer-update b/mg-debian-installer-update
index fb4fe2ab..5e890d34 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
-- 
2.20.1




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.