X-Git-Url: http://git.jankratochvil.net/?p=macros.git;a=blobdiff_plain;f=AutoGen.pm;h=796733ed6c5593f7b263c489f1f2318c20bf2b49;hp=1fad581227e167ad07ad64a884f7b9c09b8b1242;hb=be11781b7d5174124c299671ed0413bd9b0e06cf;hpb=d3c546bf5324f10f4fb176f873ab177f8e585408 diff --git a/AutoGen.pm b/AutoGen.pm index 1fad581..796733e 100644 --- a/AutoGen.pm +++ b/AutoGen.pm @@ -39,7 +39,7 @@ BEGIN { use File::Touch; # &touch use POSIX qw(WIFEXITED WEXITSTATUS WIFSIGNALED WTERMSIG WIFSTOPPED WSTOPSIG); HERE - eval "$_\n; 1;" or push @missing,(/^\s*use\s+([^\s;]+)/)[0]; + eval "$_\n; 1;" or push @missing,(/^\s*use\s+([^ ;]+)/)[0]; } die "You are missing some modules - install them by:\n" ."\tperl -MCPAN -e 'install qw(".join(" ",@missing).")'\n" @@ -120,6 +120,8 @@ 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({ glob $_; } @files); @files==copy @files,$dest or $nocheck or confess "$!"; } @@ -130,6 +132,8 @@ my(@files)=@_; my $nocheck=shift @files if $files[0] eq "nocheck"; my $flag=shift @files if ref $files[0]; + # expand pattern to properly match &remove resulting filenames count + @files=map({ glob $_; } @files); @files==remove((!$flag ? () : $flag),@files) or $nocheck or confess "$!"; } @@ -159,7 +163,7 @@ my($class,%args)=@_; $spec=~s/\\\n/ /gs; $class->run(%Options, "ARGV"=>["--copy"], - "configure_args"=>[split /\s+/,($spec=~/^%configure\s+(.*)$/m)[0]], + "configure_args"=>[split /\s+/,($spec=~/^[%]configure\b[ \t]*(.*)$/m)[0]], ); _remove "ChangeLog"; # force its rebuild by Makefile/rcs2log _system "make dist $name.spec"; @@ -333,8 +337,10 @@ sub _expandclass my($patt)=@_; return $patt if $patt!~/\Q[\E(.*?)\Q]\E/; - my($pre,$post)=($`,$'); # FIXME: local($`,$') doesn't work - why? - return map({ _expandclass("$pre$_$post"); } split("",$1)); + my($pre,$range,$post)=($`,$1,$'); # FIXME: local($`,$1,$') doesn't work - why? + 1 while $range=~s#(.)-(.)# join("",map(chr,(ord($1)..ord($2)))); + #ge; + return map({ _expandclass("$pre$_$post"); } split("",$range)); } sub run