There still is a whole bunch of repositories out there that don't
have Contents file, so I also think that some way of suppressing
messages about missing files (and the resulting emails if used in
a cron job) would be good.

Actually, the annoying message is not produced by the programm code,
but by the following line in "/etc/apt/apt-file:conf":

> error_cmd = ( rm -f "<cache>/<dest>_tmp"; \
> echo "Can't get <uri>/dists/<dist>/Contents-<arch>.gz" )

One way to fix it, would be to change that configuration option to
something like: 

  error_cmd = ( rm -f "<cache>/<dest>_tmp"; \
  [ -n "<missing_ok>"  ] || \
  echo "Can't get <uri>/dists/<dist>/Contents-<arch>.gz" )

in connection with the patch below.

Maybe some configuration option to selectively suppress the message
only for certain URLs like http://security.debian.org/ in connection
with the "--non-interactive" option also would make sense? ...


--- /tmp/apt-file       2008-08-23 18:57:55.000000000 +0200
+++ /usr/bin/apt-file   2009-09-30 10:50:40.000000000 +0200
@@ -172,8 +172,9 @@
                 my $cache = $Conf->{cache};
                 my $arch  = $Conf->{arch};
                 my $cdrom = $Conf->{cdrom_mount};
+                my $missing_ok=  $Conf->{missing_ok} ? 'missing_ok' : '';
                 foreach my $var (
-                    qw/host port user passwd path dist pkg
+                    qw/host port user passwd path dist pkg missing_ok
                     cache arch uri cdrom/
                     )
                 {
@@ -487,6 +488,7 @@
         "package-only|l"    => \$Conf->{package_only},
         "fixed-string|F"    => \$Conf->{fixed_strings},
         "non-interactive|N" => \$Conf->{non_interactive},
+        "missing-ok|q"      => \$Conf->{missing_ok},
         "help|h"            => \$Conf->{help},
         "version|V"         => \$Conf->{version},
     );




--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to