From 866238c99f563caafd1a5cf18cabb0fb52e8bb28 Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Thu, 15 Dec 2005 15:52:08 +0000 Subject: [PATCH] * newinstall.sh: be smarter about how wget and curl are used --- citadel/ChangeLog | 3 +++ citadel/newinstall.sh | 39 +++++++++++++++++++++++++++------------ 2 files changed, 30 insertions(+), 12 deletions(-) diff --git a/citadel/ChangeLog b/citadel/ChangeLog index dbadb02e5..f8023e4f9 100644 --- a/citadel/ChangeLog +++ b/citadel/ChangeLog @@ -1,5 +1,8 @@ $Id$ +Thu Dec 15 10:51:45 EST 2005 ajc +* newinstall.sh: be smarter about how wget and curl are used + Thu Dec 15 00:03:53 EST 2005 ajc * room_ops.c: when granting a room creator access to a new room, omit the lgetuser/lputuser calls because they are not needed. Also, don't perform diff --git a/citadel/newinstall.sh b/citadel/newinstall.sh index 43ebf97ec..babd7cb22 100644 --- a/citadel/newinstall.sh +++ b/citadel/newinstall.sh @@ -122,6 +122,24 @@ die () { } + +download_this () { + if [ -x `which wget` ] ; then + wget $FILENAME >/dev/null 2>>$LOG || die + else + if [ -x `which curl` ] ; then + curl $FILENAME >$FILENAME 2>>$LOG || die + else + echo Unable to find a wget or curl command. + echo Easy Install cannot continue. + die; + fi + fi +} + + + + determine_distribution () { # First look for Red Hat in general if [ -x /bin/rpm ]; then @@ -156,7 +174,7 @@ determine_distribution () { install_ical () { cd $BUILD 2>&1 >>$LOG || die - $WGET $DOWNLOAD_SITE/libical-easyinstall.sum + FILENAME=$DOWNLOAD_SITE/libical-easyinstall.sum ; download_this SUM=`cat libical-easyinstall.sum` SUMFILE=$SUPPORT/etc/libical-easyinstall.sum if [ -r $SUMFILE ] ; then @@ -167,7 +185,7 @@ install_ical () { fi fi echo "* Downloading libical..." - $WGET $DOWNLOAD_SITE/$ICAL_SOURCE 2>&1 >>$LOG || die + FILENAME=$DOWNLOAD_SITE/$ICAL_SOURCE ; download_this echo "* Installing libical..." ( gzip -dc $ICAL_SOURCE | tar -xvf - ) 2>&1 >>$LOG || die cd $BUILD/libical-0.24 2>&1 >>$LOG || die @@ -182,7 +200,7 @@ install_ical () { install_db () { cd $BUILD 2>&1 >>$LOG || die - $WGET $DOWNLOAD_SITE/db-easyinstall.sum + FILENAME=$DOWNLOAD_SITE/db-easyinstall.sum ; download_this SUM=`cat db-easyinstall.sum` SUMFILE=$SUPPORT/etc/db-easyinstall.sum if [ -r $SUMFILE ] ; then @@ -193,7 +211,7 @@ install_db () { fi fi echo "* Downloading Berkeley DB..." - $WGET $DOWNLOAD_SITE/$DB_SOURCE 2>&1 >>$LOG || die + FILENAME=$DOWNLOAD_SITE/$DB_SOURCE ; download_this echo "* Installing Berkeley DB..." ( gzip -dc $DB_SOURCE | tar -xvf - ) 2>&1 >>$LOG || die cd $BUILD/db-4.3.29.NC 2>&1 >>$LOG || die @@ -247,7 +265,7 @@ install_sources () { export CFLAGS CPPFLAGS LDFLAGS DO_INSTALL_CITADEL=yes - $WGET $DOWNLOAD_SITE/citadel-easyinstall.sum + FILENAME=$DOWNLOAD_SITE/citadel-easyinstall.sum ; download_this SUM=`cat citadel-easyinstall.sum` SUMFILE=$CITADEL/citadel-easyinstall.sum if [ -r $SUMFILE ] ; then @@ -260,7 +278,7 @@ install_sources () { if [ $DO_INSTALL_CITADEL = yes ] ; then echo "* Downloading Citadel..." - $WGET $DOWNLOAD_SITE/$CITADEL_SOURCE 2>&1 >>$LOG || die + FILENAME=$DOWNLOAD_SITE/$CITADEL_SOURCE ; download_this echo "* Installing Citadel..." cd $BUILD 2>&1 >>$LOG || die ( gzip -dc $CITADEL_SOURCE | tar -xvf - ) 2>&1 >>$LOG || die @@ -291,7 +309,7 @@ install_sources () { cd $BUILD 2>&1 >>$LOG || die DO_INSTALL_WEBCIT=yes - $WGET $DOWNLOAD_SITE/webcit-easyinstall.sum + FILENAME=$DOWNLOAD_SITE/webcit-easyinstall.sum ; download_this SUM=`cat webcit-easyinstall.sum` SUMFILE=$WEBCIT/webcit-easyinstall.sum if [ -r $SUMFILE ] ; then @@ -304,7 +322,7 @@ install_sources () { if [ $DO_INSTALL_WEBCIT = yes ] ; then echo "* Downloading WebCit..." - $WGET $DOWNLOAD_SITE/$WEBCIT_SOURCE 2>&1 >>$LOG || die + FILENAME=$DOWNLOAD_SITE/$WEBCIT_SOURCE ; download_this echo "* Installing WebCit..." cd $BUILD 2>&1 >>$LOG || die ( gzip -dc $WEBCIT_SOURCE | tar -xvf - ) 2>&1 >>$LOG || die @@ -366,12 +384,9 @@ clear os=`uname` -[ -z "$WGET" ] && [ -x `which wget` ] && WGET=`which wget` -[ -z "$WGET" ] && [ -x `which curl` ] && WGET=`which curl`\ --remote-name echo MAKE is $MAKE -echo WGET is $WGET -export MAKE WGET +export MAKE # 1A. Do we use the native packaging system or build our own copy of Citadel? -- 2.39.2