add elisp script to print missing packages

response to #72
This commit is contained in:
Donald Curtis 2012-04-15 23:11:11 -05:00
parent 75c5a43049
commit 466327d532

27
missing.el Executable file
View file

@ -0,0 +1,27 @@
#!/usr/bin/env emacs --script
(defun difference (left right)
"compare two lists"
(let ((caleft (car left))
(caright (car right)))
(cond
((not left) right)
((not right) left)
((string< caleft caright)
(cons caleft (difference (cdr left) right)))
((string< caright caleft)
(cons caright (difference left (cdr right))))
(t (difference (cdr left) (cdr right))))))
(defun stripstuff (fn)
"strip the date and extension"
(string-match "\\\(.*\\\)-[0-9]+\.\\\(el$\\\|tar$\\\)" fn)
(match-string 1 fn))
(mapc 'message
(difference
(print (sort (directory-files "recipes/" nil "[^.].*") 'string<))
(print (sort (mapcar 'stripstuff (directory-files "packages/" nil "[^.].*\\\(el$\\\|tar$\\\)")) 'string<))))