PREFACE: Taking back to the list...

On 4/2/2013 1:11 PM, Quanah Gibson-Mount wrote:
--On Tuesday, April 02, 2013 1:06 PM -0400 "Kevin A. McGrail" <[email protected]> wrote:

Can you rename the MIRRORED.BY file in
/tmp/qsa/updates_spamassassin_org/MIRRORED.BY and try again?

I'd like to see it try and fetch that file which maybe we need to add a
condition.

See below. :)

Is the MIRRORED.BY file blank?

Yes, it was zero bytes.

And now that I removed it, it worked?!  Crazy. :)

I think the first time I failed to set my proxy before running sa-update, and then subsequent runs all failed. Perhaps if MIRRORED.BY is 0, it should be removed by sa-update before trying to retrieve it again?

Good to hear.

I thought the following should fix it:

Index: sa-update.raw
===================================================================
--- sa-update.raw       (revision 1452851)
+++ sa-update.raw       (working copy)
@@ -596,6 +596,9 @@
       } elsif (time - $mirby_time > $IGNORE_MIRBY_OLDER_THAN) {
         dbg("channel: MIRRORED.BY file is too old, forcing refresh");
         $mirby_force_reload = 1;
+      } elsif (-s $mirby_path == 0) {
+        dbg("channel: MIRRORED.BY file is zero bytes, forcing refresh");
+        $mirby_force_reload = 1;
       } else {
         dbg("channel: reading MIRRORED.BY file $mirby_path");
         local $/ = undef;

However, it didn't.

I found that this command (effectively) wouldn't overwrite a

cd /var/lib/spamassassin/3.004000/updates_spamassassin_org/ && /usr/bin/curl -s -L -O --remote-time -g --max-redirs 2 --connect-timeout 30 --max-time 300 --fail -o MIRRORED.BY -z MIRRORED.BY -- http://spamassassin.apache.org/updates/MIRRORED.BY

I think the -z is saying it has to be newer than the existing file.

So I added an unlink to the code for the MIRRORED.BY file if it's 0 bytes. Mark, do you concur? You know sa-update like the back of your hand!

svn commit -m 'Fix for MIRRORED.BY file being 0 byte' sa-update.raw
Sending        sa-update.raw
Transmitting file data .
Committed revision 1463659.

Regards,
KAM

Reply via email to