From: Jacob Bachmeyer Date: Wed, 29 Jul 2020 03:16:48 +0000 (-0500) Subject: Clean up whitespace using Emacs X-Git-Tag: 20200730__import~2 X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=46f349df5d178083f2e1683a3c2ac9559ba819aa;p=gatekeeper.git Clean up whitespace using Emacs --- diff --git a/build-keyring.pl b/build-keyring.pl index b192ce7..415cd59 100755 --- a/build-keyring.pl +++ b/build-keyring.pl @@ -1,6 +1,6 @@ #!/usr/bin/perl -w # Version 2005-01-11 -# +# # This file is free software; as a special exception the author gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. @@ -8,9 +8,9 @@ # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY, to the extent permitted by law; without even the # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -# -# This script will combine any pubring.gpg/oldring.gpg files found in the packages -# directories into a global public keyring, which can then be used to verify all +# +# This script will combine any pubring.gpg/oldring.gpg files found in the packages +# directories into a global public keyring, which can then be used to verify all # packages on the ftp server. # # Written by Ward Vandewege (ward@gnu.org), 2005-01-11 @@ -43,5 +43,3 @@ foreach my $subdir (@subdirs) { # was expired / changed. my $dummy2 = system("gpg --no-default-keyring --keyring $RING --import $EXPIRED_KEYRING >> /dev/null 2>&1"); - - diff --git a/ftp-addkey.sh b/ftp-addkey.sh index 6be3215..4b89785 100755 --- a/ftp-addkey.sh +++ b/ftp-addkey.sh @@ -1,6 +1,6 @@ #!/bin/bash # -# Adds a specified user & their key to the maintainer keyring on +# Adds a specified user & their key to the maintainer keyring on # ftp.gnu.org. # @@ -8,8 +8,8 @@ PACKAGES=/home/gatekpr/packages if ( ([ "$1" = "" ]) || ([ "$2" = "" ]) || ([ "$3" = "" ]) ) then - echo "ftp-addkey.sh " - exit + echo "ftp-addkey.sh " + exit fi if ! [ -d $PACKAGES/$1 ] @@ -32,4 +32,3 @@ pgpg $1 --import $3 chmod -R 755 $PACKAGES/$1 echo "Done." - diff --git a/send-gpg-public-keys.sh b/send-gpg-public-keys.sh index 325f572..5e9e48a 100755 --- a/send-gpg-public-keys.sh +++ b/send-gpg-public-keys.sh @@ -1,7 +1,7 @@ #!/bin/bash f=/home/ftp/gnu/gnu-keyring.gpg -for k in $( gpg --list-keys < $f | grep ^pub | grep -v expired | grep -v revoked | awk '{ print $2 }' | cut -d/ -f 2 ) +for k in $( gpg --list-keys < $f | grep ^pub | grep -v expired | grep -v revoked | awk '{ print $2 }' | cut -d/ -f 2 ) do gpg --keyserver hkp://pgp.mit.edu --send-keys $k < $f done diff --git a/upload-ftp-v1.1.pl b/upload-ftp-v1.1.pl index 1268d49..67e9a0a 100755 --- a/upload-ftp-v1.1.pl +++ b/upload-ftp-v1.1.pl @@ -187,7 +187,7 @@ sub main # make sure our directories all exist, or it's hopeless. # Use die instead of fatal - this error should "never" happen. for my $dir ($package_config_base, $incoming_dir, $incoming_tmp, - $destfinal, $desttmp) { + $destfinal, $desttmp) { -d $dir || ftp_die("FATAL: configuration problem, $dir is not a directory"); } # the chdir simplifies our filename parsing, so the base names don't @@ -208,19 +208,19 @@ sub main my $retval = &read_directive_file ($files->{"directive"},$files->{"upload"},$files->{"directive_only"}); if ($retval == 0) { - # do the work - &execute_commands($files,%info); - - # report success - if (!$files->{"directive_only"}) { - &success_upload($files->{"sig"}, $files->{"upload"},$files->{"directive"}); - } else { - &success_directive($files->{directive}); - } + # do the work + &execute_commands($files,%info); + + # report success + if (!$files->{"directive_only"}) { + &success_upload($files->{"sig"}, $files->{"upload"},$files->{"directive"}); + } else { + &success_directive($files->{directive}); + } } }; ftp_warn ("eval failed: $@") if $@; - + # clean up files if we abort while processing a triplet cleanup ($files->{"sig"}, $files->{"upload"}, $files->{"directive"}) if ($@); # clear out the current package that we just finished processing @@ -313,10 +313,10 @@ sub execute_commands { my $target = $1; # Get current working dir my $cwd = getcwd; - # Make sure there are no double dots in the path, and that it is absolute. + # Make sure there are no double dots in the path, and that it is absolute. # A bit paranoid, but hey... - &fatal("invalid directory $cwd",1,'') - if (($cwd =~ /\.\./) || (!($cwd =~ m,^/,))); + &fatal("invalid directory $cwd",1,'') + if (($cwd =~ /\.\./) || (!($cwd =~ m,^/,))); # Now untaint the getcwd output $cwd =~ /^(.*)$/; $cwd = $1; @@ -326,7 +326,7 @@ sub execute_commands { chdir($destdir); # if the symlink already exists, remove it if (-l $info{$key}{link}) { - unlink($info{$key}{link}) || &fatal("removal of symlink $info{$key}{link} failed: $!",1); + unlink($info{$key}{link}) || &fatal("removal of symlink $info{$key}{link} failed: $!",1); } # symlink away! symlink("$target",$info{$key}{link}) || &fatal("creation of symlink $info{$key}{link} to $target in $destdir failed: $!",1); @@ -426,16 +426,16 @@ sub scan_incoming { # here, before even reading the directive file; otherwise, perl could # consume lots of memory reading it. if (exists($possible{$base}) && exists($possible{$sig}) && exists($possible{$directive}) - && (-s $directive < 50*1024) && (-s $sig < 50*1024)) { + && (-s $directive < 50*1024) && (-s $sig < 50*1024)) { push (@ret, { "directive" => $directive, "sig" => $sig, - "upload" => $base, "directive_only" => 0 }); + "upload" => $base, "directive_only" => 0 }); ftp_syslog('info', "($log_style) processing [$directive:$sig:$base]"); # Do atomic rename to temp incoming directory before reading # anything, for safety. # for my $f (($directive, $sig, $base)) { - rename ($f, "$incoming_tmp/$f") + rename ($f, "$incoming_tmp/$f") || &fatal("rename $incoming_dir/$f to $incoming_tmp/$f failed: $!",0); } @@ -454,26 +454,26 @@ sub scan_incoming { my $racecondition = 0; open(TMP,$base); while () { - if (/^Filename:/i) { - $racecondition = 1; - last; - } + if (/^Filename:/i) { + $racecondition = 1; + last; + } } close(TMP); if ($racecondition) { - # Most likely a race condition. We've found a directive file but not the accompanying file(s). - # Just ignore this directive file for now. - ftp_syslog('info',"($log_style) Found directive file with filename directive ($base), but no accompanying files. Ignoring directive file in this run."); + # Most likely a race condition. We've found a directive file but not the accompanying file(s). + # Just ignore this directive file for now. + ftp_syslog('info',"($log_style) Found directive file with filename directive ($base), but no accompanying files. Ignoring directive file in this run."); } else { - # Directive file only, no actual file to deal with - # This can happen when dealing with symlink/rmsymlink/archive options - push (@ret, { "directive" => $base, "sig" => '', - "upload" => '', "directive_only" => 1 }); - # Do atomic rename to temp incoming directory before reading - # anything, for safety. - rename ($base, "$incoming_tmp/$base") - || &fatal("rename $incoming_dir/$base to $incoming_tmp/$base failed: $!",0); + # Directive file only, no actual file to deal with + # This can happen when dealing with symlink/rmsymlink/archive options + push (@ret, { "directive" => $base, "sig" => '', + "upload" => '', "directive_only" => 1 }); + # Do atomic rename to temp incoming directory before reading + # anything, for safety. + rename ($base, "$incoming_tmp/$base") + || &fatal("rename $incoming_dir/$base to $incoming_tmp/$base failed: $!",0); } delete $possible{$base}; } elsif ((-f $directive) && ((-s $directive) >= 50*1024)) { @@ -543,8 +543,8 @@ sub email_addresses { # The while loop below needs a proper scalar to work. my $e = $tmp[1]; while ($e =~ /([[:graph:]]+@[[:graph:]]+)/g) { - my $f = $1; - $f =~ s/[<>,]//g; + my $f = $1; + $f =~ s/[<>,]//g; push (@ret, $f) unless exists {map { $_ => 1 } @ret}->{$f}; } } @@ -666,7 +666,7 @@ sub read_directive_file { # Only let them specify one filename directive. &fatal("Only one filename directive is allowed per directive file. Error at filename directive: $val.",1,$directive_file_contents) - if exists $info{"filename"}; + if exists $info{"filename"}; $info{"filename"} = {"value" => $val, "order" => $cnt++}; # ok. } elsif ($tainted_cmd =~ /^Version:?$/i) { # case-insensitive, w or w/o the : @@ -752,17 +752,17 @@ sub read_directive_file { # We have three files # Are we in version 1.0 compatibility mode? if ($V1_COMPAT_ALLOWED) { - # We're in backwards compatibility mode - # That means: three files, and ONLY a directory directive in the directive file - $info{'v1_compat_mode'} = 1; - if ($directory_command_only == 0) { - &fatal("no filename directive specified in $directive_file",1) - } else { - ftp_syslog('info',"($log_style) running in legacy V1 compatibility mode"); - } + # We're in backwards compatibility mode + # That means: three files, and ONLY a directory directive in the directive file + $info{'v1_compat_mode'} = 1; + if ($directory_command_only == 0) { + &fatal("no filename directive specified in $directive_file",1) + } else { + ftp_syslog('info',"($log_style) running in legacy V1 compatibility mode"); + } } elsif (!$V1_COMPAT_ALLOWED) { - # This is not allowed - we require a filename directive. No backwards compatibility. - &fatal("no filename directive specified in $directive_file. Upgrade to the latest version! See http://www.gnu.org/prep/maintain/maintain.html",1) + # This is not allowed - we require a filename directive. No backwards compatibility. + &fatal("no filename directive specified in $directive_file. Upgrade to the latest version! See http://www.gnu.org/prep/maintain/maintain.html",1) } } else { # We only have a directive file @@ -845,10 +845,10 @@ sub read_directive_file { flock(SERIALS,2); # Take exclusive lock @serials = ; foreach (@serials) { - my ($tmp1,$tmp2) = /(.*?):(.*?)\n/; - $tmp1 =~ s/\s+//g; - $tmp2 =~ s/\s+//g; - $serials{$tmp1} = $tmp2; + my ($tmp1,$tmp2) = /(.*?):(.*?)\n/; + $tmp1 =~ s/\s+//g; + $tmp2 =~ s/\s+//g; + $serials{$tmp1} = $tmp2; } } seek(SERIALS,0,0); @@ -896,7 +896,7 @@ sub verify_keyring { # Hence the silly trick with storing the return code of gpgv in # the command output my @verify_args = ("/usr/bin/gpgv", "--keyring", $_, - $directive_file,"2>&1",";echo \$?"); + $directive_file,"2>&1",";echo \$?"); my $verify_str = join(' ',@verify_args); @@ -945,7 +945,7 @@ sub check_files { foreach my $keyring (@keyrings) { # Verify that the file has been correctly signed with a valid signature. my @verify_args = ("/usr/bin/gpgv", "--keyring", $keyring, - $sig_file, $upload_file); + $sig_file, $upload_file); if (!system (@verify_args)) { $valid = 1; last; @@ -966,8 +966,8 @@ sub check_files { my $found_makefile = 0; while (defined (my $line = )) { if ($line =~ /Makefile.in/i) { - $found_makefile = 1; - last; + $found_makefile = 1; + last; } } close(TAR); # We don't care about errors here; the pipe can cause non-zero exit codes when tar is unhappy that it's asked to stop @@ -982,10 +982,10 @@ sub check_files { my $error_string = ''; while (defined (my $line = )) { if ($line =~ /perm -777 -exec chmod a\+rwx|chmod 777 \$\(distdir\)/) { - $found_cve_2009_4029 = 1; + $found_cve_2009_4029 = 1; } if ($line =~ /chmod a\+w \$\(distdir\)/) { - $found_cve_2012_3386 = 1; + $found_cve_2012_3386 = 1; } } close(TAR); # We don't care about errors here; the pipe can cause non-zero exit codes when tar is unhappy that it's asked to stop @@ -1101,8 +1101,8 @@ sub cleanup_dir { my $mtime = $tmp[9]; $mtime =~ /^(.*)$/; $mtime = $1; ftp_syslog('debug',"($log_style) DEBUG: Removing $file, older than 24 hours (mtime: $tmp[9])\n") if ((time() > ($tmp[9]+24*3600)) && ($DEBUG > 0)); - unlink ("$dir/.$file"); # don't worry if it doesn't exist - rename ("$dir/$file", "$dir/.$file") if (time() > ($mtime+24*3600)); + unlink ("$dir/.$file"); # don't worry if it doesn't exist + rename ("$dir/$file", "$dir/.$file") if (time() > ($mtime+24*3600)); } } @@ -1172,15 +1172,15 @@ sub exclude_mail_blacklist { my @blacklist = (); my @tomail = @emaillist; if (-f $email_blacklist) { - open(BLACKLIST, "<$email_blacklist"); - @blacklist = ; - close(BLACKLIST); - chomp(@blacklist); - - my %blacklist = map{$_ => 1 } @blacklist; - my %emaillist = map{$_ => 1 } @emaillist; - - @tomail = grep(!defined $blacklist{$_}, @emaillist); + open(BLACKLIST, "<$email_blacklist"); + @blacklist = ; + close(BLACKLIST); + chomp(@blacklist); + + my %blacklist = map{$_ => 1 } @blacklist; + my %emaillist = map{$_ => 1 } @emaillist; + + @tomail = grep(!defined $blacklist{$_}, @emaillist); } return @tomail; @@ -1219,12 +1219,12 @@ sub mail { if ($NOMAIL) { if ($subject ne '') { - ftp_syslog('info', "($log_style) Subject: '$subject'"); + ftp_syslog('info', "($log_style) Subject: '$subject'"); } elsif (defined $info{package}) { - ftp_syslog('info', "($log_style) Subject: $info{package}"); + ftp_syslog('info', "($log_style) Subject: $info{package}"); } else { - ftp_syslog('warning', "($log_style) Error uploading package: $msg"); - ftp_syslog('info', "($log_style) Subject: generic failure"); + ftp_syslog('warning', "($log_style) Error uploading package: $msg"); + ftp_syslog('info', "($log_style) Subject: generic failure"); } ftp_syslog('info', "($log_style) Body: $msg"); } else { @@ -1243,15 +1243,15 @@ sub mail { $smtp->datasend("Message-ID: <$mid>\r\n"); $smtp->datasend("Date: " . strftime("%a, %e %b %Y %H:%M:%S %z", localtime) . "\r\n"); if ($subject ne '') { - $smtp->datasend ("Subject: [$m_style gnu-ftp-upload] $subject"); - ftp_syslog('info', "($log_style) Subject: '$subject'"); + $smtp->datasend ("Subject: [$m_style gnu-ftp-upload] $subject"); + ftp_syslog('info', "($log_style) Subject: '$subject'"); } elsif (defined $info{package}) { - $smtp->datasend ("Subject: [$m_style gnu-ftp-upload] $info{package}"); - ftp_syslog('info', "($log_style) Subject: $info{package}"); + $smtp->datasend ("Subject: [$m_style gnu-ftp-upload] $info{package}"); + ftp_syslog('info', "($log_style) Subject: $info{package}"); } else { - $smtp->datasend ("Subject: [$m_style gnu-ftp-upload] generic failure"); - ftp_syslog('warning', "($log_style) Error uploading package: $msg"); - ftp_syslog('info', "($log_style) Subject: generic failure"); + $smtp->datasend ("Subject: [$m_style gnu-ftp-upload] generic failure"); + ftp_syslog('warning', "($log_style) Error uploading package: $msg"); + ftp_syslog('info', "($log_style) Subject: generic failure"); } $smtp->datasend ("\n\n"); ftp_syslog('info', "($log_style) Body: $msg"); diff --git a/upload-ftp-v1.2.pl b/upload-ftp-v1.2.pl index cdc0c8e..7396cf3 100755 --- a/upload-ftp-v1.2.pl +++ b/upload-ftp-v1.2.pl @@ -196,7 +196,7 @@ sub main # make sure our directories all exist, or it's hopeless. # Use die instead of fatal - this error should "never" happen. for my $dir ($package_config_base, $incoming_dir, $incoming_tmp, - $destfinal, $desttmp) { + $destfinal, $desttmp) { -d $dir || ftp_die("FATAL: configuration problem, $dir is not a directory"); } # the chdir simplifies our filename parsing, so the base names don't @@ -217,19 +217,19 @@ sub main my $retval = &read_directive_file ($files->{"directive"},$files->{"upload"},$files->{"directive_only"}); if ($retval == 0) { - # do the work - &execute_commands($files,%info); - - # report success - if (!$files->{"directive_only"}) { - &success_upload($files->{"sig"}, $files->{"upload"},$files->{"directive"}); - } else { - &success_directive($files->{directive}); - } + # do the work + &execute_commands($files,%info); + + # report success + if (!$files->{"directive_only"}) { + &success_upload($files->{"sig"}, $files->{"upload"},$files->{"directive"}); + } else { + &success_directive($files->{directive}); + } } }; ftp_warn ("eval failed: $@") if $@; - + # clean up files if we abort while processing a triplet cleanup ($files->{"sig"}, $files->{"upload"}, $files->{"directive"}) if ($@); # clear out the current package that we just finished processing @@ -324,10 +324,10 @@ sub execute_commands { my $target = $1; # Get current working dir my $cwd = getcwd; - # Make sure there are no double dots in the path, and that it is absolute. + # Make sure there are no double dots in the path, and that it is absolute. # A bit paranoid, but hey... - &fatal("invalid directory $cwd",1,'') - if (($cwd =~ /\.\./) || (!($cwd =~ m,^/,))); + &fatal("invalid directory $cwd",1,'') + if (($cwd =~ /\.\./) || (!($cwd =~ m,^/,))); # Now untaint the getcwd output $cwd =~ /^(.*)$/; $cwd = $1; @@ -337,7 +337,7 @@ sub execute_commands { chdir($destdir); # if the symlink already exists, remove it if (-l $info{$key}{link}) { - unlink($info{$key}{link}) || &fatal("removal of symlink $info{$key}{link} failed: $!",1); + unlink($info{$key}{link}) || &fatal("removal of symlink $info{$key}{link} failed: $!",1); } # symlink away! symlink("$target",$info{$key}{link}) || &fatal("creation of symlink $info{$key}{link} to $target in $destdir failed: $!",1); @@ -439,13 +439,13 @@ sub scan_incoming { # being uploaded. if ($TSTAMPCHECK) { for my $ent (keys %possible) { - my @stat = stat($ent); - if ($stat[9] >= time - 120) { - ftp_syslog('debug', "($log_style) DEBUG: " . "$ent has been modified in the last 2 minutes, skipping") if $DEBUG; - delete ($possible{$ent}); - next; - } - } + my @stat = stat($ent); + if ($stat[9] >= time - 120) { + ftp_syslog('debug', "($log_style) DEBUG: " . "$ent has been modified in the last 2 minutes, skipping") if $DEBUG; + delete ($possible{$ent}); + next; + } + } } # For each remaining possibility, do some more checks @@ -462,16 +462,16 @@ sub scan_incoming { # here, before even reading the directive file; otherwise, perl could # consume lots of memory reading it. if (exists($possible{$base}) && exists($possible{$sig}) && exists($possible{$directive}) - && (-s "$incoming_dir/$directive" < 50*1024) && (-s "$incoming_dir/$sig" < 50*1024)) { + && (-s "$incoming_dir/$directive" < 50*1024) && (-s "$incoming_dir/$sig" < 50*1024)) { push (@ret, { "directive" => $directive, "sig" => $sig, - "upload" => $base, "directive_only" => 0 }); + "upload" => $base, "directive_only" => 0 }); ftp_syslog('info', "($log_style) processing [$directive:$sig:$base]"); # Do atomic rename to temp incoming directory before reading # anything, for safety. # for my $f (($directive, $sig, $base)) { - rename ($f, "$incoming_tmp/$f") + rename ($f, "$incoming_tmp/$f") || &fatal("rename $incoming_dir/$f to $incoming_tmp/$f failed: $!",0); } @@ -490,26 +490,26 @@ sub scan_incoming { my $racecondition = 0; open(TMP,$base); while () { - if (/^Filename:/i) { - $racecondition = 1; - last; - } + if (/^Filename:/i) { + $racecondition = 1; + last; + } } close(TMP); if ($racecondition) { - # Most likely a race condition. We've found a directive file but not the accompanying file(s). - # Just ignore this directive file for now. - ftp_syslog('info',"($log_style) Found directive file with filename directive ($base), but no accompanying files. Ignoring directive file in this run."); + # Most likely a race condition. We've found a directive file but not the accompanying file(s). + # Just ignore this directive file for now. + ftp_syslog('info',"($log_style) Found directive file with filename directive ($base), but no accompanying files. Ignoring directive file in this run."); } else { - # Directive file only, no actual file to deal with - # This can happen when dealing with symlink/rmsymlink/archive options - push (@ret, { "directive" => $base, "sig" => '', - "upload" => '', "directive_only" => 1 }); - # Do atomic rename to temp incoming directory before reading - # anything, for safety. - rename ($base, "$incoming_tmp/$base") - || &fatal("rename $incoming_dir/$base to $incoming_tmp/$base failed: $!",0); + # Directive file only, no actual file to deal with + # This can happen when dealing with symlink/rmsymlink/archive options + push (@ret, { "directive" => $base, "sig" => '', + "upload" => '', "directive_only" => 1 }); + # Do atomic rename to temp incoming directory before reading + # anything, for safety. + rename ($base, "$incoming_tmp/$base") + || &fatal("rename $incoming_dir/$base to $incoming_tmp/$base failed: $!",0); } delete $possible{$base}; } elsif ((-f $directive) && ((-s $directive) >= 50*1024)) { @@ -579,8 +579,8 @@ sub email_addresses { # The while loop below needs a proper scalar to work. my $e = $tmp[1]; while ($e =~ /([[:graph:]]+@[[:graph:]]+)/g) { - my $f = $1; - $f =~ s/[<>,]//g; + my $f = $1; + $f =~ s/[<>,]//g; push (@ret, $f) unless exists {map { $_ => 1 } @ret}->{$f}; } } @@ -705,7 +705,7 @@ sub read_directive_file { # Only let them specify one filename directive. &fatal("Only one filename directive is allowed per directive file. Error at filename directive: $val.",1,$directive_file_contents) - if exists $info{"filename"}; + if exists $info{"filename"}; $info{"filename"} = {"value" => $val, "order" => $cnt++}; # ok. } elsif ($tainted_cmd =~ /^Version:?$/i) { # case-insensitive, w or w/o the : @@ -791,17 +791,17 @@ sub read_directive_file { # We have three files # Are we in version 1.0 compatibility mode? if ($V1_COMPAT_ALLOWED) { - # We're in backwards compatibility mode - # That means: three files, and ONLY a directory directive in the directive file - $info{'v1_compat_mode'} = 1; - if ($directory_command_only == 0) { - &fatal("no filename directive specified in $directive_file",1) - } else { - ftp_syslog('info',"($log_style) running in legacy v1 compatibility mode"); - } + # We're in backwards compatibility mode + # That means: three files, and ONLY a directory directive in the directive file + $info{'v1_compat_mode'} = 1; + if ($directory_command_only == 0) { + &fatal("no filename directive specified in $directive_file",1) + } else { + ftp_syslog('info',"($log_style) running in legacy v1 compatibility mode"); + } } elsif (!$V1_COMPAT_ALLOWED) { - # This is not allowed - we require a filename directive. No backwards compatibility. - &fatal("no filename directive specified in $directive_file. Upgrade to the latest version! See http://www.gnu.org/prep/maintain/maintain.html",1) + # This is not allowed - we require a filename directive. No backwards compatibility. + &fatal("no filename directive specified in $directive_file. Upgrade to the latest version! See http://www.gnu.org/prep/maintain/maintain.html",1) } } else { # We only have a directive file @@ -884,10 +884,10 @@ sub read_directive_file { flock(SERIALS,2); # Take exclusive lock @serials = ; foreach (@serials) { - my ($tmp1,$tmp2) = /(.*?):(.*?)\n/; - $tmp1 =~ s/\s+//g; - $tmp2 =~ s/\s+//g; - $serials{$tmp1} = $tmp2; + my ($tmp1,$tmp2) = /(.*?):(.*?)\n/; + $tmp1 =~ s/\s+//g; + $tmp2 =~ s/\s+//g; + $serials{$tmp1} = $tmp2; } } seek(SERIALS,0,0); @@ -939,7 +939,7 @@ sub verify_keyring { # Hence the silly trick with storing the return code of gpgv in # the command output my @verify_args = ("/usr/bin/gpgv", "--keyring", $_, - $directive_file,"2>&1",";echo \$?"); + $directive_file,"2>&1",";echo \$?"); my $verify_str = join(' ',@verify_args); @@ -993,7 +993,7 @@ sub check_files { foreach my $keyring (@keyrings) { # Verify that the file has been correctly signed with a valid signature. my @verify_args = ("/usr/bin/gpgv", "--keyring", $keyring, - $sig_file, $upload_file); + $sig_file, $upload_file); if (!system (@verify_args)) { $valid = 1; last; @@ -1113,8 +1113,8 @@ sub cleanup_dir { my $mtime = $tmp[9]; $mtime =~ /^(.*)$/; $mtime = $1; ftp_syslog('debug',"($log_style) DEBUG: Removing $file, older than 24 hours (mtime: $tmp[9])\n") if ((time() > ($tmp[9]+24*3600)) && ($DEBUG > 0)); - unlink ("$dir/.$file"); # don't worry if it doesn't exist - rename ("$dir/$file", "$dir/.$file") if (time() > ($mtime+24*3600)); + unlink ("$dir/.$file"); # don't worry if it doesn't exist + rename ("$dir/$file", "$dir/.$file") if (time() > ($mtime+24*3600)); } } @@ -1184,15 +1184,15 @@ sub exclude_mail_blacklist { my @blacklist = (); my @tomail = @emaillist; if (-f $email_blacklist) { - open(BLACKLIST, "<$email_blacklist"); - @blacklist = ; - close(BLACKLIST); - chomp(@blacklist); - - my %blacklist = map{$_ => 1 } @blacklist; - my %emaillist = map{$_ => 1 } @emaillist; - - @tomail = grep(!defined $blacklist{$_}, @emaillist); + open(BLACKLIST, "<$email_blacklist"); + @blacklist = ; + close(BLACKLIST); + chomp(@blacklist); + + my %blacklist = map{$_ => 1 } @blacklist; + my %emaillist = map{$_ => 1 } @emaillist; + + @tomail = grep(!defined $blacklist{$_}, @emaillist); } return @tomail; @@ -1235,12 +1235,12 @@ sub mail { if ($NOMAIL) { if ($subject ne '') { - ftp_syslog('info', "($log_style) Subject: '$subject'"); + ftp_syslog('info', "($log_style) Subject: '$subject'"); } elsif (defined $info{package}) { - ftp_syslog('info', "($log_style) Subject: $info{package}"); + ftp_syslog('info', "($log_style) Subject: $info{package}"); } else { - ftp_syslog('warning', "($log_style) Error uploading package: $msg"); - ftp_syslog('info', "($log_style) Subject: generic failure"); + ftp_syslog('warning', "($log_style) Error uploading package: $msg"); + ftp_syslog('info', "($log_style) Subject: generic failure"); } ftp_syslog('info', "($log_style) Body: $msg"); } else { @@ -1259,15 +1259,15 @@ sub mail { $smtp->datasend("Message-ID: <$mid>\r\n"); $smtp->datasend("Date: " . strftime("%a, %e %b %Y %H:%M:%S %z", localtime) . "\r\n"); if ($subject ne '') { - $smtp->datasend ("Subject: [$m_style gnu-ftp-upload] $subject"); - ftp_syslog('info', "($log_style) Subject: '$subject'"); + $smtp->datasend ("Subject: [$m_style gnu-ftp-upload] $subject"); + ftp_syslog('info', "($log_style) Subject: '$subject'"); } elsif (defined $info{package}) { - $smtp->datasend ("Subject: [$m_style gnu-ftp-upload] $info{package}"); - ftp_syslog('info', "($log_style) Subject: $info{package}"); + $smtp->datasend ("Subject: [$m_style gnu-ftp-upload] $info{package}"); + ftp_syslog('info', "($log_style) Subject: $info{package}"); } else { - $smtp->datasend ("Subject: [$m_style gnu-ftp-upload] generic failure"); - ftp_syslog('warning', "($log_style) Error uploading package: $msg"); - ftp_syslog('info', "($log_style) Subject: generic failure"); + $smtp->datasend ("Subject: [$m_style gnu-ftp-upload] generic failure"); + ftp_syslog('warning', "($log_style) Error uploading package: $msg"); + ftp_syslog('info', "($log_style) Subject: generic failure"); } $smtp->datasend ("\n\n"); ftp_syslog('info', "($log_style) Body: $msg");