Received: (at submit) by bugs.debian.org; 5 Feb 2001 22:45:59 +0000 From ydirson@altern.org Mon Feb 05 16:45:59 2001 Return-path: Received: from (adansonia.wanadoo.fr) [::ffff:193.252.19.224] by master.debian.org with esmtp (Exim 3.12 1 (Debian)) id 14PuOU-00005r-00; Mon, 05 Feb 2001 16:45:58 -0600 Received: from andira.wanadoo.fr (193.252.19.152) by adansonia.wanadoo.fr; 5 Feb 2001 23:45:46 +0100 Received: from bylbo.nowhere.earth (62.161.73.239) by andira.wanadoo.fr; 5 Feb 2001 23:45:24 +0100 Received: from dwitch by bylbo.nowhere.earth with local (Exim 3.22 #1 (Debian)) id 14PucL-0001Op-00 for ; Tue, 06 Feb 2001 00:00:17 +0100 Received: from pop.wanadoo.fr [193.252.19.209] by localhost with POP3 (fetchmail-5.5.0) for dwitch@localhost (single-drop); Sun, 03 Sep 2000 19:46:29 +0200 (CEST) Received: from bassia.wanadoo.fr (192.168.156.20) by ms16.wanadoo.fr; 27 Aug 2000 18:07:34 +0200 Received: from master.debian.org (193.252.19.20) by bassia.wanadoo.fr; 27 Aug 2000 18:07:33 +0200 Received: from p40s05a02.client.global.net.uk (Bagpuss.unfortu.net) [::ffff:195.147.149.65] by master.debian.org with esmtp (Exim 3.12 1 (Debian)) id 13T546-0001c5-00; Sun, 27 Aug 2000 11:13:48 -0500 Received: from nick by Bagpuss.unfortu.net with local (Exim 3.12 #1 (Debian)) id 13T4ho-0003fP-00 for ; Sun, 27 Aug 2000 16:50:44 +0100 Date: Sun, 27 Aug 2000 16:50:43 +0100 From: Nicholas Clark To: dirson@debian.org Subject: restarting the apt-zip-list fetch Message-ID: <20000827165043.A13799@Bagpuss.unfortu.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii User-Agent: Mutt/1.0.1i Resent-From: ydirson@altern.org Resent-Date: Tue, 6 Feb 2001 00:00:16 +0100 Resent-To: submit@bugs.debian.org Resent-Message-Id: Resent-Sender: Yann Dirson Delivered-To: submit@bugs.debian.org Package: apt-zip Severity: wishlist I've got apt-zip 0.9 installed, and generally find it useful. However, the fetch script it generated didn't seem to cope too well if the link dropped and the script had to be restarted. As the fetch script only moves files into ../disk once they are completely transferred, I made a modification to it to skip downloading any files found in ../disk. This way I could restart the script and it would not needlessly get any files already successfully downloaded. My modified fetch script starts: #!/bin/sh # auto-generated file from apt-zip-list set -e err(){ echo >&2 "Fetching $1 failed ($2)"; } do_wget(){ wget --passive-ftp -t3 -nv -O $2 $1 ret=0 [ "`which md5sum`" ] && if [ "`md5sum $2 | cut -d' ' -f1`" = $4 ] then return 0 else err $2 "wrong MD5"; return 1 fi [ "`which gzip`" ] && if ar p $2 data.tar.gz | gzip -t then return 0 else err $2 "wrong contents"; return 1 fi return } getfile(){ if [ -f ../disk/$2 ] then echo Already got $2 else do_wget $1 $2 $3 $4 && mv $2 ../disk/ fi } mkdir -p partial disk && cd partial while read URL FILE SIZE MD5 do getfile $URL $FILE $SIZE $MD5 done <