2012-07-17 10:10:18 +00:00
|
|
|
#!/bin/sh
|
|
|
|
:;exec emacs --script "$0" "$@"
|
2012-01-21 20:05:09 +00:00
|
|
|
|
|
|
|
(defun read-from-file (file-name)
|
|
|
|
"read one lisp expression from a file"
|
|
|
|
(cond
|
|
|
|
((file-exists-p file-name)
|
|
|
|
(with-temp-buffer
|
|
|
|
(insert-file-contents-literally file-name)
|
|
|
|
(goto-char (point-min))
|
|
|
|
(car
|
|
|
|
(read-from-string
|
|
|
|
(buffer-substring-no-properties (point-min) (point-max))))))))
|
|
|
|
|
|
|
|
(message (prin1-to-string command-line-args-left))
|
2012-01-21 20:28:34 +00:00
|
|
|
(defun process-one (file-name)
|
|
|
|
(let ((config
|
|
|
|
(read-from-file
|
2012-01-22 06:38:53 +00:00
|
|
|
(expand-file-name ".config" (expand-file-name file-name "epkgs")))))
|
2012-01-21 20:05:09 +00:00
|
|
|
(princ
|
|
|
|
(pp-to-string
|
|
|
|
(cons
|
|
|
|
(intern file-name)
|
|
|
|
(plist-put
|
|
|
|
(plist-put
|
2012-01-22 06:38:53 +00:00
|
|
|
nil
|
2012-01-21 20:05:09 +00:00
|
|
|
:url
|
|
|
|
(plist-get config :url))
|
|
|
|
:fetcher
|
|
|
|
(plist-get config :fetcher)))
|
|
|
|
))))
|
2012-01-21 20:28:34 +00:00
|
|
|
|
|
|
|
(mapc 'process-one command-line-args-left)
|