r14724 - gnucash/trunk - Be smarter about handling partially completed builds.

Derek Atkins warlord at cvs.gnucash.org
Fri Aug 25 21:48:48 EDT 2006


Author: warlord
Date: 2006-08-25 21:48:48 -0400 (Fri, 25 Aug 2006)
New Revision: 14724
Trac: http://svn.gnucash.org/trac/changeset/14724

Modified:
   gnucash/trunk/
   gnucash/trunk/packaging/win32/install.sh
Log:
Be smarter about handling partially completed builds.
- Don't die when wget has already downloaded the file.
- add some more output during the auto-tools



Property changes on: gnucash/trunk
___________________________________________________________________
Name: svk:merge
   - d2ab10a8-8a95-4986-baff-8d511d9f15b2:/local/gnucash/trunk:13124
   + d2ab10a8-8a95-4986-baff-8d511d9f15b2:/local/gnucash/trunk:13126

Modified: gnucash/trunk/packaging/win32/install.sh
===================================================================
--- gnucash/trunk/packaging/win32/install.sh	2006-08-26 01:23:45 UTC (rev 14723)
+++ gnucash/trunk/packaging/win32/install.sh	2006-08-26 01:48:48 UTC (rev 14724)
@@ -87,6 +87,22 @@
     TMP_UDIR=`unix_path $TMP_DIR`
 }
 
+# usage:  smart_wget URL DESTDIR
+function smart_wget() {
+    _FILE=`basename $1`
+    _DLD=`unix_path $2`
+    _TMP=`unix_path $TMP_DIR`
+
+    # If the file already exists in the download directory ($2)
+    # then don't do anything.  But if it does NOT exist then
+    # download the file to the tmpdir and then when that completes
+    # move it to the dest dir.
+    if [ ! -f $_DLD/$_FILE ] ; then
+	wget -c $1 -P $TMP_DIR
+	mv $_TMP/$_FILE $_DLD
+    fi
+}
+
 function inst_wget() {
     setup Wget
     _WGET_UDIR=`unix_path $WGET_DIR`
@@ -114,7 +130,7 @@
         echo "msys dtk already installed.  skipping."
     else
         set -e
-        wget -c $DTK_URL -P $DOWNLOAD_DIR
+        smart_wget $DTK_URL $DOWNLOAD_DIR
         echo "!!! The path must be: $MSYS_DIR !!!"
         $DOWNLOAD_UDIR/msysDTK-*.exe
         for file in \
@@ -137,7 +153,7 @@
     else
         set -e
         _MINGW_WFSDIR=`win_fs_path $MINGW_DIR`
-        wget -c $MINGW_URL -P $DOWNLOAD_DIR
+        smart_wget $MINGW_URL $DOWNLOAD_DIR
         echo "!!! Install g++ !!!"
         echo "!!! The path must be: $MINGW_DIR !!!"
         $DOWNLOAD_UDIR/MinGW-*.exe
@@ -156,7 +172,7 @@
         echo "unzip already installed.  skipping."
     else
         set -e
-        wget -c $UNZIP_URL -P $DOWNLOAD_DIR
+        smart_wget $UNZIP_URL $DOWNLOAD_DIR
         echo "!!! The path must be: $UNZIP_DIR !!!"
         $DOWNLOAD_UDIR/unzip-*.exe
     fi
@@ -177,8 +193,8 @@
         echo "regex already installed.  skipping."
     else
         set -e
-        wget -c $REGEX_BIN_URL -P $DOWNLOAD_DIR
-        wget -c $REGEX_LIB_URL -P $DOWNLOAD_DIR
+        smart_wget $REGEX_BIN_URL $DOWNLOAD_DIR
+        smart_wget $REGEX_LIB_URL $DOWNLOAD_DIR
         mkdir -p $REGEX_DIR
         unzip $DOWNLOAD_UDIR/regex-*-bin.zip -d $REGEX_DIR
         unzip $DOWNLOAD_UDIR/regex-*-lib.zip -d $REGEX_DIR
@@ -200,8 +216,8 @@
         echo "readline already installed.  skipping."
     else
         set -e
-        wget -c $READLINE_BIN_URL -P $DOWNLOAD_DIR
-        wget -c $READLINE_LIB_URL -P $DOWNLOAD_DIR
+        smart_wget $READLINE_BIN_URL $DOWNLOAD_DIR
+        smart_wget $READLINE_LIB_URL $DOWNLOAD_DIR
         mkdir -p $READLINE_DIR
         unzip $DOWNLOAD_DIR/readline-*-bin.zip -d $READLINE_DIR
         unzip $DOWNLOAD_DIR/readline-*-lib.zip -d $READLINE_DIR
@@ -221,7 +237,7 @@
         echo "indent already installed.  skipping."
     else
         set -e
-        wget -c $INDENT_BIN_URL -P $DOWNLOAD_DIR
+        smart_wget $INDENT_BIN_URL $DOWNLOAD_DIR
         mkdir -p $INDENT_DIR
         unzip $DOWNLOAD_UDIR/indent-*-bin.zip -d $INDENT_DIR
     fi
@@ -242,8 +258,8 @@
         echo "guile and slib already installed.  skipping."
     else
         set -e
-        wget -c $GUILE_URL -P $DOWNLOAD_DIR
-        wget -c $SLIB_URL -P $DOWNLOAD_DIR
+        smart_wget $GUILE_URL $DOWNLOAD_DIR
+        smart_wget $SLIB_URL $DOWNLOAD_DIR
         tar -xzpf $DOWNLOAD_UDIR/guile-*.tar.gz -C $TMP_UDIR
         qpushd $TMP_UDIR/guile-*
             qpushd ice-9
@@ -312,7 +328,7 @@
         echo "glade already installed.  skipping."
     else
         set -e
-        wget -c $GLADE_URL -P $DOWNLOAD_DIR
+        smart_wget $GLADE_URL $DOWNLOAD_DIR
 	echo "!!! The path must be: $GLADE_DIR !!!"
 	$DOWNLOAD_UDIR/gtk-win32-devel-*.exe
 	qpushd $GLADE_DIR\\lib\\pkgconfig
@@ -339,7 +355,7 @@
         echo "g-wrap already installed.  skipping."
     else
         set -e
-        wget -c $GWRAP_URL -P $DOWNLOAD_DIR
+        smart_wget $GWRAP_URL $DOWNLOAD_DIR
         tar -xzpf $DOWNLOAD_UDIR/g-wrap-*.tar.gz -C $TMP_UDIR
         qpushd $TMP_UDIR/g-wrap-*
             qpushd g-wrap
@@ -388,29 +404,29 @@
     else
         set -e
         mkdir -p $GNOME_DIR
-	wget -c $INTLTOOL_URL -P $DOWNLOAD_DIR
-	wget -c $ORBIT2_URL -P $DOWNLOAD_DIR
-	wget -c $ORBIT2_DEV_URL -P $DOWNLOAD_DIR
-	wget -c $GCONF_URL -P $DOWNLOAD_DIR
-	wget -c $GCONF_DEV_URL -P $DOWNLOAD_DIR
-	wget -c $LIBBONOBO_URL -P $DOWNLOAD_DIR
-	wget -c $LIBBONOBO_DEV_URL -P $DOWNLOAD_DIR
-	wget -c $GNOME_VFS_URL -P $DOWNLOAD_DIR
-	wget -c $GNOME_VFS_DEV_URL -P $DOWNLOAD_DIR
-	wget -c $LIBGNOME_URL -P $DOWNLOAD_DIR
-	wget -c $LIBGNOME_DEV_URL -P $DOWNLOAD_DIR
-	wget -c $LIBGNOMECANVAS_URL -P $DOWNLOAD_DIR
-	wget -c $LIBGNOMECANVAS_DEV_URL -P $DOWNLOAD_DIR
-	wget -c $LIBBONOBOUI_URL -P $DOWNLOAD_DIR
-	wget -c $LIBBONOBOUI_DEV_URL -P $DOWNLOAD_DIR
-	wget -c $LIBGNOMEUI_URL -P $DOWNLOAD_DIR
-	wget -c $LIBGNOMEUI_DEV_URL -P $DOWNLOAD_DIR
-	wget -c $LIBGNOMEPRINT_URL -P $DOWNLOAD_DIR
-	wget -c $LIBGNOMEPRINT_DEV_URL -P $DOWNLOAD_DIR
-	wget -c $LIBGNOMEPRINTUI_URL -P $DOWNLOAD_DIR
-	wget -c $LIBGNOMEPRINTUI_DEV_URL -P $DOWNLOAD_DIR
-	wget -c $GTKHTML_URL -P $DOWNLOAD_DIR
-	wget -c $GTKHTML_DEV_URL -P $DOWNLOAD_DIR
+	smart_wget $INTLTOOL_URL $DOWNLOAD_DIR
+	smart_wget $ORBIT2_URL $DOWNLOAD_DIR
+	smart_wget $ORBIT2_DEV_URL $DOWNLOAD_DIR
+	smart_wget $GCONF_URL $DOWNLOAD_DIR
+	smart_wget $GCONF_DEV_URL $DOWNLOAD_DIR
+	smart_wget $LIBBONOBO_URL $DOWNLOAD_DIR
+	smart_wget $LIBBONOBO_DEV_URL $DOWNLOAD_DIR
+	smart_wget $GNOME_VFS_URL $DOWNLOAD_DIR
+	smart_wget $GNOME_VFS_DEV_URL $DOWNLOAD_DIR
+	smart_wget $LIBGNOME_URL $DOWNLOAD_DIR
+	smart_wget $LIBGNOME_DEV_URL $DOWNLOAD_DIR
+	smart_wget $LIBGNOMECANVAS_URL $DOWNLOAD_DIR
+	smart_wget $LIBGNOMECANVAS_DEV_URL $DOWNLOAD_DIR
+	smart_wget $LIBBONOBOUI_URL $DOWNLOAD_DIR
+	smart_wget $LIBBONOBOUI_DEV_URL $DOWNLOAD_DIR
+	smart_wget $LIBGNOMEUI_URL $DOWNLOAD_DIR
+	smart_wget $LIBGNOMEUI_DEV_URL $DOWNLOAD_DIR
+	smart_wget $LIBGNOMEPRINT_URL $DOWNLOAD_DIR
+	smart_wget $LIBGNOMEPRINT_DEV_URL $DOWNLOAD_DIR
+	smart_wget $LIBGNOMEPRINTUI_URL $DOWNLOAD_DIR
+	smart_wget $LIBGNOMEPRINTUI_DEV_URL $DOWNLOAD_DIR
+	smart_wget $GTKHTML_URL $DOWNLOAD_DIR
+	smart_wget $GTKHTML_DEV_URL $DOWNLOAD_DIR
 	unzip $DOWNLOAD_UDIR/intltool-*.zip -d $GNOME_DIR
 	unzip $DOWNLOAD_UDIR/ORBit2-[^d]*.zip -d $GNOME_DIR
 	unzip $DOWNLOAD_UDIR/ORBit2-dev-*.zip -d $GNOME_DIR
@@ -452,23 +468,26 @@
         echo "auto tools already installed.  skipping."
     else
         set -e
-        wget -c $AUTOCONF_URL -P $DOWNLOAD_DIR
-        wget -c $AUTOMAKE_URL -P $DOWNLOAD_DIR
-        wget -c $LIBTOOL_URL -P $DOWNLOAD_DIR
+        smart_wget $AUTOCONF_URL $DOWNLOAD_DIR
+        smart_wget $AUTOMAKE_URL $DOWNLOAD_DIR
+        smart_wget $LIBTOOL_URL $DOWNLOAD_DIR
         tar -xjpf $DOWNLOAD_UDIR/autoconf-*.tar.bz2 -C $TMP_UDIR
         qpushd $TMP_UDIR/autoconf-*
+	    echo "building autoconf..."
            ./configure --prefix=$_AUTOTOOLS_UDIR
             make
             make install
         qpopd
         tar -xjpf $DOWNLOAD_UDIR/automake-*.tar.bz2 -C $TMP_UDIR
         qpushd $TMP_UDIR/automake-*
+	    echo "building automake..."
             ./configure --prefix=$_AUTOTOOLS_UDIR
             make
             make install
         qpopd
         tar -xzpf $DOWNLOAD_UDIR/libtool-*.tar.gz -C $TMP_UDIR
         qpushd $TMP_UDIR/libtool-*
+	    echo "building libtool..."
             ./configure --prefix=$_AUTOTOOLS_UDIR
             make
             make install
@@ -493,7 +512,7 @@
         echo "subversion already installed.  skipping."
     else
         set -e
-        wget -c $SVN_URL -P $DOWNLOAD_DIR
+        smart_wget $SVN_URL $DOWNLOAD_DIR
         echo "!!! The path must be: $SVN_DIR !!!"
         $DOWNLOAD_UDIR/svn-*.exe
     fi



More information about the gnucash-changes mailing list