From f529f89ca14b4ee7b6b60c27e063bbe108f69bb3 Mon Sep 17 00:00:00 2001 From: Olivier Blin Date: Wed, 15 Oct 2008 13:36:23 +0000 Subject: do not uselessly wait on stdin if no files have to be filtered --- tools/install-xml-file-list | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'tools') diff --git a/tools/install-xml-file-list b/tools/install-xml-file-list index 5d43ac9eb..f187f746e 100755 --- a/tools/install-xml-file-list +++ b/tools/install-xml-file-list @@ -352,7 +352,7 @@ sub apply_filter { @l = grep { ! -d $_ } @l; if (my $subst = $filter->{subst}) { - system('perl', '-pi', '-e', $subst, @l); + system('perl', '-pi', '-e', $subst, @l) if @l; } if (my $command = $filter->{command}) { $command = $initial_dir . "/$command" if $command =~ m!^..?/!; @@ -363,8 +363,10 @@ sub apply_filter { if_($command eq 'gzip', '-9f'), if_($command eq 'strip', '2>/dev/null'), ); - warn "running $command @options @l\n" if $verbose; - system(join(' ', $command, @options, @l)); + if (@l) { + warn "running $command @options @l\n" if $verbose; + system(join(' ', $command, @options, @l)); + } } } chdir $initial_dir; -- cgit v1.2.1