Fix warning on repository without md5sum

A repository without MD5sum will cause warnings:

Use of uninitialized value $lines{"MD5sum:"} in concatenation (.) or
string at /usr/bin/apt-mirror line 787

The written MD5 file is not used by apt-mirror. Thus skip missing MD5Sum
values.

Example repository without MD5Sum:
deb-amd64 https://packages.chef.io/stable-apt xenial main

fixes #66
pull/83/merge
Benjamin Drung 5 years ago
parent 31dc83f370
commit c16ed08a49
  1. 2
      apt-mirror

@ -813,7 +813,7 @@ sub process_index
{ # Packages index
$skipclean{ remove_double_slashes( $path . "/" . $lines{"Filename:"} ) } = 1;
print FILES_ALL remove_double_slashes( $path . "/" . $lines{"Filename:"} ) . "\n";
print FILES_MD5 $lines{"MD5sum:"} . " " . remove_double_slashes( $path . "/" . $lines{"Filename:"} ) . "\n";
print FILES_MD5 $lines{"MD5sum:"} . " " . remove_double_slashes( $path . "/" . $lines{"Filename:"} ) . "\n" if defined $lines{"MD5sum:"};
if ( need_update( $mirror . "/" . $lines{"Filename:"}, $lines{"Size:"} ) )
{
print FILES_NEW remove_double_slashes( $uri . "/" . $lines{"Filename:"} ) . "\n";

Loading…
Cancel
Save