Commit e2bd9ddd authored by Francois-Rene Rideau's avatar Francois-Rene Rideau

Move three functions from action to plan

Also make traverse-actions and required-components simple defuns.
It's unclear why they were in action.
Maybe at some point in the past, they have been used earlier in the build.
parent cba5261e
......@@ -15,7 +15,6 @@
#:action-status #:action-stamp #:action-done-p
#:component-operation-time #:mark-operation-done #:compute-action-stamp
#:perform #:perform-with-restarts #:retry #:accept
#:traverse-actions #:traverse-sub-actions #:required-components ;; in plan
#:action-path #:find-action #:stamp #:done-p
#:operation-definition-warning #:operation-definition-error ;; condition
))
......@@ -34,13 +33,6 @@ and a class-name or class designates the canonical instance of the designated cl
'(or operation null symbol class)))
;;; TODO: These should be moved to asdf/plan and be made simple defuns.
(with-upgradability ()
(defgeneric traverse-actions (actions &key &allow-other-keys))
(defgeneric traverse-sub-actions (operation component &key &allow-other-keys))
(defgeneric required-components (component &key &allow-other-keys)))
;;;; Reified representation for storage or debugging. Note: it drops the operation-original-initargs
(with-upgradability ()
(defun action-path (action)
......
......@@ -6,7 +6,7 @@
(:use :uiop/common-lisp :uiop :asdf/upgrade
:asdf/component :asdf/operation
:asdf/system :asdf/find-system
:asdf/action :asdf/lisp-action :asdf/bundle)
:asdf/action :asdf/lisp-action :asdf/plan :asdf/bundle)
(:export
#:concatenate-source-op
#:load-concatenated-source-op
......
......@@ -514,12 +514,13 @@ initialized with SEED."
(typep c (plan-component-type plan))
(call-next-method)))
(defmethod traverse-actions (actions &rest keys &key plan-class &allow-other-keys)
(defun (traverse-actions) (actions &rest keys &key plan-class &allow-other-keys)
"Given a list of actions, build a plan with these actions as roots."
(let ((plan (apply 'make-instance (or plan-class 'filtered-sequential-plan) keys)))
(loop* :for (o . c) :in actions :do (traverse-action plan o c t))
plan))
(defgeneric traverse-sub-actions (operation component &key &allow-other-keys))
(define-convenience-action-methods traverse-sub-actions (operation component &key))
(defmethod traverse-sub-actions ((operation operation) (component component)
&rest keys &key &allow-other-keys)
......@@ -532,7 +533,7 @@ initialized with SEED."
:when (and (typep o keep-operation) (typep c keep-component))
:collect (cons o c))))
(defmethod required-components (system &rest keys &key (goal-operation 'load-op) &allow-other-keys)
(defun (required-components) (system &rest keys &key (goal-operation 'load-op) &allow-other-keys)
"Given a SYSTEM and a GOAL-OPERATION (default LOAD-OP), traverse the dependencies and
return a list of the components involved in building the desired action."
(remove-duplicates
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment