From 5417d0165a4f6dea6088820a190cf6069046d313 Mon Sep 17 00:00:00 2001 From: Avery Pennarun Date: Sat, 13 Nov 2010 01:22:11 -0800 Subject: [PATCH] redo-ifcreate: barf if the file already exists. I'm pretty sure this must be the intended behaviour. It's kind of meaningless to use this to declare a dependency on a file that might start to exist later, if the file already exists. --- redo-ifcreate.py | 3 ++- t/hello.o.do | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/redo-ifcreate.py b/redo-ifcreate.py index 473f61e..1091ba6 100755 --- a/redo-ifcreate.py +++ b/redo-ifcreate.py @@ -11,6 +11,7 @@ if not vars.TARGET: for t in sys.argv[1:]: mkdirp('%s/.redo' % vars.BASE) if os.path.exists(t): - add_dep(vars.TARGET, 'm', t) + err('redo-ifcreate: error: %r already exists\n' % t) + sys.exit(1) else: add_dep(vars.TARGET, 'c', t) diff --git a/t/hello.o.do b/t/hello.o.do index 543adfa..543bf85 100644 --- a/t/hello.o.do +++ b/t/hello.o.do @@ -1,2 +1,3 @@ redo-ifchange CC hello.c /usr/include/stdio.h +redo-ifcreate stdio.h ./CC hello.c