Skip to content

Commit 9fc9523

Browse files
committed
Misc updates
1 parent a7ed476 commit 9fc9523

File tree

2 files changed

+26
-9
lines changed

2 files changed

+26
-9
lines changed

misc.lisp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -567,3 +567,14 @@ source's source.txt file. Useful for bulk-updating sources."
567567
(format t ";;; ~A~%" project)
568568
(with-simple-restart (skip "Skip ~A" project)
569569
(update-source-cache (find-source project)))))
570+
571+
;;; Recrank only failing systems
572+
573+
(defun recrank-failing-systems ()
574+
(map nil
575+
(lambda (source)
576+
(format *trace-output* "~&; XXX updating and cranking ~A~%" source)
577+
(update-and-crank source))
578+
(remove-duplicates (mapcar 'source (failing-systems))
579+
:key 'name
580+
:test 'equal)))

upstream.lisp

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,12 @@
2626
(defmethod base-directory ((source upstream-source))
2727
(pathname (directory-namestring (source-file source))))
2828

29+
(defgeneric days-old (source)
30+
(:method (source)
31+
(truncate (- (get-universal-time)
32+
(file-write-date (source-file source)))
33+
86400)))
34+
2935
(defgeneric print-source (source stream)
3036
(:method (source stream)
3137
(format stream "~S ~S"
@@ -146,8 +152,8 @@
146152
(defun collect-sources-if (fun)
147153
(let ((result '()))
148154
(map-sources (lambda (source)
149-
(when (funcall fun source)
150-
(push source result))))
155+
(when (funcall fun source)
156+
(push source result))))
151157
(sort result 'string< :key 'name)))
152158

153159
(defun pmap-sources (fun &key (parallel-key #'source-host)
@@ -187,7 +193,7 @@
187193
(not
188194
(probe-file
189195
(make-pathname :type nil :name "fresh-cache"
190-
:defaults (project-name-source-file (name source)) )))))
196+
:defaults (project-name-source-file (name source)) )))))
191197

192198
(defun find-source (project-name)
193199
(let* ((name (string-downcase project-name))
@@ -225,13 +231,13 @@
225231

226232
(defun missing-commands ()
227233
(let ((missing '())
228-
(tried (make-string-table)))
234+
(tried (make-string-table)))
229235
(map-sources
230236
(lambda (source)
231237
(let ((command (command source)))
232-
(when command
233-
(unless (gethash command tried)
234-
(setf (gethash command tried) t)
235-
(unless (ignore-errors (run command "--version"))
236-
(push command missing)))))))
238+
(when command
239+
(unless (gethash command tried)
240+
(setf (gethash command tried) t)
241+
(unless (ignore-errors (run command "--version"))
242+
(push command missing)))))))
237243
missing))

0 commit comments

Comments
 (0)