diff options
author | Thierry Vignaud <tv@mageia.org> | 2012-10-23 23:52:08 +0000 |
---|---|---|
committer | Thierry Vignaud <tv@mageia.org> | 2012-10-23 23:52:08 +0000 |
commit | 73e6c13cf3d137e8dbc1b6a2d2552847444090a2 (patch) | |
tree | 94dbeae2bd935362441b8b7fa2e1b7051edc0a9f | |
parent | d6ff87233d581c78c382f363fe1efeff5a42c8ce (diff) | |
download | rpm-setup-73e6c13cf3d137e8dbc1b6a2d2552847444090a2.tar rpm-setup-73e6c13cf3d137e8dbc1b6a2d2552847444090a2.tar.gz rpm-setup-73e6c13cf3d137e8dbc1b6a2d2552847444090a2.tar.bz2 rpm-setup-73e6c13cf3d137e8dbc1b6a2d2552847444090a2.tar.xz rpm-setup-73e6c13cf3d137e8dbc1b6a2d2552847444090a2.zip |
simplify returns
-rwxr-xr-x | find-lang.pl | 28 |
1 files changed, 7 insertions, 21 deletions
diff --git a/find-lang.pl b/find-lang.pl index 5b0065c..995b1d7 100755 --- a/find-lang.pl +++ b/find-lang.pl @@ -38,49 +38,37 @@ File::Find::find( -f $File::Find::name or -l $File::Find::name or return; debug("next file is %s", $file); if ($file =~ m!^((.*/share/locale)/([^/@]+)[^/]*).*/([^/]+)\.mo!) { - if ($withoutmo) { - return; - } + return if $withoutmo; my ($pkg, $lang) = ($4, $3); if (pkg_match($pkg)) { own_file($file, $lang); } } elsif ($file =~ m!^((.*/gnome/help)/([^/]+)/([^/]+))!) { - if (!$withgnome) { - return; - } + return if !$withgnome; my ($pkg, $lang, $langfile) = ($3, $4, $1); if (pkg_match($pkg)) { parent_to_own($langfile, $file, $lang); } } elsif ($file =~ m!^((.*/share/help)/([^/]+)/([^/]+))/([^/]+)!) { - if (!$withhelp) { - return; - } + return if !$withhelp; my ($pkg, $lang, $langfile) = ($4, $3, $1); if (pkg_match($pkg)) { parent_to_own($langfile, $file, $lang); } } elsif ($file =~ m!^((.*/doc/kde)/HTML/([^/@]+)[^/]*)/([^/]+)/!) { - if (!$withkde) { - return; - } + return if !$withkde; my ($pkg, $lang, $langfile) = ($4, $3, $1); if (pkg_match($pkg)) { parent_to_own($langfile, $file, $lang); } } elsif ($file =~ m!^((.*/doc)/HTML/([^/@]+)[^/]*)/([^/_]+)!) { - if (!$withhtml) { - return; - } + return if !$withhtml; my ($pkg, $lang, $langfile) = ($4, $3, $1); if (pkg_match($pkg)) { parent_to_own($langfile, $file, $lang); } } elsif ($file =~ m!^((/+usr/share/man)/([^/@.]+)[^/]*)/man[^/]+/([^/.]+)\.\d[^/]*!) { - if (!$withman) { - return; - } + return if !$withman; my ($pkg, $lang, $langfile) = ($4, $3, $1); $file =~ s/\.[^\.]+$//; $file .= '.*'; @@ -117,9 +105,7 @@ exit(0); sub pkg_match { my ($pkg) = @_; return 1 if $allname; - if (grep { $_ eq $pkg } @searchname) { - return 1; - } + return 1 if grep { $_ eq $pkg } @searchname; return; } |