aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuillaume Rousse <guillomovitch@gmail.com>2019-03-03 14:18:57 +0100
committerGuillaume Rousse <guillomovitch@gmail.com>2019-03-03 14:21:29 +0100
commit4a5888c8d8d6eeb775b1660b855c59067d24a981 (patch)
treea4f25444f845a5bb9005333f08e6fa3b41817c38
parentbdba69516fe1a5a75daea9ec461eec79d62591a2 (diff)
downloadrpm-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-xphp.req12
1 files changed, 11 insertions, 1 deletions
diff --git a/php.req b/php.req
index 2f67093..62001d8 100755
--- a/php.req
+++ b/php.req
@@ -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$/); }