From 2fe4f631791abe05fcdee60afe85175d2a1960ea Mon Sep 17 00:00:00 2001 From: Donald Ephraim Curtis Date: Sat, 28 Jan 2012 19:26:20 -0600 Subject: [PATCH] Added ability to checkout wiki-based packages. --- package-build.el | 19 ++++++++++++++++++- pkglist | 5 +++-- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/package-build.el b/package-build.el index 8f899021..d1b530a2 100644 --- a/package-build.el +++ b/package-build.el @@ -63,6 +63,18 @@ :group 'package-build :type 'string) +(defun package-build-checkout-wiki (repo dir) + "checkout a package from the wiki" + (with-current-buffer (get-buffer-create "*package-build-checkout*") + (message dir) + (unless (file-exists-p dir) + (make-directory dir)) + (let ((default-directory dir) + (filename (file-name-nondirectory repo))) + (url-copy-file repo filename t) + (format-time-string "%Y%m%d" (current-time))))) + + (defun package-build-checkout-darcs (repo dir) "checkout a darcs package" (with-current-buffer (get-buffer-create "*package-build-checkout*") @@ -280,6 +292,9 @@ (repo-url (plist-get cfg :url)) (version (cond + ((eq repo-type 'wiki) + (print 'EmacsWiki) + (package-build-checkout-wiki repo-url pkg-cwd)) ((eq repo-type 'svn) (print 'Subversion) (package-build-checkout-svn repo-url pkg-cwd)) @@ -293,11 +308,13 @@ (files (package-expand-file-list pkg-cwd (plist-get cfg :files))) (default-directory package-build-working-dir)) (cond + ((not version) + (print (format "Unable to check out repository: %s" repo-url))) ((= 1 (length files)) (let* ((pkgsrc (expand-file-name (car files) pkg-cwd)) (pkgdst (expand-file-name (concat file-name "-" version ".el") - package-build-archive-dir)) + package-build-archive-dir)) (pkg-info (package-build-get-package-info pkgsrc))) (unless pkg-info (setq pkg-info diff --git a/pkglist b/pkglist index 85d6a361..716785c8 100644 --- a/pkglist +++ b/pkglist @@ -20,8 +20,9 @@ :fetcher git :files ("deft.el")) (dired+ - :url "git://github.com/emacsmirror/dired-plus.git" - :fetcher git) + :url "http://www.emacswiki.org/emacs/download/dired+.el" + :fetcher wiki + :files ("dired+.el")) (elisp-slime-nav :url "https://github.com/purcell/elisp-slime-nav.git" :fetcher git