Reworked the download script. The actual list of packages is now taken from
authorWerner Koch <wk@gnupg.org>
Tue, 29 Nov 2005 10:44:16 +0000 (10:44 +0000)
committerWerner Koch <wk@gnupg.org>
Tue, 29 Nov 2005 10:44:16 +0000 (10:44 +0000)
the server.

ChangeLog
TODO
packages/Makefile.am
packages/download.sh
packages/packages.current [new file with mode: 0644]
packages/packages.keys [new file with mode: 0644]
src/inst-sections.nsi

index 911bbe2..4a1411f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2005-11-29  Werner Koch  <wk@g10code.com>
+
+       * packages/packages.current: New.  This is more or less a
+       template; the version on the server may be updated without syncing
+       it to this version.
+       * packages/packages.keys: New.
+       * packages/download.sh: Rewritten.
+
+       * src/inst-sections.nsi (.onInstFailed, .onInstSuccess): New.
+
 2005-11-28  Werner Koch  <wk@g10code.com>
 
        Released 0.2.1.
diff --git a/TODO b/TODO
index 0179575..1a240d5 100644 (file)
--- a/TODO
+++ b/TODO
@@ -2,11 +2,6 @@
 
 * Missing stuff
 ** WinPT signature file should better be named .sig
-** System.dll is unsuable under DLL.
-    We solved this by our g4wihelp DLL.
-    This can also do the check for existing versions
-    of GnuPG etc.  And maybe to display a jpeg splash screen and to
-    play continuesly an ogg encoded tune.
 
 * Build system
 ** Some versions of strip don't work.
index ef7003b..e4f27d8 100644 (file)
@@ -17,4 +17,7 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
 
-EXTRA_DIST = download.sh
+# Note, that we don't distribute the packages.current template file
+# from the repository.
+EXTRA_DIST = download.sh packages.keys
+
index 20b4b45..c291c78 100644 (file)
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
 
-WGET=wget
-
-
-# GNU
-
-server_gnu=ftp://ftp.cs.tu-berlin.de/pub/gnu
-
-${WGET} -c ${server_gnu}/gettext/gettext-runtime-0.13.1.bin.woe32.zip
-${WGET} -c ${server_gnu}/gettext/gettext-runtime-0.13.1.bin.woe32.zip.sig
-${WGET} -c ${server_gnu}/gettext/gettext-0.13.1.tar.gz
-${WGET} -c ${server_gnu}/gettext/gettext-0.13.1.tar.gz.sig
-
-${WGET} -c ${server_gnu}/libiconv/libiconv-1.9.1.bin.woe32.zip
-${WGET} -c ${server_gnu}/libiconv/libiconv-1.9.1.bin.woe32.zip.sig
-${WGET} -c ${server_gnu}/libiconv/libiconv-1.9.1.tar.gz
-# No signature for the source package.
-
-
-# http://gnuwin32.sourceforge.net/
-# Note:  Mesh, Duesseldorf does not work reliable anymore.
-server_gnuwin32=http://kent.dl.sourceforge.net/sourceforge/gnuwin32
-
-${WGET} -c ${server_gnuwin32}/zlib-1.2.3-bin.zip
-${WGET} -c ${server_gnuwin32}/zlib-1.2.3-lib.zip
-${WGET} -c ${server_gnuwin32}/zlib-1.2.3-src.zip
-
-${WGET} -c ${server_gnuwin32}/libpng-1.2.8-bin.zip
-${WGET} -c ${server_gnuwin32}/libpng-1.2.8-lib.zip
-${WGET} -c ${server_gnuwin32}/libpng-1.2.8-src.zip
-
-${WGET} -c ${server_gnuwin32}/crypt-2.2.5-lib.zip
-${WGET} -c ${server_gnuwin32}/crypt-2.2.5-src.zip
-
-${WGET} -c ${server_gnuwin32}/regex-0.12-lib.zip
-${WGET} -c ${server_gnuwin32}/regex-0.12-src.zip
-
-
-# RedHat
-
-server_redhat=ftp://sources.redhat.com/pub/
-
-${WGET} -c ${server_redhat}/pthreads-win32/pthreads-w32-2-7-0-release.tar.gz
-
-
-# http://www.gimp.org/~tml/gimp/win32/downloads.html
-
-server_gtk=ftp://ftp.gtk.org/pub/gtk/v2.6
-server_gimp=http://www.gimp.org/~tml/gimp/win32
-
-${WGET} -c ${server_gtk}/win32/glib-2.6.6.zip
-${WGET} -c ${server_gtk}/win32/glib-dev-2.6.6.zip
-${WGET} -c ${server_gtk}/glib-2.6.6.tar.bz2
-
-${WGET} -c ${server_gtk}/win32/atk-1.9.0.zip
-${WGET} -c ${server_gtk}/win32/atk-dev-1.9.0.zip
-${WGET} -c ${server_gtk}/atk-1.9.0.tar.bz2
-
-${WGET} -c ${server_gtk}/win32/pango-1.8.2.zip
-${WGET} -c ${server_gtk}/win32/pango-dev-1.8.2.zip
-${WGET} -c ${server_gtk}/pango-1.8.2.tar.bz2
-
-${WGET} -c ${server_gtk}/win32/gtk+-2.6.9.zip
-${WGET} -c ${server_gtk}/win32/gtk+-dev-2.6.9.zip
-${WGET} -c ${server_gtk}/gtk+-2.6.6.tar.bz2
-
-${WGET} -c ${server_gimp}/pkgconfig-0.15.zip
-${WGET} -c ${server_gimp}/pkgconfig-0.15.0.tar.gz
-
-# WinPT
-
-#server_winpt="http://wald.intevation.org/frs/download.php"
+# Syntax of the packages.current file:
 #
-#${WGET} -c ${server_winpt}/59/winpt-0.11.1.tar.bz2
-#${WGET} -c ${server_winpt}/60/winpt-0.11.1.tar.bz2.sig
-# A recent CVS version is needed and no release is available
-# yet, so the scratch dir is temporary used.
-${WGET} -c "ftp://ftp.g10code.com/g10code/scratch/winpt-0.11.2-cvs2.tar.bz2"
-${WGET} -c "ftp://ftp.g10code.com/g10code/scratch/winpt-0.11.2-cvs2.tar.bz2.sig"
-
-# GPGee
-# Note: This is a temporary location
-
-server_gpgee="ftp://ftp.g10code.com/g10code/scratch"
-
-${WGET} -c ${server_gpgee}/gpgee-1.2.2-bin.zip
-${WGET} -c ${server_gpgee}/gpgee-1.2.2-src.zip
-
-
-# GnuPG stuff. 
-
-server_gnupg=http://ftp.gnupg.org/gcrypt
-
-${WGET} -c ${server_gnupg}/gnupg/gnupg-1.4.2.tar.gz
-${WGET} -c ${server_gnupg}/gnupg/gnupg-1.4.2.tar.gz.sig
-
-#${WGET} -c ${server_gnupg}/gpgme/gpgme-1.1.0.tar.gz
-#${WGET} -c ${server_gnupg}/gpgme/gpgme-1.1.0.tar.gz.sig
-
-# libgpg-error, GPA and GPGol currently come from manually crafted
-# packages.  However, we make them available at a scratch location
-
-server_g10code="ftp://ftp.g10code.com/g10code/scratch"
+# If the first non whitespace character of a line is #, the line is
+# considered a comment.  If the first word of a line is "server", the
+# rest of the line will be taken as the base URL for following file
+# commands.  If the first word of a line is "file" the rest of the
+# line will be appended to the current base URL (with a / as
+# delimiter).  Example:
+#
+#    # GnuPG stuff. 
+#    server ftp://ftp.gnupg.org/gcrypt
+#    
+#    file gnupg/gnupg-1.4.2.tar.gz
+#    file gnupg/gnupg-1.4.2.tar.gz.sig
+#    
 
-${WGET} -c ${server_g10code}/libgpg-error-1.2-cvs.tar.bz2
-${WGET} -c ${server_g10code}/gpgme-1.2.0-cvs.tar.bz2
-${WGET} -c ${server_g10code}/gpa-0.7.1-cvs.tar.bz2
-${WGET} -c ${server_g10code}/gpgol-0.9.4-cvs.tar.bz2
-${WGET} -c ${server_g10code}/sylpheed-claws-1.9.99cvs5-wk1.tar.bz2
+WGET=wget
 
-# Dummy manual pages
-${WGET} -c ${server_g10code}/man_novice_de-0.0.0-cvs.tar.gz
-${WGET} -c ${server_g10code}/man_advanced_de-0.0.0-cvs.tar.gz
-${WGET} -c ${server_g10code}/eudoragpg-0.0.0-cvs.tar.gz
+${WGET} -N ftp://ftp.gpw4win.org/gpg4win/packages.current{,.sig}
+
+if ! gpgv --keyring ./packages.keys packages.current.sig packages.current
+  then
+    echo "list of packages is not usable." >&2
+    exit 1
+fi
+
+
+lnr=0
+[ -f '.#download.failed' ] && rm '.#download.failed'
+cat packages.current | \
+while read key value ; do
+    (( lnr++ ))
+    [ -z "$key" ] && continue
+    case "$key" in
+     \#*)    ;;
+    server) 
+       server="$value" 
+       ;;
+    file)
+       if [ -z "$value" ]; then
+           echo "syntax error in file statement" >&2
+           exit 1
+       fi
+       if [ -z "$server" ]; then
+           echo "no server location available for file \`$value'" >&2
+           exit 1
+       fi
+       url="$server/$value"
+       echo "downloading \`$url'."
+       if ! ${WGET} -c -q "$url" ; then
+           echo "download of \`$url' failed." >&2
+           echo "$url" >> '.#download.failed'
+       fi
+       ;;
+     *)
+       echo "syntax error in packages.current, line $lnr." >&2
+       exit 1
+     esac
+done
+if [ -f '.#download.failed' ]; then
+  echo "some files failed to download" 2>&1
+  exit 1
+fi
diff --git a/packages/packages.current b/packages/packages.current
new file mode 100644 (file)
index 0000000..bad5d28
--- /dev/null
@@ -0,0 +1,129 @@
+# packages.current - list of current packages for use with gpg4win -*- sh -*-
+#
+#
+# This list as well as its corresponding signature file are intended
+# to be downloaded by the download.sh script of gpg4win.  The download
+# script will then process the statements here to actually download
+# the packages.  The syntax is trivial:
+#
+# If the first non whitespace character of a line is #, the line is
+# considered a comment.  If the first word of a line is "server", the
+# rest of the line will be taken as the base URL for following file
+# commands.  If the first word of a line is "file" the rest of the
+# line will be appended to the current base URL (with a / as
+# delimiter).
+
+
+# GNU
+
+server ftp://ftp.cs.tu-berlin.de/pub/gnu
+
+file gettext/gettext-runtime-0.13.1.bin.woe32.zip
+file gettext/gettext-runtime-0.13.1.bin.woe32.zip.sig
+file gettext/gettext-0.13.1.tar.gz
+file gettext/gettext-0.13.1.tar.gz.sig
+
+file libiconv/libiconv-1.9.1.bin.woe32.zip
+file libiconv/libiconv-1.9.1.bin.woe32.zip.sig
+file libiconv/libiconv-1.9.1.tar.gz
+# No signature for the source package.
+
+
+# Sourceforge
+server http://kent.dl.sourceforge.net/sourceforge/gnuwin32
+
+file zlib-1.2.3-bin.zip
+file zlib-1.2.3-lib.zip
+file zlib-1.2.3-src.zip
+
+file libpng-1.2.8-bin.zip
+file libpng-1.2.8-lib.zip
+file libpng-1.2.8-src.zip
+
+file crypt-2.2.5-lib.zip
+file crypt-2.2.5-src.zip
+
+file regex-0.12-lib.zip
+file regex-0.12-src.zip
+
+
+# RedHat
+
+server ftp://sources.redhat.com/pub
+
+file pthreads-win32/pthreads-w32-2-7-0-release.tar.gz
+
+
+# GTK+ stuff
+# http://www.gimp.org/~tml/gimp/win32/downloads.html
+
+server ftp://ftp.gtk.org/pub/gtk/v2.6
+
+file win32/glib-2.6.6.zip
+file win32/glib-dev-2.6.6.zip
+file glib-2.6.6.tar.bz2
+
+file win32/atk-1.9.0.zip
+file win32/atk-dev-1.9.0.zip
+file atk-1.9.0.tar.bz2
+
+file win32/pango-1.8.2.zip
+file win32/pango-dev-1.8.2.zip
+file pango-1.8.2.tar.bz2
+
+file win32/gtk+-2.6.9.zip
+file win32/gtk+-dev-2.6.9.zip
+file gtk+-2.6.6.tar.bz2
+
+
+# GIMP stuff for W32
+server http://www.gimp.org/~tml/gimp/win32
+
+file pkgconfig-0.15.zip
+file pkgconfig-0.15.0.tar.gz
+
+
+# WinPT
+
+#server http://wald.intevation.org/frs/download.php
+#
+#file 59/winpt-0.11.1.tar.bz2
+#file 60/winpt-0.11.1.tar.bz2.sig
+server ftp://ftp.g10code.com/g10code/scratch
+
+file winpt-0.11.2-cvs2.tar.bz2
+file winpt-0.11.2-cvs2.tar.bz2.sig
+
+
+# GPGee
+# Note: This is a temporary location
+
+server ftp://ftp.g10code.com/g10code/scratch
+
+file gpgee-1.2.2-bin.zip
+file gpgee-1.2.2-src.zip
+
+
+# GnuPG stuff. 
+
+server ftp://ftp.gnupg.org/gcrypt
+
+file gnupg/gnupg-1.4.2.tar.gz
+file gnupg/gnupg-1.4.2.tar.gz.sig
+
+
+# libgpg-error, GPA and GPGol currently come from manually crafted
+# packages.  However, we make them available at a scratch location
+
+server ftp://ftp.g10code.com/g10code/scratch
+
+file libgpg-error-1.2-cvs.tar.bz2
+file gpgme-1.2.0-cvs.tar.bz2
+file gpa-0.7.1-cvs.tar.bz2
+file gpgol-0.9.4-cvs.tar.bz2
+file sylpheed-claws-1.9.99cvs5-wk1.tar.bz2
+file man_novice_de-0.0.0-cvs.tar.gz
+file man_advanced_de-0.0.0-cvs.tar.gz
+file eudoragpg-0.0.0-cvs.tar.gz
+
+
diff --git a/packages/packages.keys b/packages/packages.keys
new file mode 100644 (file)
index 0000000..7800f71
Binary files /dev/null and b/packages/packages.keys differ
index 400ae14..820c17e 100644 (file)
@@ -361,13 +361,21 @@ Function .onInit
   g4wihelp::playsound $TEMP\gpgspltmp.wav
   g4wihelp::showsplash 3000 $TEMP\gpgspltmp.bmp
 
-  #FIXME: Ned to delete the WAV later.
-  #Delete $TEMP\gpgspltmp.wav
   Delete $TEMP\gpgspltmp.bmp
+  ; Note that we delete gpgspltmp.wav in .onInst{Failed,Success}
 
   Call CalcDepends
 FunctionEnd
 
+
+Function .onInstFailed
+  Delete $TEMP\gpgspltmp.wav
+FunctionEnd
+
+Function .onInstSuccess
+  Delete $TEMP\gpgspltmp.wav
+FunctionEnd
+
 Function .onSelChange
   Call CalcDepends
 FunctionEnd