Skip to content

Commit 902ef26

Browse files
committed
Make SKIP restart available in pmap-sources.
1 parent 2f289fa commit 902ef26

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

upstream.lisp

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -121,14 +121,17 @@
121121

122122
(defvar *current-mapped-source* nil)
123123

124+
(defun map-source (fun source)
125+
(let ((*current-mapped-source* (project-name source-file)))
126+
(with-simple-restart (skip "Skip ~A source" *current-mapped-source*)
127+
(funcall fun source))))
128+
124129
(defun map-sources (fun)
125130
(with-simple-restart (abort "Give up entirely")
126131
(dolist (source-file
127132
(directory #p"quicklisp-controller:projects;**;source.txt"))
128-
(let* ((project-name (pathname-project-name source-file))
129-
(*current-mapped-source* project-name))
130-
(with-simple-restart (skip "Skip ~A source" project-name)
131-
(funcall fun (load-source-file project-name source-file)))))))
133+
(let ((project-name (pathname-project-name source-file)))
134+
(map-source fun (load-source-file project-name source-file))))))
132135

133136
(defun pmap-sources (fun)
134137
(let ((dependency-tree (lparallel:make-ptree))
@@ -137,10 +140,10 @@
137140
(map-sources (lambda (source)
138141
(let ((host (source-host source)))
139142
(lparallel:ptree-fn i (gethash host host-dependency)
140-
(lambda (&optional arg)
141-
(declare (ignore arg))
142-
(funcall fun source))
143-
dependency-tree)
143+
(lambda (&optional arg)
144+
(declare (ignore arg))
145+
(map-source fun source))
146+
dependency-tree)
144147
(setf (gethash host host-dependency) (list i))
145148
(incf i))))
146149
(lparallel:ptree-fn 'everything (loop for j below i collect j)

0 commit comments

Comments
 (0)