|
26 | 26 | (defmethod base-directory ((source upstream-source)) |
27 | 27 | (pathname (directory-namestring (source-file source)))) |
28 | 28 |
|
| 29 | +(defgeneric days-old (source) |
| 30 | + (:method (source) |
| 31 | + (truncate (- (get-universal-time) |
| 32 | + (file-write-date (source-file source))) |
| 33 | + 86400))) |
| 34 | + |
29 | 35 | (defgeneric print-source (source stream) |
30 | 36 | (:method (source stream) |
31 | 37 | (format stream "~S ~S" |
|
146 | 152 | (defun collect-sources-if (fun) |
147 | 153 | (let ((result '())) |
148 | 154 | (map-sources (lambda (source) |
149 | | - (when (funcall fun source) |
150 | | - (push source result)))) |
| 155 | + (when (funcall fun source) |
| 156 | + (push source result)))) |
151 | 157 | (sort result 'string< :key 'name))) |
152 | 158 |
|
153 | 159 | (defun pmap-sources (fun &key (parallel-key #'source-host) |
|
187 | 193 | (not |
188 | 194 | (probe-file |
189 | 195 | (make-pathname :type nil :name "fresh-cache" |
190 | | - :defaults (project-name-source-file (name source)) ))))) |
| 196 | + :defaults (project-name-source-file (name source)) ))))) |
191 | 197 |
|
192 | 198 | (defun find-source (project-name) |
193 | 199 | (let* ((name (string-downcase project-name)) |
|
225 | 231 |
|
226 | 232 | (defun missing-commands () |
227 | 233 | (let ((missing '()) |
228 | | - (tried (make-string-table))) |
| 234 | + (tried (make-string-table))) |
229 | 235 | (map-sources |
230 | 236 | (lambda (source) |
231 | 237 | (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))))))) |
237 | 243 | missing)) |
0 commit comments