From bdba69516fe1a5a75daea9ec461eec79d62591a2 Mon Sep 17 00:00:00 2001 From: Guillaume Rousse Date: Sun, 3 Mar 2019 13:59:31 +0100 Subject: no need to cache php files list Producing the list isn't expensive enough to justify caching the result, especially if handled incorrectly --- php.req | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/php.req b/php.req index 5f2f79d..2f67093 100755 --- a/php.req +++ b/php.req @@ -75,14 +75,7 @@ foreach (@ARGV ? $ARGV : <> ) { } } -sub cat_ { my @l = map { my $F; open($F, '<', $_) ? <$F> : () } @_; wantarray() ? @l : join '', @l } - -my $cache = "$ENV{RPM_BUILD_ROOT}.php.req.file.cache"; -if (-f $cache) { - @files = cat_($cache); -} else { - qx(find $ENV{RPM_BUILD_ROOT} -name "*php"|grep -v /usr/share/doc |sed -e 's!$ENV{RPM_BUILD_ROOT}!!' > $cache); -} +@files = qx(find $ENV{RPM_BUILD_ROOT} -name "*php"|grep -v /usr/share/doc |sed -e 's!$ENV{RPM_BUILD_ROOT}!!'); f: for $f (keys %req) { for $g (@files) { next f if ($g =~ /\Q$f\E$/); } -- cgit v1.2.1