cpan prompt repairs
authorBill Erickson <berick@esilibrary.com>
Fri, 23 Mar 2012 01:19:47 +0000 (21:19 -0400)
committerBill Erickson <berick@esilibrary.com>
Fri, 23 Mar 2012 01:19:47 +0000 (21:19 -0400)
Signed-off-by: Bill Erickson <berick@esilibrary.com>
installer/squeeze/eg_squeeze_installer.sh

index a68afa9..f24a5d9 100755 (executable)
@@ -27,27 +27,40 @@ ADMIN_PASS='demo123';
 # -----------------------------------------------------------------------
 
 if [ ! "$(grep 'squeeze-backports' /etc/apt/sources.list)" ]; then
-    echo "Please add the following to /etc/apt/sources.list:"
-    echo "deb http://backports.debian.org/debian-backports squeeze-backports main contrib"
+    echo '
+    Please add the following to /etc/apt/sources.list:
+    deb http://backports.debian.org/debian-backports squeeze-backports main contrib
+    '
     exit;
 fi;
 
 
+# -----------------------------------------------------------------------
+# force CPAN to load
+cpan foo
+
 # CPAN follow pre-reqs?
 cpan_policy=$(perl -MCPAN::Config -e 'print $CPAN::Config->{prerequisites_policy}');
 if [ $cpan_policy != 'follow' ]; then
     echo '
+
+-----------------------------------------------------------------------
 The install will go faster if CPAN is configured to automatically install 
 prerequisites.  You can revert the action later with:
 
-% echo -e "o conf prerequisites_policy ask\\n o conf commit" | cpan
-
-Automatically install prereqs? [Y/n] ';
-    read X;
-    if [ "$X" == 'y' -o "$X" == 'Y' ]; then
-        echo -e "o conf prerequisites_policy follow\\n o conf commit" | cpan
-    fi;
+% echo -e "o conf prerequisites_policy ask\n o conf commit" | cpan '
+    while true; do
+        echo -n 'Automatically install prereqs? [Y/n] ';
+        read X;
+        [ "$X" == 'n' -o "$X" == "N" ] && break;
+        if [ "$X" == 'y' -o "$X" == 'Y' ]; then
+            echo -e "o conf prerequisites_policy follow\\n o conf commit" | cpan
+            break;
+        fi;
+    done;
 fi;
+# -----------------------------------------------------------------------
+
 
 # And they're off...
 BASE_DIR=$PWD
@@ -78,7 +91,6 @@ git clone git://git.evergreen-ils.org/Evergreen.git;
 '
 su - opensrf sh -c "$OSRF_COMMAND";
 
-
 # Install pre-reqs
 mkdir -p /usr/src/evergreen; 
 cd /usr/src/evergreen;