From 8847d2bd174fdcb5f02e52d3c3ac22fc89deaea4 Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Wed, 25 Jul 2012 17:02:02 +0000 Subject: =?UTF-8?q?sync=20with=20upstream=20rpm.org:=20"perl.{req,prov}=20?= =?UTF-8?q?whitespace,=20backslash=20and=20paren=20cleanups."=20(Ville=20S?= =?UTF-8?q?kytt=C3=A4,=202010-01-24)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- perl.prov | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'perl.prov') diff --git a/perl.prov b/perl.prov index c20c6e9..db41847 100755 --- a/perl.prov +++ b/perl.prov @@ -84,7 +84,7 @@ exit 0; sub process_file { my ($file) = @_; - + if (!open(FILE, $file)) { warn("$0: Warning: Could not open file '$file' for reading: $!\n"); return; @@ -94,7 +94,7 @@ sub process_file { my ($package, $version, $incomment, $inover) = (); while () { - + # skip the documentation # we should not need to have item in this if statement (it @@ -109,7 +109,7 @@ sub process_file { $incomment = 0; $inover = 0; } - + if (m/^=(over)/) { $inover = 1; } @@ -121,7 +121,7 @@ sub process_file { if ($incomment || $inover || m/^\s*#/) { next; } - + # skip the data section if (m/^__(DATA|END)__$/) { last; @@ -134,9 +134,9 @@ sub process_file { if (m/^\s*package\s+([_:a-zA-Z0-9]+)\s*;/) { # some internal packages, like DB, might be temporarily redefined inside a module. if (!($package && $1 eq 'DB')) { - $package=$1; + $package = $1; undef $version; - $require{$package}=undef; + $require{$package} = undef; } } @@ -152,8 +152,8 @@ sub process_file { #DynaLoader.pm:$VERSION = $VERSION = "1.03"; # avoid typo warning #$Locale::Maketext::Simple::VERSION = '0.21'; - if ( - ($package) && + if ( + $package && (m/^(.*;)?\s*((my|our)\s+)?\$(${package}::)?VERSION\s*=\s+/) ) { @@ -162,23 +162,23 @@ sub process_file { # common method of non static numbering. if (m/\$Revision: (\d+[.0-9]+)/) { - $version= $1; - } elsif (m/VERSION.*?[\'\"]?(\d+[._0-9]+)[\'\"]?/) { + $version = $1; + } elsif (m/VERSION.*?['"]?(\d+[._0-9]+)['"]?/) { # look for a static number hard coded in the script - $version= $1; + $version= $1; } - $require{$package}=$version; + $require{$package} = $version; } - + # Each keyword can appear multiple times. Don't # bother with datastructures to store these strings, # if we need to print it print it now. - if ( m/^\s*\$RPM_Provides\s*=\s*["'](.*)['"]/i) { + if (m/^\s*\$RPM_Provides\s*=\s*["'](.*)['"]/i) { foreach $_ (split(/\s+/, $1)) { - print "$_\n"; + print "$_\n"; } } @@ -187,5 +187,5 @@ sub process_file { close(FILE) || die("$0: Could not close file: '$file' : $!\n"); - return ; + return; } -- cgit v1.2.1