aboutsummaryrefslogtreecommitdiff
path: root/src/combinator.lisp
Commit message (Collapse)AuthorAge
* APPLY-AND-PRINT: add some commentarySean Whitton2022-06-27
| | | | Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
* ESEQPROPS-UNTIL: lift restriction on class of the conditionSean Whitton2022-06-27
| | | | Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
* factor out PROG-CHANGESSean Whitton2022-06-14
| | | | Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
* WITH-UNAPPLY: use LDIFFSean Whitton2022-05-14
| | | | Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
* rename basic propapp accessorsSean Whitton2022-04-04
| | | | Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
* replace uses of COLLAPSE-TYPES & drop the functionSean Whitton2022-04-02
| | | | Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
* rename COLLAPSE-PROPAPP-TYPES -> COMBINE-PROPAPP-TYPESSean Whitton2022-04-02
| | | | Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
* connection chain specs.: consistently use :USER for the target userSean Whitton2022-04-01
| | | | Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
* rename combinator UNAPPLY->UNAPPLIED and add new UNAPPLY macroSean Whitton2021-12-13
| | | | Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
* add LXC properties, :LXC{,-UNPRIV-ATTACH} connections, WITH-HOMEDIRSean Whitton2021-11-08
| | | | Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
* ON{-APPLY,}-CHANGE: always return result of primary propappSean Whitton2021-11-01
| | | | | | | In particular, if the secondary propapps are applied but make no change, do not return :NO-CHANGE as the overall result. Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
* add SKIP-SEQUENCE, ABORTED-CHANGE, ESEQPROPS-UNTILSean Whitton2021-10-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We establish a SKIP-PROPERTY restart for each sequencing combinator, such that in addition to skipping over individual property applications, it is possible to abandon the whole sequence. However, that restart discards information about whether or not a change was made by the property applications of the abandoned sequence prior to the property application interrupted by an error. The new SKIP-SEQUENCE restart preserves this information by returning from the DOLIST in APPLY-AND-PRINT. The implementation of the SKIP-SEQUENCE restart must take into account the fact that the property application interrupted by the error might have made a change prior to failing. In particular, the new restart must not cause the sequencing combinator to return :NO-CHANGE unless it can infer that the property application interrupted by an error made no change. To achieve this, capture whether the interrupted property application made a change by introducing a distinction between plain FAILED-CHANGE and a new condition class, ABORTED-CHANGE. These changes permit the implementation of a new combinator, ESEQPROPS-UNTIL, which invokes SKIP-SEQUENCE when a given condition is signalled. The new combinator is like SEQPROPS in that it allows for continuing the deployment despite a signalling of FAILED-CHANGE, but it is like ESEQPROPS in not attempting to apply succeeding propapps. It also offers finer-grained control over what kinds of failures are to be tolerated than does SEQPROPS. When the condition is ABORTED-CHANGE or a subclass, ESEQPROPS-UNTIL returns information about whether or not a change was made by the property applications of the abandoned sequence prior to the property application that was interrupted, enabling useful combinations with ON-CHANGE. Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
* refactor APPLY-AND-PRINT, hopefully in favour of readabilitySean Whitton2021-09-08
| | | | Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
* refactor SILENT-SEQPROPS and inline WITH-SKIP-PROPERTYSean Whitton2021-09-08
| | | | | | Previously, part of APPLY-AND-PRINT was duplicated in SILENT-SEQPROPS. Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
* UNWIND-PROTECT-IN-PARENT -> UNWIND-PROTECTSean Whitton2021-07-24
| | | | | | No longer needed thanks to f4e9170e73cb4bcfa7328422b4ff4f72d1339dd0. Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
* add ON-APPLY-CHANGESean Whitton2021-07-10
| | | | | | Also see b24ff2c7365ee8d42063cbfa06ece3ef591d9a35. Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
* ON-CHANGE*: factor out (CAR PROPAPP)Sean Whitton2021-07-10
| | | | Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
* ON-CHANGE: use ESEQPROPS to sequence the secondary propappsSean Whitton2021-07-10
| | | | | | | This means that we get APPLY-AND-PRINT's output when there are multiple secondary propapps. Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
* (remove-if #'null ...) -> (remove nil ...) & similarly for DELETE-IFSean Whitton2021-07-10
| | | | Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
* invoke the SKIP-PROPERTY restart established right after the handlerSean Whitton2021-07-10
| | | | | | This should better preserve the semantics of the sequencing combinators. Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
* SILENT-SEQPROPS: actually establish SKIP-PROPERTY restartSean Whitton2021-07-10
| | | | | | Also see f08989da7485b7bb165caa536eabd415a9f3ac7d. Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
* APPLY-AND-PRINT: avoid returning 'FAILED-CHANGESean Whitton2021-07-10
| | | | | | The value is not meant to be used outside of combinator.lisp. Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
* APPLY-AND-PRINT: ensure print "failed" if there is a non-local exitSean Whitton2021-07-10
| | | | Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
* make it possible to distinguish SKIP-PROPERTY restarts in debuggerSean Whitton2021-07-10
| | | | Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
* APPLY-AND-PRINT: fix clearing the bufferSean Whitton2021-07-10
| | | | Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
* signal SKIPPED-PROPERTIES & factor out interpreting exit codesSean Whitton2021-07-10
| | | | | | | | | | | | Unconditionally signalling FAILED-CHANGE does not make sense because perhaps the type of condition C is not a subtype of SIMPLE-CONDITION. Moreover, when we invoke the SKIP-PROPERTY restart we do not actually pass the condition. For simplicity, and since all we need is notification that a SKIP-PROPERTY restart was invoked, instead define and signal a special-purpose condition. Additionally, use an exit code to pass the signal between Lisp images. Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
* WITH-FLAGFILE: 'mkdir -p' flag file's directory & 'rm -f' on unapplySean Whitton2021-07-06
| | | | | | | 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>
* skip announcing properties starting with '%' unless debug level >=3Sean Whitton2021-07-06
| | | | Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
* report whether FAILED-CHANGE, :NO-CHANGE or something else at endSean Whitton2021-06-28
| | | | Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
* add PROPAPPARGS and some Postfix propertiesSean Whitton2021-06-18
| | | | Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
* ON-CHANGE: when unapplying, apply the secondary propappsSean Whitton2021-06-17
| | | | | | | | | | | | | | I believe the new semantics are more useful: when we unapply a property which has additional properties which will be applied when a change is made, also apply those properties in just the same way when unapplying the primary property makes a change. WITH-UNAPPLY can be used to override, or we might add a variant of ON-CHANGE which ignores the secondary propapps completely when unapplying. But I can't currently envisage a situation in which what is wanted is unapplying the secondary propapps in reverse order. Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
* add WITH-UNAPPLY & COLLAPSE-PROPAPP-TYPESSean Whitton2021-06-08
| | | | Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
* factor out LAMBDA-IGNORING-ARGSSean Whitton2021-06-07
| | | | Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
* use PUNAPPLY not just UNAPPLY & export symbol plist entry namesSean Whitton2021-06-07
| | | | | | | | At least for now let's not prefix all the SETPROP symbol plist entry names with 'p', but at least avoid having to remember which of :APPLY and :UNAPPLY subroutines are in a slot prefixed with a 'p'. Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
* WITH-SKIP-FAILED-CHANGES: fix call to INFORMATSean Whitton2021-06-05
| | | | Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
* APPLY-AND-PRINT: try to avoid announcing internal DEFPROPsSean Whitton2021-05-31
| | | | Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
* APPLY-AND-PRINT: use a non-keyword rather than :FAILED-CHANGESean Whitton2021-05-31
| | | | Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
* add WITH-FLAGFILESean Whitton2021-05-30
| | | | Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
* when collecting output, accept UnicodeSean Whitton2021-05-06
| | | | Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
* fix SILENT-SEQPROPS not reporting :NO-CHANGESean Whitton2021-05-06
| | | | Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
* APPLY-AND-PRINT: propagate the return value of the final applicationSean Whitton2021-05-06
| | | | | | Mainly for the sake of EVALS. Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
* refactor APPLY-AND-PRINT to print output even when unhandled errorSean Whitton2021-04-24
| | | | Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
* APPLY-AND-PRINT: fix argument orderSean Whitton2021-04-08
| | | | Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
* APPLY-AND-RUN: disable output hiding when at debug level above 1Sean Whitton2021-04-08
| | | | Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
* don't print indented output when no change was madeSean Whitton2021-04-05
| | | | Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
* ON-CHANGE*: call all :HOSTATTRS subroutinesSean Whitton2021-04-05
| | | | Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
* the empty list is now a valid propappSean Whitton2021-04-05
| | | | Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
* add DESC combinatorSean Whitton2021-04-05
| | | | Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
* APPLY-AND-PRINT: for combinators without descriptions, don't indentSean Whitton2021-04-05
| | | | Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
* add OS:TYPECASE and OS:HOST-TYPECASESean Whitton2021-04-02
| | | | Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>