From 2ed59d13a8891bf19433fa7946277d59fa7f3fa9 Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Sat, 30 Apr 2016 07:16:17 -0700 Subject: use File::Find::Rule instead of shell grep & glob --- dh_elpa_test | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'dh_elpa_test') diff --git a/dh_elpa_test b/dh_elpa_test index 2b0074e..dab208c 100755 --- a/dh_elpa_test +++ b/dh_elpa_test @@ -89,7 +89,7 @@ B invokes Emacs to run ERT tests. =cut -use Text::Glob qw{ match_glob }; +use File::Find::Rule; use Array::Utils qw{ array_minus }; use Debian::Debhelper::Dh_Lib; @@ -126,16 +126,17 @@ if ($control->source->Build_Depends->has( "elpa-buttercup" )) { # ---- ERT -$Text::Glob::strict_wildcard_slash = 0; -my @ert_files = map { s|^\./||r } - split("\n", `grep -lr "ert-deftest" . --exclude-dir=.pc --exclude-dir=debian`); +my $rule = File::Find::Rule + ->file() + ->name( '*.el' ) + ->grep( "ert-deftest" ) + ->none( File::Find::Rule->name('debian/*'), File::Find::Rule->name('.pc/*') ); if (defined $ENV{'DH_ELPA_TEST_ERT_EXCLUDE'}) { foreach my $glob (split(',', $ENV{'DH_ELPA_TEST_ERT_EXCLUDE'})) { - if ( my @matches = match_glob( $glob, @ert_files ) ) { - @ert_files = array_minus( @ert_files, @matches ); - } + $rule->not_name($glob); } } +my @ert_files = $rule->in('.'); if (@ert_files) { my @args = qw{ emacs -batch -Q -l package }; -- cgit v1.2.3