diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2016-04-30 07:16:17 -0700 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2016-04-30 07:16:17 -0700 |
commit | 2ed59d13a8891bf19433fa7946277d59fa7f3fa9 (patch) | |
tree | cd7c4e4664d91084d8f7e6b3958f0ee3ec64fde0 /dh_elpa_test | |
parent | 3bb13dd10c27ea076502daaa0b71806786a5490c (diff) |
use File::Find::Rule instead of shell grep & glob
Diffstat (limited to 'dh_elpa_test')
-rwxr-xr-x | dh_elpa_test | 15 |
1 files changed, 8 insertions, 7 deletions
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<dh_elpa_test> 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 }; |