r19094 - gnucash/trunk/packaging/win32 - Add (optional) destination file name parameter to wget_unpacked and smart_wget functions.

Geert Janssens gjanssens at code.gnucash.org
Mon May 3 15:50:12 EDT 2010


Author: gjanssens
Date: 2010-05-03 15:50:12 -0400 (Mon, 03 May 2010)
New Revision: 19094
Trac: http://svn.gnucash.org/trac/changeset/19094

Modified:
   gnucash/trunk/packaging/win32/functions.sh
Log:
Add (optional) destination file name parameter to wget_unpacked and smart_wget functions.
This parameter can be used to override the filename to be used for the downloaded package. If empty, the functions continue to work as before.

This new option will be used for cross compilation.

Modified: gnucash/trunk/packaging/win32/functions.sh
===================================================================
--- gnucash/trunk/packaging/win32/functions.sh	2010-05-02 23:18:04 UTC (rev 19093)
+++ gnucash/trunk/packaging/win32/functions.sh	2010-05-03 19:50:12 UTC (rev 19094)
@@ -47,11 +47,11 @@
     qpopd
 }
 
-# usage:  smart_wget URL DESTDIR
+# usage:  smart_wget URL DESTDIR [DESTFILE]
 function smart_wget() {
     _FILE=`basename $1`
     # Remove url garbage from filename that would not be removed by wget
-    _UFILE=${_FILE##*=}
+    _UFILE=${3:-${_FILE##*=}}
     _DLD=`unix_path $2`
 
     # If the file already exists in the download directory ($2)
@@ -70,9 +70,9 @@
     LAST_FILE=$_DLD/$_UFILE
 }
 
-# usage:  wget_unpacked URL DOWNLOAD_DIR UNPACK_DIR
+# usage:  wget_unpacked URL DOWNLOAD_DIR UNPACK_DIR [DESTFILE]
 function wget_unpacked() {
-    smart_wget $1 $2
+    smart_wget $1 $2 $4
     _EXTRACT_UDIR=`unix_path $3`
     _EXTRACT_SUBDIR=
     echo -n "Extracting $_UFILE ... "



More information about the gnucash-changes mailing list