Use "last edited" timestamp when fetching from emacswiki, and figure out URL automatically

This commit is contained in:
Steve Purcell 2012-01-30 11:01:06 +00:00
parent 73062e6349
commit df77b0e0bf
2 changed files with 12 additions and 12 deletions

View file

@ -63,16 +63,19 @@
:group 'package-build
:type 'string)
(defun package-build-checkout-wiki (repo dir)
(defun package-build-checkout-wiki (filename 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)))))
(download-url (format "http://www.emacswiki.org/emacs/download/%s" filename))
(wiki-url (format "http://www.emacswiki.org/emacs/%s" filename)))
(url-copy-file download-url filename t)
(with-current-buffer (url-retrieve-synchronously wiki-url)
(package-build-find-parse-time
"Last edited \\([0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\} [0-9]\\{2\\}:[0-9]\\{2\\} [A-Z]\\{3\\}\\)")))))
(defun package-build-find-parse-time (regex)
"Find REGEX in current buffer and format as a proper time version."
@ -255,7 +258,9 @@
(cond
((eq repo-type 'wiki)
(print 'EmacsWiki)
(package-build-checkout-wiki repo-url pkg-cwd))
(package-build-checkout-wiki (or (car (plist-get cfg :files))
(concat file-name ".el"))
pkg-cwd))
((eq repo-type 'svn)
(print 'Subversion)
(package-build-checkout-svn repo-url pkg-cwd))

View file

@ -1,6 +1,5 @@
;; -*- mode: emacs-lisp -*-
((ac-dabbrev
:url "http://www.emacswiki.org/emacs/download/ac-dabbrev.el"
:fetcher wiki)
(browse-kill-ring
:url "git://github.com/todesschaf/browse-kill-ring.git"
@ -30,9 +29,7 @@
:fetcher git
:files ("deft.el"))
(dired+
:url "http://www.emacswiki.org/emacs/download/dired+.el"
:fetcher wiki
:files ("dired+.el"))
:fetcher wiki)
(elisp-slime-nav
:url "https://github.com/purcell/elisp-slime-nav.git"
:fetcher git
@ -120,9 +117,7 @@
:url "git://github.com/emacsmirror/pretty-mode.git"
:fetcher git)
(rainbow-delimiters
:url "http://www.emacswiki.org/emacs/download/rainbow-delimiters.el"
:fetcher wiki
:files ("rainbow-delimiters.el"))
:fetcher wiki)
(rinari
:url "git://github.com/eschulte/rinari.git"
:fetcher git