prefer curl: presumably more portable and versatile;
authorwenzelm
Thu, 14 Jul 2016 12:20:20 +0200
changeset 63490 9416333a17c2
parent 63489 cd540c8031a4
child 63491 58ccbc73a172
prefer curl: presumably more portable and versatile;
Admin/lib/Tools/makedist_bundle
Admin/lib/Tools/makedist_cygwin
README_REPOSITORY
lib/Tools/components
--- a/Admin/lib/Tools/makedist_bundle	Thu Jul 14 11:34:18 2016 +0200
+++ b/Admin/lib/Tools/makedist_bundle	Thu Jul 14 12:20:20 2016 +0200
@@ -113,9 +113,11 @@
                 echo "  component $COMPONENT"
                 CONTRIB="$ARCHIVE_DIR/contrib/${COMPONENT}.tar.gz"
                 if [ ! -f "$CONTRIB" ]; then
+                  type -p curl  > /dev/null || fail "Cannot download files: missing curl"
                   REMOTE="$ISABELLE_COMPONENT_REPOSITORY/${COMPONENT}.tar.gz"
-                  echo "  download $REMOTE"
-                  perl -MLWP::Simple -e "getprint '$REMOTE';" > "$CONTRIB"
+                  echo "  downloading $REMOTE"
+                  curl --fail --silent "$REMOTE" > "$CONTRIB" || \
+                    fail "Failed to download \"$REMOTE\""
                   perl -e "exit((stat('${CONTRIB}'))[7] == 0 ? 0 : 1);" && exit 2
                 fi
 
--- a/Admin/lib/Tools/makedist_cygwin	Thu Jul 14 11:34:18 2016 +0200
+++ b/Admin/lib/Tools/makedist_cygwin	Thu Jul 14 12:20:20 2016 +0200
@@ -43,7 +43,9 @@
 [ ! -e "$TARGET" ] || fail "Target already exists: \"$TARGET\""
 mkdir -p "$TARGET/isabelle" || fail "Failed to create target directory: \"$TARGET\""
 
-perl -MLWP::Simple -e "getprint '$CYGWIN_MIRROR/setup-x86.exe';" > "$TARGET/isabelle/cygwin.exe"
+type -p curl > /dev/null || fail "Cannot download files: missing curl"
+curl --fail --silent "$CYGWIN_MIRROR/setup-x86.exe" > "$TARGET/isabelle/cygwin.exe" || \
+  fail "Failed to download \"$CYGWIN_MIRROR/setup-x86.exe\""
 chmod +x "$TARGET/isabelle/cygwin.exe"
 
 "$TARGET/isabelle/cygwin.exe" -h </dev/null >/dev/null || exit 2
@@ -55,7 +57,7 @@
   --site "$CYGWIN_MIRROR" --no-verify \
   --local-package-dir 'C:\temp' \
   --root "$(cygpath -w "$TARGET")" \
-  --packages perl,perl-libwww-perl,rlwrap,unzip,nano \
+  --packages curl,nano,perl,perl-libwww-perl,rlwrap,unzip \
   --no-shortcuts --no-startmenu --no-desktop --quiet-mode
 
 [ "$?" = 0 -a -e "$TARGET/etc" ] || exit 2
--- a/README_REPOSITORY	Thu Jul 14 11:34:18 2016 +0200
+++ b/README_REPOSITORY	Thu Jul 14 12:20:20 2016 +0200
@@ -4,11 +4,11 @@
 Quick start in 30min
 --------------------
 
-1a. Linux and Mac OS X: ensure that Perl (with libwww) and Mercurial (hg)
-    is installed (see also http://www.selenic.com/mercurial)
+1a. Linux and Mac OS X: ensure that Mercurial is installed
+    (see also http://www.selenic.com/mercurial)
 
-1b. Windows: ensure that Cygwin with Perl and Mercurial is installed (see
-    also http://www.cygwin.com)
+1b. Windows: ensure that Cygwin with curl and Mercurial is installed
+    (see also http://www.cygwin.com)
 
 2. Clone repository (bash shell commands):
 
--- a/lib/Tools/components	Thu Jul 14 11:34:18 2016 +0200
+++ b/lib/Tools/components	Thu Jul 14 12:20:20 2016 +0200
@@ -124,9 +124,11 @@
     else
       if [ ! -e "${FULL_NAME}.tar.gz" ]; then
         REMOTE="$COMPONENT_REPOSITORY/${BASE_NAME}.tar.gz"
+        type -p curl > /dev/null || fail "Cannot download files: missing curl"
         echo "Getting \"$REMOTE\""
         mkdir -p "$(dirname "$FULL_NAME")"
-        perl -MLWP::Simple -e "getprint '$REMOTE';" > "${FULL_NAME}.tar.gz"
+        curl --fail --silent "$REMOTE" > "${FULL_NAME}.tar.gz" || \
+          fail "Failed to download \"$REMOTE\""
         if perl -e "exit((stat('${FULL_NAME}.tar.gz'))[7] == 0 ? 0 : 1);"
         then
           rm -f "${FULL_NAME}.tar.gz"