diff options
author | Thierry Vignaud <tv@mageia.org> | 2012-07-25 17:02:02 +0000 |
---|---|---|
committer | Thierry Vignaud <tv@mageia.org> | 2012-07-25 17:02:02 +0000 |
commit | 8847d2bd174fdcb5f02e52d3c3ac22fc89deaea4 (patch) | |
tree | 4e700c9f07b33d3962625905c473fb414f011f2d /perl.prov | |
parent | 9cccdf20f2e40be8de837a796127aff97054ec26 (diff) | |
download | rpm-setup-8847d2bd174fdcb5f02e52d3c3ac22fc89deaea4.tar rpm-setup-8847d2bd174fdcb5f02e52d3c3ac22fc89deaea4.tar.gz rpm-setup-8847d2bd174fdcb5f02e52d3c3ac22fc89deaea4.tar.bz2 rpm-setup-8847d2bd174fdcb5f02e52d3c3ac22fc89deaea4.tar.xz rpm-setup-8847d2bd174fdcb5f02e52d3c3ac22fc89deaea4.zip |
sync with upstream rpm.org:
"perl.{req,prov} whitespace, backslash and paren cleanups."
(Ville Skyttä, 2010-01-24)
Diffstat (limited to 'perl.prov')
-rwxr-xr-x | perl.prov | 32 |
1 files changed, 16 insertions, 16 deletions
@@ -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 (<FILE>) { - + # 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; } |