Package: wget
Version: 1.10.2-2
Severity: normal

hi

in my script /usr/share/mplayer/scripts/binary_codecs.sh
I would like to use 'wget' to keep some files up-to-date

Consider those commands 

$ cd /tmp
$ MYSITE='http://people.debian.org/~mennucc1/mplayer'
$ touch -d '1 Dec 1970' mirrors
$ ls -l mirrors
-rw-r--r-- 1 debdev debian 0 1970-12-01 00:00 mirrors
$ wget -v -c -N $MYSITE/mirrors
--12:13:59--  http://people.debian.org/~mennucc1/mplayer/mirrors
           => `mirrors'
Resolving people.debian.org... 192.25.206.10
Connecting to people.debian.org|192.25.206.10|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 336 [text/plain]
Remote file is newer, retrieving.
--12:14:00--  http://people.debian.org/~mennucc1/mplayer/mirrors
           => `mirrors'
Reusing existing connection to people.debian.org:80.
HTTP request sent, awaiting response... 200 OK
Length: 336 [text/plain]

100%[====================================================>] 336           
--.--K/s

12:14:00 (35.60 MB/s) - `mirrors' saved [336/336]
^^^^^^^^^^^^


So far all is fine. But now look at this:
$  touch -d '1 Dec 1970' mirrors
$ ls -l mirrors
-rw-r--r-- 1 debdev debian 336 Dec  1  1970 mirrors
$ wget -v -c -N $MYSITE/mirrors
--12:15:16--  http://people.debian.org/~mennucc1/mplayer/mirrors
           => `mirrors'
Resolving people.debian.org... 192.25.206.10
Connecting to people.debian.org|192.25.206.10|:80... connected.
HTTP request sent, awaiting response... 416 Requested Range Not Satisfiable

    The file is already fully retrieved; nothing to do.
^^^^^^^^^^^

Argh! 'wget' checks the size but not the timestamp!

Instead I checked that '-N' alone works:
$ wget -v  -N   $MYSITE/mirrors
--12:16:24--  http://people.debian.org/~mennucc1/mplayer/mirrors
           => `mirrors'
Resolving people.debian.org... 192.25.206.10
Connecting to people.debian.org|192.25.206.10|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 336 [text/plain]
Remote file is newer, retrieving.
--12:16:25--  http://people.debian.org/~mennucc1/mplayer/mirrors
           => `mirrors'
Reusing existing connection to people.debian.org:80.
HTTP request sent, awaiting response... 200 OK
Length: 336 [text/plain]

100%[====================================================>] 336           
--.--K/s

12:16:25 (32.04 MB/s) - `mirrors' saved [336/336]
^^^^^^^^^^^^^^

and trying again

$ wget -v  -N   $MYSITE/mirrors
--12:16:29--  http://people.debian.org/~mennucc1/mplayer/mirrors
           => `mirrors'
Resolving people.debian.org... 192.25.206.10
Connecting to people.debian.org|192.25.206.10|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 336 [text/plain]
Server file no newer than local file `mirrors' -- not retrieving.
^^^^^^^^^^^^

a.

-- System Information:
Debian Release: 4.0
  APT prefers testing
  APT policy: (900, 'testing'), (500, 'unstable'), (1, 'experimental')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.18-3-k7
Locale: LANG=it_IT.UTF-8, LC_CTYPE=it_IT.UTF-8 (charmap=UTF-8)

Versions of packages wget depends on:
ii  libc6                        2.3.6.ds1-8 GNU C Library: Shared libraries
ii  libssl0.9.8                  0.9.8c-4    SSL shared libraries

wget recommends no packages.

-- no debconf information

-- 
Andrea Mennucc
 "E' un mondo difficile. Che vita intensa!" (Tonino Carotone)

Attachment: signature.asc
Description: Digital signature

Reply via email to