From c16ed08a49bd6b25aa2bec842d0c1ea8aa685e1c Mon Sep 17 00:00:00 2001 From: Benjamin Drung Date: Mon, 29 May 2017 13:00:13 +0200 Subject: 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 --- apt-mirror | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apt-mirror b/apt-mirror index ec2b09d..f05aae0 100755 --- a/apt-mirror +++ b/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"; -- cgit v1.2.3