diff options
author | Guillaume Rousse <guillomovitch@gmail.com> | 2019-03-03 14:18:57 +0100 |
---|---|---|
committer | Guillaume Rousse <guillomovitch@gmail.com> | 2019-03-03 14:21:29 +0100 |
commit | 4a5888c8d8d6eeb775b1660b855c59067d24a981 (patch) | |
tree | a4f25444f845a5bb9005333f08e6fa3b41817c38 | |
parent | bdba69516fe1a5a75daea9ec461eec79d62591a2 (diff) | |
download | rpm-setup-4a5888c8d8d6eeb775b1660b855c59067d24a981.tar rpm-setup-4a5888c8d8d6eeb775b1660b855c59067d24a981.tar.gz rpm-setup-4a5888c8d8d6eeb775b1660b855c59067d24a981.tar.bz2 rpm-setup-4a5888c8d8d6eeb775b1660b855c59067d24a981.tar.xz rpm-setup-4a5888c8d8d6eeb775b1660b855c59067d24a981.zip |
use File::Find insted of external find command
-rwxr-xr-x | php.req | 12 |
1 files changed, 11 insertions, 1 deletions
@@ -11,6 +11,8 @@ # - some clean-up... # ##################################################################### +use File::Find; + $pear = "/usr/share/pear"; @files = (); @@ -75,7 +77,15 @@ foreach (@ARGV ? $ARGV : <> ) { } } -@files = qx(find $ENV{RPM_BUILD_ROOT} -name "*php"|grep -v /usr/share/doc |sed -e 's!$ENV{RPM_BUILD_ROOT}!!'); +my $wanted = sub { + return if $File::Find::name !~ /\.php$/; + return if $File::Find::name =~ /\/usr\/share\/doc/; + $File::Find::name =~ s/$ENV{RPM_BUILD_ROOT}//; + push @files, $File::Find::name; +}; + +@files = (); +find($wanted, $ENV{RPM_BUILD_ROOT}); f: for $f (keys %req) { for $g (@files) { next f if ($g =~ /\Q$f\E$/); } |