From: short <> Date: Thu, 10 Jul 2003 16:09:04 +0000 (+0000) Subject: _copy() and _remove(): Fixed checking on pattern matching multiple files. X-Git-Tag: lufs_0_9_6_captive1~26 X-Git-Url: http://git.jankratochvil.net/?p=macros.git;a=commitdiff_plain;h=df3336d8450e4fb390c525b995377cf21448a8c3 _copy() and _remove(): Fixed checking on pattern matching multiple files. --- diff --git a/AutoGen.pm b/AutoGen.pm index aa28398..4bbb8fd 100644 --- a/AutoGen.pm +++ b/AutoGen.pm @@ -38,6 +38,7 @@ BEGIN { use File::chdir; # $CWD use File::Touch; # &touch use POSIX qw(WIFEXITED WEXITSTATUS WIFSIGNALED WTERMSIG WIFSTOPPED WSTOPSIG); + use File::Glob qw(:glob); # &bsd_glob, &GLOB_* HERE eval "$_\n; 1;" or push @missing,(/^\s*use\s+([^ ;]+)/)[0]; } @@ -120,6 +121,9 @@ my(@files)=@_; my $nocheck=shift @files if $files[0] eq "nocheck"; my $dest=pop @files; + # expand pattern to properly match © resulting filenames count + @files=map({ bsd_glob $_,&GLOB_ERR|&GLOB_NOSORT; } @files); + confess "$!" if $File::Glob::GLOB_ERROR; @files==copy @files,$dest or $nocheck or confess "$!"; } @@ -130,6 +134,9 @@ my(@files)=@_; my $nocheck=shift @files if $files[0] eq "nocheck"; my $flag=shift @files if ref $files[0]; + # expand pattern to properly match © resulting filenames count + @files=map({ bsd_glob $_,&GLOB_ERR|&GLOB_NOSORT; } @files); + confess "$!" if $File::Glob::GLOB_ERROR; @files==remove((!$flag ? () : $flag),@files) or $nocheck or confess "$!"; }