From 520de2a8f461209ef5af346d144383c738c47235 Mon Sep 17 00:00:00 2001 From: Stefan Bodewig Date: Thu, 25 Mar 2010 14:14:53 +0000 Subject: [PATCH] bash completion failes if ant throws an exception. Submitted by Omer Shapira. PR 48980 git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@927416 13f79535-47bb-0310-9956-ffa450edef68 --- CONTRIBUTORS | 1 + WHATSNEW | 4 ++++ contributors.xml | 4 ++++ src/script/complete-ant-cmd.pl | 2 +- 4 files changed, 10 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 57b29de7a..e8cf42774 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -237,6 +237,7 @@ Nico Seessle Nigel Magnay Oliver Merkel Oliver Rossmueller +Omer Shapira Oystein Gisnas Patrick C. Beard Patrick Chanezon diff --git a/WHATSNEW b/WHATSNEW index eb329c799..66ebadf46 100644 --- a/WHATSNEW +++ b/WHATSNEW @@ -64,6 +64,10 @@ Fixed bugs: * email : IO error sending mail with plain mimetype Bug 48932 + * the complete-ant-cmd.pl script failed to create a proper cache of + target if "ant -p" failed. + Bugzilla Report 48980 + Other changes: -------------- diff --git a/contributors.xml b/contributors.xml index 57adce3a0..f16c3fdba 100644 --- a/contributors.xml +++ b/contributors.xml @@ -973,6 +973,10 @@ Oliver Rossmueller + + Omer + Shapira + Øystein Gisnås diff --git a/src/script/complete-ant-cmd.pl b/src/script/complete-ant-cmd.pl index b58c26e15..37891241b 100644 --- a/src/script/complete-ant-cmd.pl +++ b/src/script/complete-ant-cmd.pl @@ -83,7 +83,7 @@ sub getTargets { # cache-file. my $cacheFile = $buildFile; $cacheFile =~ s|(.*/)?(.*)|${1}.ant-targets-${2}|; - if ((!-e $cacheFile) || (-M $buildFile) < (-M $cacheFile)) { + if ((!-e $cacheFile) || (-z $cacheFile) || (-M $buildFile) < (-M $cacheFile)) { open( CACHE, '>'.$cacheFile ) || die "can\'t write $cacheFile: $!\n"; open( HELP, "$antCmd -projecthelp -f '$buildFile'|" ) || return(); my %targets;