Skip to content

Commit eda88f2

Browse files
quicklispxach
authored andcommitted
Make the excluded systems mechanism more explicit.
1 parent 9fc9523 commit eda88f2

File tree

1 file changed

+17
-15
lines changed

1 file changed

+17
-15
lines changed

dist-cache.lisp

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -82,24 +82,24 @@
8282

8383
;;; System files
8484

85-
(defun blacklist-table (name)
85+
(defun excluded-systems-table (name)
8686
(let* ((pathname (merge-logical (make-pathname :name name)
8787
#p"quicklisp-controller:projects;qlc-meta;template.txt"))
8888
(lines (and (probe-file pathname) (config-file-lines pathname)))
8989
(table (make-hash-table :test 'equalp)))
9090
(dolist (line lines table)
9191
(setf (gethash line table) t))))
9292

93-
(defun blacklist-list (name)
93+
(defun excluded-systems-list (name)
9494
(let ((pathname (merge-logical (make-pathname :name name)
9595
#p"quicklisp-controller:projects;qlc-meta;template.txt")))
9696
(when (probe-file pathname)
9797
(config-file-lines pathname))))
9898

99-
(defun make-blacklister (source)
99+
(defun make-system-excluder (source)
100100
(lambda (system-file)
101-
(let ((bad-patterns (blacklist-list "system-pathname-blacklist"))
102-
(bad-combos (blacklist-table "blacklist"))
101+
(let ((bad-patterns (excluded-systems-list "excluded-system-pathnames"))
102+
(bad-combos (excluded-systems-table "excluded-systems"))
103103
(combo-key (format nil "~A ~A"
104104
(project-name source)
105105
(pathname-name system-file))))
@@ -108,10 +108,11 @@
108108
(search string (namestring system-file)))
109109
bad-patterns)))))
110110

111-
(defun blacklistedp (source system-file)
112-
"Is SYSTEM-FILE for SOURCE somehow forbidden, e.g. "
113-
(let ((bad-patterns (blacklist-list "system-pathname-blacklist"))
114-
(bad-combos (blacklist-table "blacklist"))
111+
(defun excluded-system-p (source system-file)
112+
"Is SYSTEM-FILE for SOURCE excluded through a pathname exclusion
113+
list or a system name exclusion list?"
114+
(let ((bad-patterns (excluded-systems-list "excluded-system-pathnames"))
115+
(bad-combos (excluded-systems-table "excluded-systems"))
115116
(combo-key (format nil "~A ~A"
116117
(project-name source)
117118
(pathname-name system-file)))
@@ -132,12 +133,12 @@
132133
(defun build-system-files (source)
133134
"Return a list of system files in the build directory of SOURCE."
134135
(setf source (source-designator source))
135-
(let* ((blacklist-fun (make-blacklister source))
136+
(let* ((excluded-system-fun (make-system-excluder source))
136137
(base (ensure-cached-build-directory source))
137138
(wild (merge-pathnames "**/*.asd" base))
138139
(files (directory wild)))
139140
(mapcan (lambda (file)
140-
(unless (funcall blacklist-fun file)
141+
(unless (funcall excluded-system-fun file)
141142
(when (find-if #'upper-case-p (file-namestring file))
142143
(error "Mixed-case system file ~A cannot be used"
143144
file))
@@ -171,7 +172,7 @@ if needed."
171172
(setf source (source-designator source))
172173
(let ((files (ensure-build-system-files source)))
173174
(remove-if (lambda (file)
174-
(blacklistedp source file))
175+
(excluded-system-p source file))
175176
files)))
176177

177178
(defun system-names (source)
@@ -184,7 +185,7 @@ if needed."
184185
;; Add SBCL contribs first
185186
(let* ((base (sb-int:sbcl-homedir-pathname))
186187
(contrib-system-files
187-
(directory (merge-pathnames "contrib/*.asd" base))))
188+
(directory (merge-pathnames "**/*.asd" base))))
188189
(dolist (file contrib-system-files)
189190
(setf (gethash (pathname-name file) table) file)))
190191
(map-sources
@@ -205,6 +206,7 @@ if needed."
205206
:direction :output
206207
:if-exists :supersede)
207208
(maphash (lambda (system-name system-file)
209+
(declare (ignore system-name))
208210
(format stream "~A~%"
209211
(enough-namestring system-file
210212
(translate-logical-pathname file))))
@@ -384,7 +386,7 @@ their name does not match the system file name."
384386
(with-system-index
385387
(dolist (system-file-name (system-names source))
386388
(dolist (system (ignore-errors (system-defined-systems system-file-name)))
387-
(unless (blacklistedp source system)
389+
(unless (excluded-system-p source system)
388390
(funcall fun system-file-name system))))))
389391

390392
(defun acceptable-system-name (name)
@@ -453,7 +455,7 @@ structure \(SYSTEM-FILE-NAME SYSTEM-NAME &REST DEPENDENCIES). "
453455
(defun build-duration (source)
454456
(destructuring-bind (&key start-time end-time)
455457
(timing-data source)
456-
(if start-time
458+
(if (and start-time end-time)
457459
(- end-time start-time)
458460
-1)))
459461

0 commit comments

Comments
 (0)