add :exclude handler

closes #709
This commit is contained in:
Donald Curtis 2013-05-03 21:44:56 -05:00
parent a535ed7f93
commit 05f660e639

View file

@ -644,19 +644,25 @@ of the same-named package which is to be kept."
The result is a list of (SOURCE . DEST), where SOURCE is a source The result is a list of (SOURCE . DEST), where SOURCE is a source
file path and DEST is the relative path to which it should be copied." file path and DEST is the relative path to which it should be copied."
(let ((default-directory dir) (let ((default-directory dir)
(prefix (if subdir (prefix (if subdir (format "%s/" subdir) ""))
(format "%s/" subdir) (lst))
""))) (dolist (entry specs lst)
(cl-mapcan (setq lst
(lambda (entry) (if (consp entry)
(if (consp entry) (if (eq :exclude (car entry))
(pb/expand-file-specs dir (cl-nset-difference lst
(cdr entry) (pb/expand-file-specs dir (cdr entry))
(concat prefix (car entry))) :key 'car
(mapcar (lambda (f) :test 'equal)
(cons f (concat prefix (file-name-nondirectory f)))) (nconc lst
(file-expand-wildcards entry)))) (pb/expand-file-specs dir
specs))) (cdr entry)
(concat prefix (car entry)))))
(nconc
lst (mapcar (lambda (f)
(cons f (concat prefix (file-name-nondirectory f))))
(file-expand-wildcards entry))))))))
(defun pb/expand-config-file-list (dir config) (defun pb/expand-config-file-list (dir config)
"In DIR, expand the :files for CONFIG using 'pb/expand-file-specs." "In DIR, expand the :files for CONFIG using 'pb/expand-file-specs."