diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2021-07-02 11:07:47 -0700 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2021-07-06 21:19:39 -0700 |
commit | e66c70d1dfe8581e7d6d82b14e278d91e0f92b6a (patch) | |
tree | 78507cff4ad0b44ede6d3ba613d9438e28455e44 /src/combinator.lisp | |
parent | 70f67680de01948847b1124b6583299e38509f1f (diff) | |
download | consfigurator-e66c70d1dfe8581e7d6d82b14e278d91e0f92b6a.tar.gz |
WITH-FLAGFILE: 'mkdir -p' flag file's directory & 'rm -f' on unapply
Avoids a failure if the flag file's directory does not exist, and enables
unapplying the property before it has ever been applied to a host.
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
Diffstat (limited to 'src/combinator.lisp')
-rw-r--r-- | src/combinator.lisp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/combinator.lisp b/src/combinator.lisp index 2f2d6f6..68642ea 100644 --- a/src/combinator.lisp +++ b/src/combinator.lisp @@ -258,10 +258,12 @@ FLAGFILE exists, PROPAPPS are assumed to all be already applied." (remote-exists-p flagfile)) :apply (lambda-ignoring-args (prog1 (propappapply propapp) + (mrun "mkdir" "-p" + (pathname-directory-pathname flagfile)) (mrun "touch" flagfile))) :unapply (lambda-ignoring-args (prog1 (propappunapply propapp) - (mrun "rm" flagfile))) + (mrun "rm" "-f" flagfile))) :args (cdr propapp))) (define-function-property-combinator with-unapply (&rest propapps) |