forked from nex3/marmalade
/
marmalade-test.el
31 lines (27 loc) · 963 Bytes
/
marmalade-test.el
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
:;exec emacs -batch -Q -l "$0" -f marmalade-test "$@"
;; Test marmalade from the command line by attempting to install the
;; fakir package.
;; It's all done in a new temporary directory (based on the pid of the
;; emacs process) so it should be very isolated from any emacs you
;; have running.
(defun marmalade-test ()
(interactive)
(let ((dir (concat
temporary-file-directory
(format "marmalade-%d/" (emacs-pid)))))
(when (file-exists-p dir)
(delete-directory dir 't))
(make-directory dir)
(setq package-user-dir
(concat
dir
".elpa"))
(setq package-archives
'(("gnu" . "http://elpa.gnu.org/packages/")
("marmalade" . "http://marmalade-repo.org/packages/")))
(package-initialize)
(package-refresh-contents)
(condition-case nil
(package-install 'fakir)
(error (message "failed to install package!")))))
;;; marmalade-test.el ends