diff options
author | Benjamin Drung <benjamin.drung@profitbricks.com> | 2017-05-29 14:00:13 +0300 |
---|---|---|
committer | Benjamin Drung <benjamin.drung@profitbricks.com> | 2017-05-29 14:02:33 +0300 |
commit | c16ed08a49bd6b25aa2bec842d0c1ea8aa685e1c (patch) | |
tree | c5605b863e3fb981c40b49fac2650083b5517eb0 | |
parent | 31dc83f370821b320b1b40d0667cec06d6554012 (diff) |
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
-rwxr-xr-x | apt-mirror | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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"; |