From 0399526e49d89213374c75cc7a867ddc864ff1c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Abrah=C3=A1n=20Fern=C3=A1ndez=20Nieto?= Date: Sat, 14 Apr 2012 14:31:18 +0200 Subject: [PATCH 001/111] Added recipe for jabber-mode. --- recipes/jabber-mode | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 recipes/jabber-mode diff --git a/recipes/jabber-mode b/recipes/jabber-mode new file mode 100644 index 00000000..c521bb60 --- /dev/null +++ b/recipes/jabber-mode @@ -0,0 +1,2 @@ +(jabber-mode :url "git://emacs-jabber.git.sourceforge.net/gitroot/emacs-jabber/emacs-jabber" + :fetcher git) \ No newline at end of file From f2cf21b79d47a4bc154ac15f8111794ca9eeac16 Mon Sep 17 00:00:00 2001 From: Andrey Kotlarski Date: Sat, 14 Apr 2012 12:41:16 +0300 Subject: [PATCH 002/111] Add recipe for redshank. --- recipes/redshank | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 recipes/redshank diff --git a/recipes/redshank b/recipes/redshank new file mode 100644 index 00000000..1d6db138 --- /dev/null +++ b/recipes/redshank @@ -0,0 +1,4 @@ +(redshank + :url "http://www.foldr.org/~michaelw/projects/redshank.git" + :fetcher git + :files ("*.el" "*.lisp")) From 95eb49d4f480eaa816e877de517e28cc4df3c18c Mon Sep 17 00:00:00 2001 From: Emanuel Evans Date: Sat, 14 Apr 2012 15:12:04 -0400 Subject: [PATCH 003/111] Add recipe for gnuplot-mode --- recipes/gnuplot | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 recipes/gnuplot diff --git a/recipes/gnuplot b/recipes/gnuplot new file mode 100644 index 00000000..6824e042 --- /dev/null +++ b/recipes/gnuplot @@ -0,0 +1,4 @@ +(gnuplot + :repo "bruceravel/gnuplot-mode" + :fetcher github + :files ("gnuplot.el" "gnuplot-gui.el")) From a09cab3600c5d617d13de721f536538840396a04 Mon Sep 17 00:00:00 2001 From: Steven Deobald Date: Sun, 15 Apr 2012 01:05:22 +0530 Subject: [PATCH 004/111] [sd] added adam spiers smooth scrolling --- recipes/smooth-scrolling | 1 + 1 file changed, 1 insertion(+) create mode 100644 recipes/smooth-scrolling diff --git a/recipes/smooth-scrolling b/recipes/smooth-scrolling new file mode 100644 index 00000000..5b2c7dc0 --- /dev/null +++ b/recipes/smooth-scrolling @@ -0,0 +1 @@ +(smooth-scrolling :repo "jbondeson/smooth-scrolling" :fetcher github) From 19e956776f1b479de275ac300dd31fdf3be29e51 Mon Sep 17 00:00:00 2001 From: Marian Schubert Date: Sun, 15 Apr 2012 18:17:10 +0200 Subject: [PATCH 005/111] Add recipe for autopair --- recipes/autopair | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 recipes/autopair diff --git a/recipes/autopair b/recipes/autopair new file mode 100644 index 00000000..4a6e3078 --- /dev/null +++ b/recipes/autopair @@ -0,0 +1,4 @@ +(autopair + :fetcher svn + :url "http://autopair.googlecode.com/svn/trunk/" + :files ("autopair-pkg.el" "autopair.el")) From 25e898d88b5a3f801c1999f0358bcef51f9396c9 Mon Sep 17 00:00:00 2001 From: Donald Curtis Date: Sun, 15 Apr 2012 23:10:31 -0500 Subject: [PATCH 006/111] fix missing quotes in elscreen recipe --- recipes/elscreen | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/elscreen b/recipes/elscreen index 5877084c..10501d95 100644 --- a/recipes/elscreen +++ b/recipes/elscreen @@ -1,3 +1,3 @@ (elscreen - :repo shosti/elscreen + :repo "shosti/elscreen" :fetcher github) From 75c5a4304999fc3f5a02235a1c2c904238d2ce4f Mon Sep 17 00:00:00 2001 From: Donald Curtis Date: Sun, 15 Apr 2012 23:11:01 -0500 Subject: [PATCH 007/111] property list wasnt named properly for writegood-mode --- recipes/writegood-mode | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/writegood-mode b/recipes/writegood-mode index 05bf1a3d..01c04e72 100644 --- a/recipes/writegood-mode +++ b/recipes/writegood-mode @@ -1 +1 @@ -(melpa :repo "bnbeckwith/writegood-mode" :fetcher github) +(writegood-mode :repo "bnbeckwith/writegood-mode" :fetcher github) From 466327d532184862ccd4df9ebdae014a3b974d1d Mon Sep 17 00:00:00 2001 From: Donald Curtis Date: Sun, 15 Apr 2012 23:11:11 -0500 Subject: [PATCH 008/111] add elisp script to print missing packages response to #72 --- missing.el | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100755 missing.el diff --git a/missing.el b/missing.el new file mode 100755 index 00000000..36ece68b --- /dev/null +++ b/missing.el @@ -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<)))) + + + From ca5fdf6ea9c67a47fcdf4f19ea34be789dae1157 Mon Sep 17 00:00:00 2001 From: Steve Purcell Date: Mon, 16 Apr 2012 13:50:08 +0100 Subject: [PATCH 009/111] Parse archive-contents file more rigorously when building the html index (fixes #49) --- html/index.erb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/html/index.erb b/html/index.erb index bcbcff91..8b8d36e3 100644 --- a/html/index.erb +++ b/html/index.erb @@ -17,7 +17,7 @@ <% def parse str # credit to: http://stackoverflow.com/q/3128406/154508 - tokens = str.scan(/#{Regexp.escape("(")}|#{Regexp.escape(")")}|[a-zA-Z0-9\'\-\_\+]+/) + tokens = str.scan(/#{Regexp.escape("(")}|#{Regexp.escape(")")}|"(?:\\.|[^"])+"|[a-zA-Z0-9\'\-\_\+]+/) stack = [[]] @@ -27,6 +27,8 @@ stack << [] when ")" stack[-2] << stack.pop + when /^"(.*)\"$/ + stack[-1] << $1 else stack[-1] << tok end From d4541b8c6993ab9d0cf3b81a038e88a1eb82584c Mon Sep 17 00:00:00 2001 From: Donald Curtis Date: Mon, 16 Apr 2012 09:55:56 -0500 Subject: [PATCH 010/111] remove debugging print statements --- missing.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/missing.el b/missing.el index 36ece68b..93fd0fbb 100755 --- a/missing.el +++ b/missing.el @@ -20,8 +20,8 @@ (mapc 'message (difference - (print (sort (directory-files "recipes/" nil "[^.].*") 'string<)) - (print (sort (mapcar 'stripstuff (directory-files "packages/" nil "[^.].*\\\(el$\\\|tar$\\\)")) 'string<)))) + (sort (directory-files "recipes/" nil "[^.].*") 'string<) + (sort (mapcar 'stripstuff (directory-files "packages/" nil "[^.].*\\\(el$\\\|tar$\\\)")) 'string<))) From 225d18964a5fa71009368bca0f29a6edb11e5dff Mon Sep 17 00:00:00 2001 From: Steve Purcell Date: Tue, 17 Apr 2012 10:42:51 +0100 Subject: [PATCH 011/111] Tidy up build-all functions --- package-build.el | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/package-build.el b/package-build.el index 512e01d2..146b6a92 100644 --- a/package-build.el +++ b/package-build.el @@ -485,21 +485,16 @@ If PKG-INFO is nil, an empty one is created." (pb/add-to-archive-contents pkg-info 'tar)))) (pb/dump-archive-contents)))) -(defun package-build-archives (&rest pkgs) - "Build archives for packages PKGS." +(defun package-build-archive-ignore-errors (pkg) + "Build archive for package PKG, ignoring any errors." (interactive) - (mapc 'package-build-archive pkgs)) - -(defun package-build-archives-ignore-errors (&rest pkgs) - "Build archives for packages PKGS. Ignore errors." - (interactive) - (mapc (lambda (pkg) (ignore-errors (package-build-archive pkg))) pkgs)) + (ignore-errors (package-build-archive pkg))) (defun package-build-all () "Build all packages in the `package-build-alist'." (interactive) - (apply 'package-build-archives-ignore-errors - (mapcar 'symbol-name (mapcar 'car package-build-alist)))) + (mapc 'package-build-archive-ignore-errors + (mapcar 'symbol-name (mapcar 'car package-build-alist)))) (defun package-build-initialize () "Load the recipe and archive-contents files." From 6dc2d0fb9f5f0b091becb4d20ee57b0905114487 Mon Sep 17 00:00:00 2001 From: Steve Purcell Date: Tue, 17 Apr 2012 12:00:31 +0100 Subject: [PATCH 012/111] After build, remove pre-built packages for which no recipe exists (see #76) --- package-build.el | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/package-build.el b/package-build.el index 146b6a92..d2df0ac1 100644 --- a/package-build.el +++ b/package-build.el @@ -405,6 +405,29 @@ If PKG-INFO is nil, an empty one is created." desc type))))) +(defun pb/archive-file-name (archive-entry) + "Return the path of the file in which the package for ARCHIVE-ENTRY is stored." + (expand-file-name (format "%s-%s.%s" + (car archive-entry) + (car (aref (cdr archive-entry) 0)) + (if (eq 'single (aref (cdr archive-entry) 3)) + "el" + "tar")) + package-build-archive-dir)) + +(defun pb/remove-archive (archive-entry) + "Remove ARCHIVE-ENTRY from archive-contents, and delete associated file. +Note that the working directory (if present) is not deleted by +this function, since the archive list may contain another version +of the same-named package which is to be kept." + (message "Removing archive: %s" archive-entry) + (let ((archive-file (pb/archive-file-name archive-entry))) + (when (file-exists-p archive-file) + (delete-file archive-file))) + (setq package-build-archive-alist + (remove archive-entry package-build-archive-alist)) + (pb/dump-archive-contents)) + (defun pb/read-recipes () "Return a list of data structures for all recipes in `package-build-recipes-dir'." (mapcar 'pb/read-from-file @@ -494,7 +517,18 @@ If PKG-INFO is nil, an empty one is created." "Build all packages in the `package-build-alist'." (interactive) (mapc 'package-build-archive-ignore-errors - (mapcar 'symbol-name (mapcar 'car package-build-alist)))) + (mapcar 'symbol-name (mapcar 'car package-build-alist))) + (package-build-cleanup)) + +(defun package-build-cleanup () + "Remove previously-built packages that no longer have recipes." + (interactive) + (let* ((known-package-names (mapcar 'car package-build-alist)) + (stale-archives (loop for built in package-build-archive-alist + when (not (memq (car built) known-package-names)) + collect built))) + (dolist (stale stale-archives) + (pb/remove-archive stale)))) (defun package-build-initialize () "Load the recipe and archive-contents files." From e43060d80b3345ef4e8df9f5a9d66af8a44a9c41 Mon Sep 17 00:00:00 2001 From: Victor Borja Date: Mon, 16 Apr 2012 11:47:43 -0500 Subject: [PATCH 013/111] Two recipes for loading themes buffer-local one for color-theme other for emacs24 Conflicts: recipes/color-theme-buffer-local --- recipes/color-theme-buffer-local | 3 +++ recipes/load-theme-buffer-local | 3 +++ 2 files changed, 6 insertions(+) create mode 100644 recipes/color-theme-buffer-local create mode 100644 recipes/load-theme-buffer-local diff --git a/recipes/color-theme-buffer-local b/recipes/color-theme-buffer-local new file mode 100644 index 00000000..275f71cf --- /dev/null +++ b/recipes/color-theme-buffer-local @@ -0,0 +1,3 @@ +(color-theme-buffer-local :fetcher github + :repo "vic/color-theme-buffer-local" + :files ("color-theme-buffer-local.el")) diff --git a/recipes/load-theme-buffer-local b/recipes/load-theme-buffer-local new file mode 100644 index 00000000..4a58e546 --- /dev/null +++ b/recipes/load-theme-buffer-local @@ -0,0 +1,3 @@ +(load-theme-buffer-local :fetcher github + :repo "vic/color-theme-buffer-local" + :files ("load-theme-buffer-local.el")) From 2b7f9bbb305a87ef1fc236174b72e68e335baed3 Mon Sep 17 00:00:00 2001 From: Bozhidar Batsov Date: Tue, 17 Apr 2012 19:04:51 +0300 Subject: [PATCH 014/111] added a few prelude related packages --- recipes/prelude-c | 1 + recipes/prelude-clojure | 1 + recipes/prelude-coffee | 1 + recipes/prelude-common-lisp | 1 + recipes/prelude-css | 1 + recipes/prelude-emacs-lisp | 1 + recipes/prelude-haskell | 1 + recipes/prelude-js | 1 + recipes/prelude-lisp | 1 + recipes/prelude-mediawiki | 1 + recipes/prelude-perl | 1 + recipes/prelude-programming | 1 + recipes/prelude-ruby | 1 + recipes/prelude-xml | 1 + 14 files changed, 14 insertions(+) create mode 100644 recipes/prelude-c create mode 100644 recipes/prelude-clojure create mode 100644 recipes/prelude-coffee create mode 100644 recipes/prelude-common-lisp create mode 100644 recipes/prelude-css create mode 100644 recipes/prelude-emacs-lisp create mode 100644 recipes/prelude-haskell create mode 100644 recipes/prelude-js create mode 100644 recipes/prelude-lisp create mode 100644 recipes/prelude-mediawiki create mode 100644 recipes/prelude-perl create mode 100644 recipes/prelude-programming create mode 100644 recipes/prelude-ruby create mode 100644 recipes/prelude-xml diff --git a/recipes/prelude-c b/recipes/prelude-c new file mode 100644 index 00000000..99bccc67 --- /dev/null +++ b/recipes/prelude-c @@ -0,0 +1 @@ +(prelude-c :repo "bbatsov/prelude-modules" :fetcher github :files ("prelude-c.el")) \ No newline at end of file diff --git a/recipes/prelude-clojure b/recipes/prelude-clojure new file mode 100644 index 00000000..6b748dac --- /dev/null +++ b/recipes/prelude-clojure @@ -0,0 +1 @@ +(prelude-clojure :repo "bbatsov/prelude-modules" :fetcher github :files ("prelude-clojure.el")) \ No newline at end of file diff --git a/recipes/prelude-coffee b/recipes/prelude-coffee new file mode 100644 index 00000000..08a4b3c5 --- /dev/null +++ b/recipes/prelude-coffee @@ -0,0 +1 @@ +(prelude-coffee :repo "bbatsov/prelude-modules" :fetcher github :files ("prelude-coffee.el")) \ No newline at end of file diff --git a/recipes/prelude-common-lisp b/recipes/prelude-common-lisp new file mode 100644 index 00000000..b8500af6 --- /dev/null +++ b/recipes/prelude-common-lisp @@ -0,0 +1 @@ +(prelude-common-lisp :repo "bbatsov/prelude-modules" :fetcher github :files ("prelude-common-lisp.el")) \ No newline at end of file diff --git a/recipes/prelude-css b/recipes/prelude-css new file mode 100644 index 00000000..a3f7f667 --- /dev/null +++ b/recipes/prelude-css @@ -0,0 +1 @@ +(prelude-css :repo "bbatsov/prelude-modules" :fetcher github :files ("prelude-css.el")) \ No newline at end of file diff --git a/recipes/prelude-emacs-lisp b/recipes/prelude-emacs-lisp new file mode 100644 index 00000000..36326c93 --- /dev/null +++ b/recipes/prelude-emacs-lisp @@ -0,0 +1 @@ +(prelude-emacs-lisp :repo "bbatsov/prelude-modules" :fetcher github :files ("prelude-emacs-lisp.el")) \ No newline at end of file diff --git a/recipes/prelude-haskell b/recipes/prelude-haskell new file mode 100644 index 00000000..81b72fdd --- /dev/null +++ b/recipes/prelude-haskell @@ -0,0 +1 @@ +(prelude-haskell :repo "bbatsov/prelude-modules" :fetcher github :files ("prelude-haskell.el")) \ No newline at end of file diff --git a/recipes/prelude-js b/recipes/prelude-js new file mode 100644 index 00000000..22b9115a --- /dev/null +++ b/recipes/prelude-js @@ -0,0 +1 @@ +(prelude-js :repo "bbatsov/prelude-modules" :fetcher github :files ("prelude-js.el")) \ No newline at end of file diff --git a/recipes/prelude-lisp b/recipes/prelude-lisp new file mode 100644 index 00000000..250385ad --- /dev/null +++ b/recipes/prelude-lisp @@ -0,0 +1 @@ +(prelude-lisp :repo "bbatsov/prelude-modules" :fetcher github :files ("prelude-lisp.el")) \ No newline at end of file diff --git a/recipes/prelude-mediawiki b/recipes/prelude-mediawiki new file mode 100644 index 00000000..9b787beb --- /dev/null +++ b/recipes/prelude-mediawiki @@ -0,0 +1 @@ +(prelude-mediawiki :repo "bbatsov/prelude-modules" :fetcher github :files ("prelude-mediawiki.el")) \ No newline at end of file diff --git a/recipes/prelude-perl b/recipes/prelude-perl new file mode 100644 index 00000000..9538c316 --- /dev/null +++ b/recipes/prelude-perl @@ -0,0 +1 @@ +(prelude-perl :repo "bbatsov/prelude-modules" :fetcher github :files ("prelude-perl.el")) \ No newline at end of file diff --git a/recipes/prelude-programming b/recipes/prelude-programming new file mode 100644 index 00000000..27a690df --- /dev/null +++ b/recipes/prelude-programming @@ -0,0 +1 @@ +(prelude-programming :repo "bbatsov/prelude-modules" :fetcher github :files ("prelude-programming.el")) \ No newline at end of file diff --git a/recipes/prelude-ruby b/recipes/prelude-ruby new file mode 100644 index 00000000..3312a825 --- /dev/null +++ b/recipes/prelude-ruby @@ -0,0 +1 @@ +(prelude-ruby :repo "bbatsov/prelude-modules" :fetcher github :files ("prelude-ruby.el")) \ No newline at end of file diff --git a/recipes/prelude-xml b/recipes/prelude-xml new file mode 100644 index 00000000..eb795070 --- /dev/null +++ b/recipes/prelude-xml @@ -0,0 +1 @@ +(prelude-xml :repo "bbatsov/prelude-modules" :fetcher github :files ("prelude-xml.el")) \ No newline at end of file From 759ec4f2d022d510357a84d639b3aad4a1991bee Mon Sep 17 00:00:00 2001 From: Donald Curtis Date: Tue, 17 Apr 2012 14:25:36 -0500 Subject: [PATCH 015/111] remove unused functions. --- package-build.el | 8 -------- 1 file changed, 8 deletions(-) diff --git a/package-build.el b/package-build.el index d2df0ac1..eea8e501 100644 --- a/package-build.el +++ b/package-build.el @@ -312,14 +312,6 @@ seconds; the server cuts off after 10 requests in 20 seconds.") (goto-char (point-min)) (read (current-buffer))))) -(defun pb/get-config (pkg-name) - "Get the configuration information for the given PKG-NAME." - (pb/read-from-file (format "epkgs/%s/.config" pkg-name))) - -(defun pb/get-master (pkg-name) - "Get the configuration information for the given PKG-NAME." - (pb/read-from-file (format "epkgs/%s/master" pkg-name))) - (defun pb/create-tar (file dir &optional files) "Create a tar FILE containing the contents of DIR, or just FILES if non-nil. From 3e4c8ca859ef7deec2cbc8c60345423d49a6382a Mon Sep 17 00:00:00 2001 From: Donald Curtis Date: Tue, 17 Apr 2012 14:50:25 -0500 Subject: [PATCH 016/111] For git packages, use the last changed of only files in the package. --- package-build.el | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/package-build.el b/package-build.el index eea8e501..27b928f9 100644 --- a/package-build.el +++ b/package-build.el @@ -222,7 +222,10 @@ seconds; the server cuts off after 10 requests in 20 seconds.") (pb/run-process nil "git" "clone" repo dir))) (when commit (pb/run-process dir "git" "checkout" commit)) - (pb/run-process dir "git" "show" "-s" "--format='\%ci'" "HEAD") + (let ((files (pb/expand-file-list pkg-cwd + (or (plist-get cfg :files) + (list "*.el"))))) + (apply 'pb/run-process dir "git" "log" "-n1" "--pretty=format:'\%ci'" files)) (pb/find-parse-time "\\([0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\} [0-9]\\{2\\}:[0-9]\\{2\\}:[0-9]\\{2\\}\\)")))) From 565ee2017b69ec101f69dc38457386cad43452bb Mon Sep 17 00:00:00 2001 From: Donald Curtis Date: Tue, 17 Apr 2012 15:27:34 -0500 Subject: [PATCH 017/111] add a BOUND parameter to the timestamp parser --- package-build.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package-build.el b/package-build.el index 27b928f9..7941878c 100644 --- a/package-build.el +++ b/package-build.el @@ -71,12 +71,12 @@ ;;; Internal functions -(defun pb/find-parse-time (regex) +(defun pb/find-parse-time (regex &optional bound) "Find REGEX in current buffer and format as a proper time version." (format-time-string "%Y%m%d" (date-to-time - (print (progn (re-search-backward regex) + (print (progn (re-search-backward regex bound) (match-string-no-properties 1)))))) (defun pb/run-process (dir prog &rest args) From 2dc9a2bd4748c824bbc9608bbbb7461e20fbca65 Mon Sep 17 00:00:00 2001 From: Donald Curtis Date: Tue, 17 Apr 2012 15:28:30 -0500 Subject: [PATCH 018/111] Only consider timestamps for files in packages for Subversion recipes. --- package-build.el | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/package-build.el b/package-build.el index 7941878c..dd5eac25 100644 --- a/package-build.el +++ b/package-build.el @@ -179,9 +179,10 @@ seconds; the server cuts off after 10 requests in 20 seconds.") (defun pb/checkout-svn (name config dir) "Check package NAME with config CONFIG out of svn into DIR." - (let ((repo (plist-get config :url))) - (with-current-buffer (get-buffer-create "*package-build-checkout*") - (goto-char (point-max)) + (with-current-buffer (get-buffer-create "*package-build-checkout*") + (let ((repo (plist-get config :url)) + (bound (goto-char (point-max))) + timestamps ts) (cond ((and (file-exists-p (expand-file-name ".svn" dir)) (string-equal (pb/svn-repo dir) repo)) @@ -192,9 +193,17 @@ seconds; the server cuts off after 10 requests in 20 seconds.") (delete-directory dir t nil)) (print "cloning repository") (pb/run-process nil "svn" "checkout" repo dir))) - (pb/run-process dir "svn" "info") - (pb/find-parse-time - "\\([0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\} [0-9]\\{2\\}:[0-9]\\{2\\}:[0-9]\\{2\\}\\)")))) + (let ((files (pb/expand-file-list pkg-cwd + (or (plist-get cfg :files) + (list "*.el"))))) + (apply 'pb/run-process dir "svn" "info" files)) + (while (setq ts (ignore-errors + (pb/find-parse-time + "Last Changed Date: \\([0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\} [0-9]\\{2\\}:[0-9]\\{2\\}:[0-9]\\{2\\}\\)" bound))) + (add-to-list 'timestamps ts)) + (unless timestamps + (error "No valid timestamps found!")) + (car (reverse (sort timestamps 'string<)))))) (defun pb/git-repo (dir) "Get the current git repo for DIR." From 0164ab69a24435b53e0744af9aa9662d7d0f0aee Mon Sep 17 00:00:00 2001 From: Donald Curtis Date: Tue, 17 Apr 2012 15:42:36 -0500 Subject: [PATCH 019/111] Ignore trailing / on subversion packages. --- package-build.el | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/package-build.el b/package-build.el index dd5eac25..5b0d1294 100644 --- a/package-build.el +++ b/package-build.el @@ -177,10 +177,16 @@ seconds; the server cuts off after 10 requests in 20 seconds.") (re-search-forward "URL: \\(.*\\)") (match-string-no-properties 1))) +(defun pb/trim (str &optional chr) + (unless chr (setq chr ? )) + (if (equal (elt str (1- (length str))) chr) + (substring str 0 (1- (length str))) + str)) + (defun pb/checkout-svn (name config dir) "Check package NAME with config CONFIG out of svn into DIR." (with-current-buffer (get-buffer-create "*package-build-checkout*") - (let ((repo (plist-get config :url)) + (let ((repo (pb/trim (plist-get config :url) ?/)) (bound (goto-char (point-max))) timestamps ts) (cond From d57589790f5c2f7810d58f15d5801627805d5a35 Mon Sep 17 00:00:00 2001 From: Donald Curtis Date: Tue, 17 Apr 2012 21:39:01 -0500 Subject: [PATCH 020/111] Don't clear packages before building by default. By default, the melpa script will no longer delete all packages before rebuilding. The package-build.el script should automatically clean out old packages. --- melpa | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/melpa b/melpa index 976454bd..cd46e3fd 100755 --- a/melpa +++ b/melpa @@ -66,7 +66,7 @@ done if [[ "$#" == "0" ]]; then - set -- clear build index validate + set -- build index validate fi for i; do From 340e389a5d2578f1baff45f07706dd4ca019ff9a Mon Sep 17 00:00:00 2001 From: Steve Purcell Date: Mon, 16 Apr 2012 17:14:11 +0100 Subject: [PATCH 021/111] Add a "Source" column to the html package list, and link contents to the recipe files --- html/index.erb | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/html/index.erb b/html/index.erb index 8b8d36e3..22f218f0 100644 --- a/html/index.erb +++ b/html/index.erb @@ -38,17 +38,23 @@ end - headers = ["Package", "Version", "Description"] + headers = ["Package", "Version", "Description", "Source"] data = parse(File.open("../packages/archive-contents").read)[1..-1] data.map! do |row| - [row[0], row[1][0], row[3..-2].join(" ")] + pkgname = row[0] + recipe_url = "https://github.com/milkypostman/melpa/blob/master/recipes/#{pkgname}" + descr, source = row[3..-2].join(" "), "other" + if descr =~ /(.*?)\s*\[source:\s*(\w+)\]\s*/ + descr, source = $1, $2 + end + [pkgname, row[1][0], descr, "[#{source}](#{recipe_url})"] end data.sort! - colwidth = [0,0,0] + colwidth = [0,0,0, 9] data.map do |row| row.to_enum(:each_with_index).map do |e,i| From 4abaea692db5a404234cc266e0e4d9bf9907ef2a Mon Sep 17 00:00:00 2001 From: Donald Curtis Date: Tue, 17 Apr 2012 22:04:47 -0500 Subject: [PATCH 022/111] link the package name to the actual package file --- html/index.erb | 3 ++- html/style.css | 12 +++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/html/index.erb b/html/index.erb index 22f218f0..2a53c265 100644 --- a/html/index.erb +++ b/html/index.erb @@ -45,12 +45,13 @@ data.map! do |row| pkgname = row[0] + pkgurl = "packages/#{row[0]}-#{row[1]}." + (row[-1] == "single" ? "el" : "tar") recipe_url = "https://github.com/milkypostman/melpa/blob/master/recipes/#{pkgname}" descr, source = row[3..-2].join(" "), "other" if descr =~ /(.*?)\s*\[source:\s*(\w+)\]\s*/ descr, source = $1, $2 end - [pkgname, row[1][0], descr, "[#{source}](#{recipe_url})"] + ["[#{pkgname}](#{pkgurl})", row[1][0], descr, "[#{source}](#{recipe_url})"] end data.sort! diff --git a/html/style.css b/html/style.css index a9f0adf5..a0d6d9e3 100644 --- a/html/style.css +++ b/html/style.css @@ -53,7 +53,9 @@ pre code { pre { background: #000; color: #fff; - padding: 15px;} + padding: 15px; +} + hr { border: 0; width: 80%; @@ -78,6 +80,14 @@ td, th { padding: 2px 7px 2px 7px; } +tr { + color: #ddd; +} + +td:first-child a { + color: #fff; +} + tr.header { color: #000; background-color: #fad; From c0f349295a0b51d02f2c5787b1042e1c208cd1d4 Mon Sep 17 00:00:00 2001 From: Steve Purcell Date: Wed, 18 Apr 2012 10:40:11 +0100 Subject: [PATCH 023/111] Fix references to non-local variables --- package-build.el | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/package-build.el b/package-build.el index 5b0d1294..8acbe304 100644 --- a/package-build.el +++ b/package-build.el @@ -199,8 +199,8 @@ seconds; the server cuts off after 10 requests in 20 seconds.") (delete-directory dir t nil)) (print "cloning repository") (pb/run-process nil "svn" "checkout" repo dir))) - (let ((files (pb/expand-file-list pkg-cwd - (or (plist-get cfg :files) + (let ((files (pb/expand-file-list dir + (or (plist-get config :files) (list "*.el"))))) (apply 'pb/run-process dir "svn" "info" files)) (while (setq ts (ignore-errors @@ -237,8 +237,8 @@ seconds; the server cuts off after 10 requests in 20 seconds.") (pb/run-process nil "git" "clone" repo dir))) (when commit (pb/run-process dir "git" "checkout" commit)) - (let ((files (pb/expand-file-list pkg-cwd - (or (plist-get cfg :files) + (let ((files (pb/expand-file-list dir + (or (plist-get config :files) (list "*.el"))))) (apply 'pb/run-process dir "git" "log" "-n1" "--pretty=format:'\%ci'" files)) (pb/find-parse-time From 05f920a4943584b86052f29d975549381940a629 Mon Sep 17 00:00:00 2001 From: Steve Purcell Date: Wed, 18 Apr 2012 10:44:49 +0100 Subject: [PATCH 024/111] Correctly determine last commit timestamp for a set of bzr files (see #79) --- package-build.el | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/package-build.el b/package-build.el index 8acbe304..26eabcd0 100644 --- a/package-build.el +++ b/package-build.el @@ -272,7 +272,10 @@ seconds; the server cuts off after 10 requests in 20 seconds.") (delete-directory dir t nil)) (print "cloning repository") (pb/run-process nil "bzr" "branch" repo dir))) - (pb/run-process dir "bzr" "info" "-vv") + (apply 'pb/run-process dir "bzr" "log" "-l1" + (pb/expand-file-list dir + (or (plist-get config :files) + (list "*.el")))) (pb/find-parse-time "\\([0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\} [0-9]\\{2\\}:[0-9]\\{2\\}:[0-9]\\{2\\}\\)")))) From a971eeddd520d944ca8c03bd3dc1bc8dbcf3b401 Mon Sep 17 00:00:00 2001 From: Steve Purcell Date: Wed, 18 Apr 2012 11:02:09 +0100 Subject: [PATCH 025/111] Correctly determine last commit timestamp for a set of hg files (see #79) --- package-build.el | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/package-build.el b/package-build.el index 26eabcd0..a1e60597 100644 --- a/package-build.el +++ b/package-build.el @@ -303,7 +303,10 @@ seconds; the server cuts off after 10 requests in 20 seconds.") (delete-directory dir t nil)) (print "cloning repository") (pb/run-process nil "hg" "clone" repo dir))) - (pb/run-process dir "hg" "tip" "--style" "compact") + (apply 'pb/run-process dir "hg" "log" "-l1" + (pb/expand-file-list dir + (or (plist-get config :files) + (list "*.el")))) (pb/find-parse-time "\\([0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\} [0-9]\\{2\\}:[0-9]\\{2\\}\\)")))) From 106834fc73c8aff0d68e41d4516d756ca36e5890 Mon Sep 17 00:00:00 2001 From: Steve Purcell Date: Wed, 18 Apr 2012 11:07:03 +0100 Subject: [PATCH 026/111] Pull default "*.el" pattern up into 'pb/expand-file-list --- package-build.el | 31 ++++++++++--------------------- 1 file changed, 10 insertions(+), 21 deletions(-) diff --git a/package-build.el b/package-build.el index a1e60597..6c6b71e1 100644 --- a/package-build.el +++ b/package-build.el @@ -199,10 +199,7 @@ seconds; the server cuts off after 10 requests in 20 seconds.") (delete-directory dir t nil)) (print "cloning repository") (pb/run-process nil "svn" "checkout" repo dir))) - (let ((files (pb/expand-file-list dir - (or (plist-get config :files) - (list "*.el"))))) - (apply 'pb/run-process dir "svn" "info" files)) + (apply 'pb/run-process dir "svn" "info" (pb/expand-file-list dir config)) (while (setq ts (ignore-errors (pb/find-parse-time "Last Changed Date: \\([0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\} [0-9]\\{2\\}:[0-9]\\{2\\}:[0-9]\\{2\\}\\)" bound))) @@ -237,10 +234,8 @@ seconds; the server cuts off after 10 requests in 20 seconds.") (pb/run-process nil "git" "clone" repo dir))) (when commit (pb/run-process dir "git" "checkout" commit)) - (let ((files (pb/expand-file-list dir - (or (plist-get config :files) - (list "*.el"))))) - (apply 'pb/run-process dir "git" "log" "-n1" "--pretty=format:'\%ci'" files)) + (apply 'pb/run-process dir "git" "log" "-n1" "--pretty=format:'\%ci'" + (pb/expand-file-list dir config)) (pb/find-parse-time "\\([0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\} [0-9]\\{2\\}:[0-9]\\{2\\}:[0-9]\\{2\\}\\)")))) @@ -273,9 +268,7 @@ seconds; the server cuts off after 10 requests in 20 seconds.") (print "cloning repository") (pb/run-process nil "bzr" "branch" repo dir))) (apply 'pb/run-process dir "bzr" "log" "-l1" - (pb/expand-file-list dir - (or (plist-get config :files) - (list "*.el")))) + (pb/expand-file-list dir config)) (pb/find-parse-time "\\([0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\} [0-9]\\{2\\}:[0-9]\\{2\\}:[0-9]\\{2\\}\\)")))) @@ -303,10 +296,7 @@ seconds; the server cuts off after 10 requests in 20 seconds.") (delete-directory dir t nil)) (print "cloning repository") (pb/run-process nil "hg" "clone" repo dir))) - (apply 'pb/run-process dir "hg" "log" "-l1" - (pb/expand-file-list dir - (or (plist-get config :files) - (list "*.el")))) + (apply 'pb/run-process dir "hg" "log" "-l1" (pb/expand-file-list dir config)) (pb/find-parse-time "\\([0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\} [0-9]\\{2\\}:[0-9]\\{2\\}\\)")))) @@ -381,10 +371,11 @@ The file is written to `package-build-working-dir'." (nth 2 pkgfile-info) (nth 1 pkgfile-info))))) -(defun pb/expand-file-list (dir files) - "In DIR, expand FILES, some of which may be shell-style wildcards." +(defun pb/expand-file-list (dir config) + "In DIR, expand the :files for CONFIG, some of which may be shell-style wildcards." (let ((default-directory dir)) - (mapcan 'file-expand-wildcards files))) + (mapcan 'file-expand-wildcards + (or (plist-get config :files) (list "*.el"))))) (defun pb/merge-package-info (pkg-info name version config) "Return a version of PKG-INFO updated with NAME and VERSION. @@ -464,9 +455,7 @@ of the same-named package which is to be kept." (expand-file-name file-name package-build-working-dir)))) (let* ((version (pb/checkout name cfg pkg-cwd)) - (files (pb/expand-file-list pkg-cwd - (or (plist-get cfg :files) - (list "*.el")))) + (files (pb/expand-file-list pkg-cwd cfg)) (default-directory package-build-working-dir)) (cond ((not version) From 2ba2017e768d5ec1b271945f31fc5f728e2cf661 Mon Sep 17 00:00:00 2001 From: Donald Curtis Date: Wed, 18 Apr 2012 09:37:09 -0500 Subject: [PATCH 027/111] Print missing packages on error. Incorporated suggested changes in #72 --- melpa | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/melpa b/melpa index cd46e3fd..173f89f8 100755 --- a/melpa +++ b/melpa @@ -36,6 +36,17 @@ function melpa_validate { NUMBUILT=$(trim `ls packages/*.{el,tar} | wc -l`) echo "${NUMBUILT}/${NUMPACKAGES} packages built" + + if [[ $NUMBUILT -ne $NUMPACKAGES ]]; then + echo + echo "Missing Packages" + echo "______________________" + emacs --script missing.el + exit 1 + else + exit 0 + fi + } function print_usage { From eadbd893e80721acf148c631ecf76af9ecb11cc7 Mon Sep 17 00:00:00 2001 From: Johan Andersson Date: Wed, 18 Apr 2012 21:39:34 +0200 Subject: [PATCH 028/111] Add ruby-tools recipe. --- recipes/ruby-tools | 1 + 1 file changed, 1 insertion(+) create mode 100644 recipes/ruby-tools diff --git a/recipes/ruby-tools b/recipes/ruby-tools new file mode 100644 index 00000000..8bb7d81d --- /dev/null +++ b/recipes/ruby-tools @@ -0,0 +1 @@ +(ruby-tools :repo "rejeep/ruby-tools" :fetcher github) From ccbbe09d159a24cf3fac7b7b667982ec3df4b06b Mon Sep 17 00:00:00 2001 From: Bozhidar Batsov Date: Thu, 19 Apr 2012 11:49:51 +0300 Subject: [PATCH 029/111] a few more Prelude packages --- recipes/prelude-latex | 1 + recipes/prelude-scheme | 1 + recipes/prelude-scss | 1 + 3 files changed, 3 insertions(+) create mode 100644 recipes/prelude-latex create mode 100644 recipes/prelude-scheme create mode 100644 recipes/prelude-scss diff --git a/recipes/prelude-latex b/recipes/prelude-latex new file mode 100644 index 00000000..9abf72ca --- /dev/null +++ b/recipes/prelude-latex @@ -0,0 +1 @@ +(prelude-latex :repo "bbatsov/prelude-modules" :fetcher github :files ("prelude-latex.el")) \ No newline at end of file diff --git a/recipes/prelude-scheme b/recipes/prelude-scheme new file mode 100644 index 00000000..34a69f16 --- /dev/null +++ b/recipes/prelude-scheme @@ -0,0 +1 @@ +(prelude-scheme :repo "bbatsov/prelude-modules" :fetcher github :files ("prelude-scheme.el")) \ No newline at end of file diff --git a/recipes/prelude-scss b/recipes/prelude-scss new file mode 100644 index 00000000..1085869c --- /dev/null +++ b/recipes/prelude-scss @@ -0,0 +1 @@ +(prelude-scss :repo "bbatsov/prelude-modules" :fetcher github :files ("prelude-scss.el")) \ No newline at end of file From 188ca7141f6d68f2d2221ed4dfd3d1a06b76f046 Mon Sep 17 00:00:00 2001 From: Erik Parmann Date: Thu, 19 Apr 2012 17:06:33 +0200 Subject: [PATCH 030/111] Adding latex-pretty-symbols, a package to display latex commands as their corresponding unicode symbols --- recipes/latex-pretty-symbols | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 recipes/latex-pretty-symbols diff --git a/recipes/latex-pretty-symbols b/recipes/latex-pretty-symbols new file mode 100644 index 00000000..f69731a1 --- /dev/null +++ b/recipes/latex-pretty-symbols @@ -0,0 +1,3 @@ +(latex-pretty-symbols + :url "https://bitbucket.org/mortiferus/latex-pretty-symbols.el" + :fetcher hg) From 7a0d749da3c8134334a338741627f570d7bd1950 Mon Sep 17 00:00:00 2001 From: Donald Curtis Date: Fri, 20 Apr 2012 08:07:23 -0500 Subject: [PATCH 031/111] rename surround to properly match the provide statement in the package fixes #85 --- recipes/evil-surround | 2 -- recipes/surround | 2 ++ 2 files changed, 2 insertions(+), 2 deletions(-) delete mode 100644 recipes/evil-surround create mode 100644 recipes/surround diff --git a/recipes/evil-surround b/recipes/evil-surround deleted file mode 100644 index 2938b855..00000000 --- a/recipes/evil-surround +++ /dev/null @@ -1,2 +0,0 @@ -(evil-surround :repo "timcharper/evil-surround" :fetcher github) - diff --git a/recipes/surround b/recipes/surround new file mode 100644 index 00000000..93bb0aba --- /dev/null +++ b/recipes/surround @@ -0,0 +1,2 @@ +(surround :repo "timcharper/evil-surround" :fetcher github) + From 142e1a2506603edc2cbf510cb39ea5c83bce0188 Mon Sep 17 00:00:00 2001 From: Steve Purcell Date: Fri, 20 Apr 2012 16:21:37 +0100 Subject: [PATCH 032/111] Correctly determine last commit timestamp for a set of darcs files (see #79) --- package-build.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package-build.el b/package-build.el index 6c6b71e1..98eeac90 100644 --- a/package-build.el +++ b/package-build.el @@ -165,7 +165,8 @@ seconds; the server cuts off after 10 requests in 20 seconds.") (delete-directory dir t nil)) (print "cloning repository") (pb/run-process nil "darcs" "get" repo dir))) - (pb/run-process dir "darcs" "changes" "--last" "1") + (apply 'pb/run-process dir "darcs" "changes" "--max-count" "1" + (pb/expand-file-list dir config)) (pb/find-parse-time "\\([a-zA-Z]\\{3\\} [a-zA-Z]\\{3\\} \\( \\|[0-9]\\)[0-9] [0-9]\\{2\\}:[0-9]\\{2\\}:[0-9]\\{2\\} [A-Za-z]\\{3\\} [0-9]\\{4\\}\\)")))) From 6e25a6da87f12fd3300acf619b692ee79a9d5580 Mon Sep 17 00:00:00 2001 From: Steve Purcell Date: Fri, 20 Apr 2012 16:48:30 +0100 Subject: [PATCH 033/111] Extract looping logic used to find most recent svn timestamp (see #79) --- package-build.el | 41 ++++++++++++++++++++++++++++------------- 1 file changed, 28 insertions(+), 13 deletions(-) diff --git a/package-build.el b/package-build.el index 98eeac90..a4910413 100644 --- a/package-build.el +++ b/package-build.el @@ -71,13 +71,34 @@ ;;; Internal functions -(defun pb/find-parse-time (regex &optional bound) - "Find REGEX in current buffer and format as a proper time version." +(defun pb/parse-time (str) + "Parse STR as a time, and format as a YYYYMMDD string." (format-time-string "%Y%m%d" (date-to-time - (print (progn (re-search-backward regex bound) - (match-string-no-properties 1)))))) + (print (substring-no-properties str))))) + +(defun pb/string-match-all (regex str &optional group) + "Find every match for `REGEX' within `STR', returning the full match string or group `GROUP'." + (let (result + (pos 0) + (group (or group 0))) + (while (string-match regex str pos) + (push (match-string group str) result) + (setq pos (match-end group))) + result)) + +(defun pb/find-parse-time (regex &optional bound) + "Find REGEX in current buffer and format as a proper time version, optionally looking only as far as BOUND." + (pb/parse-time (progn (re-search-backward regex bound) + (match-string-no-properties 1)))) + +(defun pb/find-parse-time-latest (regex &optional bound) + "Find the latest timestamp matching REGEX, optionally looking only as far as BOUND." + (let* ((text (buffer-substring-no-properties + (or bound (point-min)) (point))) + (times (mapcar 'pb/parse-time (pb/string-match-all regex text 1)))) + (car (nreverse (sort times 'string<))))) (defun pb/run-process (dir prog &rest args) "In DIR (or `default-directory' if unset) run command PROG with ARGS. @@ -188,8 +209,7 @@ seconds; the server cuts off after 10 requests in 20 seconds.") "Check package NAME with config CONFIG out of svn into DIR." (with-current-buffer (get-buffer-create "*package-build-checkout*") (let ((repo (pb/trim (plist-get config :url) ?/)) - (bound (goto-char (point-max))) - timestamps ts) + (bound (goto-char (point-max)))) (cond ((and (file-exists-p (expand-file-name ".svn" dir)) (string-equal (pb/svn-repo dir) repo)) @@ -201,13 +221,8 @@ seconds; the server cuts off after 10 requests in 20 seconds.") (print "cloning repository") (pb/run-process nil "svn" "checkout" repo dir))) (apply 'pb/run-process dir "svn" "info" (pb/expand-file-list dir config)) - (while (setq ts (ignore-errors - (pb/find-parse-time - "Last Changed Date: \\([0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\} [0-9]\\{2\\}:[0-9]\\{2\\}:[0-9]\\{2\\}\\)" bound))) - (add-to-list 'timestamps ts)) - (unless timestamps - (error "No valid timestamps found!")) - (car (reverse (sort timestamps 'string<)))))) + (or (pb/find-parse-time-latest "Last Changed Date: \\([0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\} [0-9]\\{2\\}:[0-9]\\{2\\}:[0-9]\\{2\\}\\)" bound) + (error "No valid timestamps found!"))))) (defun pb/git-repo (dir) "Get the current git repo for DIR." From d86ed7e2c0be09b90978ee456e9cc8d9a53fac49 Mon Sep 17 00:00:00 2001 From: Steve Purcell Date: Fri, 20 Apr 2012 16:53:52 +0100 Subject: [PATCH 034/111] Don't require network connection when looking up URL for current git remote --- package-build.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package-build.el b/package-build.el index a4910413..aabd7548 100644 --- a/package-build.el +++ b/package-build.el @@ -227,7 +227,7 @@ seconds; the server cuts off after 10 requests in 20 seconds.") (defun pb/git-repo (dir) "Get the current git repo for DIR." (with-temp-buffer - (pb/run-process dir "git" "remote" "show" "origin") + (pb/run-process dir "git" "remote" "show" "-n" "origin") (goto-char (point-min)) (re-search-forward "Fetch URL: \\(.*\\)") (match-string-no-properties 1))) From edcafb4c459cf51fecc7c43a3e4dcbe377d68b46 Mon Sep 17 00:00:00 2001 From: John SJ Anderson Date: Fri, 20 Apr 2012 21:05:26 -0400 Subject: [PATCH 035/111] recipe for disk.el from the wiki --- recipes/disk | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 recipes/disk diff --git a/recipes/disk b/recipes/disk new file mode 100644 index 00000000..38474c5b --- /dev/null +++ b/recipes/disk @@ -0,0 +1,2 @@ +(disk :fetcher wiki) + From bf079dbd04675ecd5f511b940d7cc5f80ccc94c4 Mon Sep 17 00:00:00 2001 From: John SJ Anderson Date: Fri, 20 Apr 2012 21:13:25 -0400 Subject: [PATCH 036/111] HTML tidy interface from the wiki --- recipes/tidy | 1 + 1 file changed, 1 insertion(+) create mode 100644 recipes/tidy diff --git a/recipes/tidy b/recipes/tidy new file mode 100644 index 00000000..d29035c6 --- /dev/null +++ b/recipes/tidy @@ -0,0 +1 @@ +(tidy :fetcher wiki) From 2c7355727a6e609c29ba0332f64fc201e98f60d0 Mon Sep 17 00:00:00 2001 From: Steve Purcell Date: Sat, 21 Apr 2012 10:10:48 +0100 Subject: [PATCH 037/111] Clarify recipe syntax (fixes #89) --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 11149ca9..8e577efc 100644 --- a/README.md +++ b/README.md @@ -78,14 +78,14 @@ contribute a new package by adding a new file under `recipes` using the following form, ```elisp -(name +( :fetcher [git|github|bzr|hg|darcs|svn|wiki] [:url ""] [:repo "github-user/repo-name"] [:files ("", ...)]) -``` +``` -`name` +`package-name` : a lisp symbol that has the same name as the package being specified. `:url` From a46a6e4c85e136f74fc03d1c705f76d2babef552 Mon Sep 17 00:00:00 2001 From: sindikat Date: Sat, 21 Apr 2012 14:56:02 +0600 Subject: [PATCH 038/111] Add recipe for minimap.el --- recipes/minimap | 1 + 1 file changed, 1 insertion(+) create mode 100644 recipes/minimap diff --git a/recipes/minimap b/recipes/minimap new file mode 100644 index 00000000..da731368 --- /dev/null +++ b/recipes/minimap @@ -0,0 +1 @@ +(minimap :url "git://randomsample.de/minimap.git" :fetcher git) From 3e3815d3344b035e4de2556038f75a232f92f653 Mon Sep 17 00:00:00 2001 From: Steve Purcell Date: Sat, 21 Apr 2012 10:29:31 +0100 Subject: [PATCH 039/111] Include time zone offset in HTML index "last update" stamp. --- html/index.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/html/index.erb b/html/index.erb index 2a53c265..131c4115 100644 --- a/html/index.erb +++ b/html/index.erb @@ -10,7 +10,7 @@ > a repository for development versions of Emacs packages (hot from the repo). -**Last Update:** *<%= Time.now.strftime("%Y.%m.%d %H:%M") %>* +**Last Update:** *<%= Time.now.strftime("%Y.%m.%d %H:%M %z") %>* ## Current List of Packages From e9c36b10a7bb40a0a94345d7f6c658e022e50e97 Mon Sep 17 00:00:00 2001 From: Steve Purcell Date: Sat, 21 Apr 2012 10:33:03 +0100 Subject: [PATCH 040/111] Strip '-*- BLAH -*-' directives out of package descriptions in html index --- html/index.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/html/index.erb b/html/index.erb index 131c4115..47d5182c 100644 --- a/html/index.erb +++ b/html/index.erb @@ -48,8 +48,8 @@ pkgurl = "packages/#{row[0]}-#{row[1]}." + (row[-1] == "single" ? "el" : "tar") recipe_url = "https://github.com/milkypostman/melpa/blob/master/recipes/#{pkgname}" descr, source = row[3..-2].join(" "), "other" - if descr =~ /(.*?)\s*\[source:\s*(\w+)\]\s*/ - descr, source = $1, $2 + if descr =~ /(.*?)(\s*-\*-.*?)?\s*\[source:\s*(\w+)\]\s*/ + descr, source = $1, $3 end ["[#{pkgname}](#{pkgurl})", row[1][0], descr, "[#{source}](#{recipe_url})"] end From 60be41f73b605b5eba24c36389df640c5a4af271 Mon Sep 17 00:00:00 2001 From: Donald Curtis Date: Sat, 21 Apr 2012 12:01:01 -0500 Subject: [PATCH 041/111] fix timestamp search problem with `hg`. introduced in a971eeddd520d944ca8c03bd3dc1bc8dbcf3b401 see #79 --- package-build.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package-build.el b/package-build.el index aabd7548..7fd64c7c 100644 --- a/package-build.el +++ b/package-build.el @@ -312,7 +312,7 @@ seconds; the server cuts off after 10 requests in 20 seconds.") (delete-directory dir t nil)) (print "cloning repository") (pb/run-process nil "hg" "clone" repo dir))) - (apply 'pb/run-process dir "hg" "log" "-l1" (pb/expand-file-list dir config)) + (apply 'pb/run-process dir "hg" "log" "--style" "compact" "-l1" (pb/expand-file-list dir config)) (pb/find-parse-time "\\([0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\} [0-9]\\{2\\}:[0-9]\\{2\\}\\)")))) From 760e37e385139e635acb4fbc1db5fd7f0ed22ed1 Mon Sep 17 00:00:00 2001 From: Donald Curtis Date: Sat, 21 Apr 2012 12:08:45 -0500 Subject: [PATCH 042/111] Cleanup long lines where it can be avoided (like it doc strings) --- package-build.el | 46 ++++++++++++++++++++++++++++++---------------- 1 file changed, 30 insertions(+), 16 deletions(-) diff --git a/package-build.el b/package-build.el index 7fd64c7c..f8fc4b26 100644 --- a/package-build.el +++ b/package-build.el @@ -79,7 +79,8 @@ (print (substring-no-properties str))))) (defun pb/string-match-all (regex str &optional group) - "Find every match for `REGEX' within `STR', returning the full match string or group `GROUP'." + "Find every match for `REGEX' within `STR', returning the full +match string or group `GROUP'." (let (result (pos 0) (group (or group 0))) @@ -89,12 +90,14 @@ result)) (defun pb/find-parse-time (regex &optional bound) - "Find REGEX in current buffer and format as a proper time version, optionally looking only as far as BOUND." + "Find REGEX in current buffer and format as a proper time +version, optionally looking only as far as BOUND." (pb/parse-time (progn (re-search-backward regex bound) (match-string-no-properties 1)))) (defun pb/find-parse-time-latest (regex &optional bound) - "Find the latest timestamp matching REGEX, optionally looking only as far as BOUND." + "Find the latest timestamp matching REGEX, optionally looking +only as far as BOUND." (let* ((text (buffer-substring-no-properties (or bound (point-min)) (point))) (times (mapcar 'pb/parse-time (pb/string-match-all regex text 1)))) @@ -121,15 +124,17 @@ the same arguments." name config cwd))) (defvar pb/last-wiki-fetch-time 0 - "The time at which an emacswiki URL was last requested. -This is used to avoid exceeding the rate limit of 1 request per 2 + "The time at which an emacswiki URL was last requested. This is +used to avoid exceeding the rate limit of 1 request per 2 seconds; the server cuts off after 10 requests in 20 seconds.") (defvar pb/wiki-min-request-interval 2 - "The shortest permissible interval between successive requests for Emacswiki URLs.") + "The shortest permissible interval between successive requests +for Emacswiki URLs.") (defmacro pb/with-wiki-rate-limit (&rest body) - "Rate-limit BODY code passed to this macro to match EmacsWiki's rate limiting." + "Rate-limit BODY code passed to this macro to match EmacsWiki's +rate limiting." (let ((now (gensym)) (elapsed (gensym))) `(let* ((,now (float-time)) @@ -144,8 +149,10 @@ seconds; the server cuts off after 10 requests in 20 seconds.") (defun pb/grab-wiki-file (filename) "Download FILENAME from emacswiki, returning its last-modified time." - (let* ((download-url (format "http://www.emacswiki.org/emacs/download/%s" filename)) - (wiki-url (format "http://www.emacswiki.org/emacs/%s" filename))) + (let* ((download-url + (format "http://www.emacswiki.org/emacs/download/%s" filename)) + (wiki-url + (format "http://www.emacswiki.org/emacs/%s" filename))) (pb/with-wiki-rate-limit (url-copy-file download-url filename t)) (with-current-buffer (pb/with-wiki-rate-limit @@ -260,6 +267,7 @@ seconds; the server cuts off after 10 requests in 20 seconds.") (let* ((url (format "git://github.com/%s.git" (plist-get config :repo)))) (pb/checkout-git name (plist-put (copy-sequence config) :url url) dir))) + (defun pb/bzr-repo (dir) "Get the current bzr repo for DIR." (with-temp-buffer @@ -312,7 +320,8 @@ seconds; the server cuts off after 10 requests in 20 seconds.") (delete-directory dir t nil)) (print "cloning repository") (pb/run-process nil "hg" "clone" repo dir))) - (apply 'pb/run-process dir "hg" "log" "--style" "compact" "-l1" (pb/expand-file-list dir config)) + (apply 'pb/run-process dir "hg" "log" "--style" "compact" "-l1" + (pb/expand-file-list dir config)) (pb/find-parse-time "\\([0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\} [0-9]\\{2\\}:[0-9]\\{2\\}\\)")))) @@ -335,7 +344,8 @@ seconds; the server cuts off after 10 requests in 20 seconds.") pkg-file)) (defun pb/read-from-file (file-name) - "Read and return the Lisp data stored in FILE-NAME, or nil if no such file exists." + "Read and return the Lisp data stored in FILE-NAME,or nil if no +such file exists." (when (file-exists-p file-name) (with-temp-buffer (insert-file-contents-literally file-name) @@ -344,8 +354,9 @@ seconds; the server cuts off after 10 requests in 20 seconds.") (defun pb/create-tar (file dir &optional files) - "Create a tar FILE containing the contents of DIR, or just FILES if non-nil. -The file is written to `package-build-working-dir'." + "Create a tar FILE containing the contents of DIR, or just +FILES if non-nil. The file is written to +`package-build-working-dir'." (let* ((default-directory package-build-working-dir)) (apply 'process-file "tar" nil @@ -388,7 +399,8 @@ The file is written to `package-build-working-dir'." (nth 1 pkgfile-info))))) (defun pb/expand-file-list (dir config) - "In DIR, expand the :files for CONFIG, some of which may be shell-style wildcards." + "In DIR, expand the :files for CONFIG, some of which may be +shell-style wildcards." (let ((default-directory dir)) (mapcan 'file-expand-wildcards (or (plist-get config :files) (list "*.el"))))) @@ -411,7 +423,8 @@ If PKG-INFO is nil, an empty one is created." package-build-archive-dir))) (defun pb/add-to-archive-contents (pkg-info type) - "Add the built archive with info PKG-INFO and TYPE to `package-build-archive-alist'." + "Add the built archive with info PKG-INFO and TYPE to +`package-build-archive-alist'." (let* ((name (intern (aref pkg-info 0))) (requires (aref pkg-info 1)) (desc (or (aref pkg-info 2) "No description available.")) @@ -429,7 +442,8 @@ If PKG-INFO is nil, an empty one is created." type))))) (defun pb/archive-file-name (archive-entry) - "Return the path of the file in which the package for ARCHIVE-ENTRY is stored." + "Return the path of the file in which the package for +ARCHIVE-ENTRY is stored." (expand-file-name (format "%s-%s.%s" (car archive-entry) (car (aref (cdr archive-entry) 0)) From 005697cbdeff5fbd1b7a7c03f3e1b0526d8b53b6 Mon Sep 17 00:00:00 2001 From: Donald Curtis Date: Sat, 21 Apr 2012 12:10:06 -0500 Subject: [PATCH 043/111] additional long line formatting. --- package-build.el | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/package-build.el b/package-build.el index f8fc4b26..b7cadc20 100644 --- a/package-build.el +++ b/package-build.el @@ -568,11 +568,11 @@ of the same-named package which is to be kept." (defun package-build-initialize () "Load the recipe and archive-contents files." (interactive) - (setq - package-build-alist (pb/read-recipes) - package-build-archive-alist (cdr (pb/read-from-file - (expand-file-name "archive-contents" - package-build-archive-dir))))) + (setq package-build-alist (pb/read-recipes) + package-build-archive-alist + (cdr (pb/read-from-file + (expand-file-name "archive-contents" + package-build-archive-dir))))) (package-build-initialize) From 004c9ae5ce9928dae2bbc56b64c82293bdebeaac Mon Sep 17 00:00:00 2001 From: Donald Curtis Date: Sat, 21 Apr 2012 13:56:19 -0500 Subject: [PATCH 044/111] Print packages that fail to build when building every package. Closes #72 --- melpa | 25 +++---------------------- package-build.el | 13 ++++++++++--- 2 files changed, 13 insertions(+), 25 deletions(-) diff --git a/melpa b/melpa index 173f89f8..8c194148 100755 --- a/melpa +++ b/melpa @@ -19,7 +19,7 @@ function melpa_build_pkglist { } function melpa_generate_html { - echo "*** Building html" + echo "*** Building html..." cd html || return 1 erb index.erb > index.md pandoc --template=template.html --css=style.css -s --mathml -t html --smart index.md > index.html @@ -31,26 +31,8 @@ function trim { echo $1 } -function melpa_validate { - NUMPACKAGES=$(trim `ls recipes/* | wc -l`) - NUMBUILT=$(trim `ls packages/*.{el,tar} | wc -l`) - - echo "${NUMBUILT}/${NUMPACKAGES} packages built" - - if [[ $NUMBUILT -ne $NUMPACKAGES ]]; then - echo - echo "Missing Packages" - echo "______________________" - emacs --script missing.el - exit 1 - else - exit 0 - fi - -} - function print_usage { - echo "usage: $0 [-h | -?] [clear | build | html | validate]" + echo "usage: $0 [-h | -?] [clear | build | html ]" } args=`getopt h $*` @@ -77,7 +59,7 @@ done if [[ "$#" == "0" ]]; then - set -- build index validate + set -- build index fi for i; do @@ -85,7 +67,6 @@ for i; do clear ) melpa_clear_packages ;; build ) melpa_build_pkglist ;; html | index ) melpa_generate_html ;; - validate ) melpa_validate ;; esac shift done diff --git a/package-build.el b/package-build.el index b7cadc20..eec868fb 100644 --- a/package-build.el +++ b/package-build.el @@ -541,7 +541,8 @@ of the same-named package which is to be kept." (delete-directory pkg-dir t nil) (pb/add-to-archive-contents pkg-info 'tar)))) - (pb/dump-archive-contents)))) + (pb/dump-archive-contents) + file-name))) (defun package-build-archive-ignore-errors (pkg) "Build archive for package PKG, ignoring any errors." @@ -551,8 +552,14 @@ of the same-named package which is to be kept." (defun package-build-all () "Build all packages in the `package-build-alist'." (interactive) - (mapc 'package-build-archive-ignore-errors - (mapcar 'symbol-name (mapcar 'car package-build-alist))) + (let ((failed (loop for pkg in (mapcar 'car package-build-alist) + when (not (package-build-archive-ignore-errors + (symbol-name pkg))) + collect pkg))) + (if (zerop (length failed)) + (princ "\nSuccessfully Compiled All Packages\n") + (princ "\nFailed to Build the Following Packages\n") + (princ (mapconcat 'symbol-name failed "\n")))) (package-build-cleanup)) (defun package-build-cleanup () From 682efd1d228a129c4e18331986018ae255606ebd Mon Sep 17 00:00:00 2001 From: Donald Curtis Date: Sat, 21 Apr 2012 13:57:58 -0500 Subject: [PATCH 045/111] Cleanup output a bit. Only print certain things to stdout, rest to stderr. --- package-build.el | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/package-build.el b/package-build.el index eec868fb..a2141d3e 100644 --- a/package-build.el +++ b/package-build.el @@ -73,10 +73,11 @@ (defun pb/parse-time (str) "Parse STR as a time, and format as a YYYYMMDD string." + (princ (format "%s\n" (substring-no-properties str))) (format-time-string "%Y%m%d" (date-to-time - (print (substring-no-properties str))))) + (substring-no-properties str)))) (defun pb/string-match-all (regex str &optional group) "Find every match for `REGEX' within `STR', returning the full @@ -119,7 +120,8 @@ In turn, this function uses the :fetcher option in the config to choose a source-specific fetcher function, which it calls with the same arguments." (let ((repo-type (plist-get config :fetcher))) - (print repo-type) + (princ (format "%s %s" repo-type + (or (plist-get config :repo) (plist-get config :url)))) (funcall (intern (format "pb/checkout-%s" repo-type)) name config cwd))) @@ -157,13 +159,13 @@ rate limiting." (url-copy-file download-url filename t)) (with-current-buffer (pb/with-wiki-rate-limit (url-retrieve-synchronously wiki-url)) + (princ (format "%s\n" download-url)) (pb/find-parse-time "Last edited \\([0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\} [0-9]\\{2\\}:[0-9]\\{2\\} [A-Z]\\{3\\}\\)")))) (defun pb/checkout-wiki (name config dir) "Checkout package NAME with config CONFIG from the EmacsWiki into DIR." (with-current-buffer (get-buffer-create "*package-build-checkout*") - (message dir) (unless (file-exists-p dir) (make-directory dir)) (let ((files (or (plist-get config :files) @@ -457,7 +459,7 @@ ARCHIVE-ENTRY is stored." Note that the working directory (if present) is not deleted by this function, since the archive list may contain another version of the same-named package which is to be kept." - (message "Removing archive: %s" archive-entry) + (print (format "Removing archive: %s" archive-entry)) (let ((archive-file (pb/archive-file-name archive-entry))) (when (file-exists-p archive-file) (delete-file archive-file))) @@ -476,7 +478,7 @@ of the same-named package which is to be kept." "Build a package archive for package FILE-NAME." (interactive (list (completing-read "Package: " (mapc 'car package-build-alist)))) - + (princ (format "\n%s\n" file-name)) (let* ((name (intern file-name)) (cfg (or (cdr (assoc name package-build-alist)) (error "Cannot find package %s" file-name))) @@ -489,7 +491,7 @@ of the same-named package which is to be kept." (default-directory package-build-working-dir)) (cond ((not version) - (print (format "Unable to check out repository for %s" name))) + (message "Unable to check out repository for %s" name)) ((= 1 (length files)) (let* ((pkgsrc (expand-file-name (car files) pkg-cwd)) (pkgdst (expand-file-name @@ -500,7 +502,7 @@ of the same-named package which is to be kept." file-name version cfg))) - (print pkg-info) + (message "%S" pkg-info) (when (file-exists-p pkgdst) (delete-file pkgdst t)) (copy-file pkgsrc pkgdst) @@ -519,7 +521,7 @@ of the same-named package which is to be kept." version cfg))) - (print pkg-info) + (message "%S" pkg-info) (copy-directory file-name pkg-dir) (pb/write-pkg-file (expand-file-name From db9d32ee99ad5a454de93aaa0e4fe2020d8e43a0 Mon Sep 17 00:00:00 2001 From: Donald Curtis Date: Sat, 21 Apr 2012 14:36:37 -0500 Subject: [PATCH 046/111] Cleanup script output. --- package-build.el | 45 ++++++++++++++++++++++++++------------------- 1 file changed, 26 insertions(+), 19 deletions(-) diff --git a/package-build.el b/package-build.el index a2141d3e..0edbc833 100644 --- a/package-build.el +++ b/package-build.el @@ -120,8 +120,10 @@ In turn, this function uses the :fetcher option in the config to choose a source-specific fetcher function, which it calls with the same arguments." (let ((repo-type (plist-get config :fetcher))) - (princ (format "%s %s" repo-type - (or (plist-get config :repo) (plist-get config :url)))) + (princ (format "%s " repo-type)) + (unless (eq 'wiki repo-type) + (princ (format "%s\n" + (or (plist-get config :repo) (plist-get config :url))))) (funcall (intern (format "pb/checkout-%s" repo-type)) name config cwd))) @@ -188,12 +190,12 @@ rate limiting." (cond ((and (file-exists-p (expand-file-name "_darcs" dir)) (string-equal (pb/darcs-repo dir) repo)) - (print "checkout directory exists, updating...") + (pb/princ-exists dir) (pb/run-process dir "darcs" "pull")) (t (when (file-exists-p dir) (delete-directory dir t nil)) - (print "cloning repository") + (pb/princ-checkout repo dir) (pb/run-process nil "darcs" "get" repo dir))) (apply 'pb/run-process dir "darcs" "changes" "--max-count" "1" (pb/expand-file-list dir config)) @@ -214,6 +216,12 @@ rate limiting." (substring str 0 (1- (length str))) str)) +(defun pb/princ-exists (dir) + (princ (format "updating %s\n" dir))) + +(defun pb/princ-checkout (repo dir) + (princ (format "cloning %s to %s\n" repo dir))) + (defun pb/checkout-svn (name config dir) "Check package NAME with config CONFIG out of svn into DIR." (with-current-buffer (get-buffer-create "*package-build-checkout*") @@ -222,12 +230,12 @@ rate limiting." (cond ((and (file-exists-p (expand-file-name ".svn" dir)) (string-equal (pb/svn-repo dir) repo)) - (print "checkout directory exists, updating...") + (pb/princ-exists dir) (pb/run-process dir "svn" "up")) (t (when (file-exists-p dir) (delete-directory dir t nil)) - (print "cloning repository") + (pb/princ-checkout repo dir) (pb/run-process nil "svn" "checkout" repo dir))) (apply 'pb/run-process dir "svn" "info" (pb/expand-file-list dir config)) (or (pb/find-parse-time-latest "Last Changed Date: \\([0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\} [0-9]\\{2\\}:[0-9]\\{2\\}:[0-9]\\{2\\}\\)" bound) @@ -250,12 +258,12 @@ rate limiting." (cond ((and (file-exists-p (expand-file-name ".git" dir)) (string-equal (pb/git-repo dir) repo)) - (print "checkout directory exists, updating...") + (pb/princ-exists dir) (pb/run-process dir "git" "pull")) (t (when (file-exists-p dir) (delete-directory dir t nil)) - (print (format "cloning %s to %s" repo dir)) + (pb/princ-checkout repo dir) (pb/run-process nil "git" "clone" repo dir))) (when commit (pb/run-process dir "git" "checkout" commit)) @@ -286,12 +294,12 @@ rate limiting." (cond ((and (file-exists-p (expand-file-name ".bzr" dir)) (string-equal (pb/bzr-repo dir) repo)) - (print "checkout directory exists, updating...") + (pb/princ-exists dir) (pb/run-process dir "bzr" "merge")) (t (when (file-exists-p dir) (delete-directory dir t nil)) - (print "cloning repository") + (pb/princ-checkout repo dir) (pb/run-process nil "bzr" "branch" repo dir))) (apply 'pb/run-process dir "bzr" "log" "-l1" (pb/expand-file-list dir config)) @@ -314,13 +322,13 @@ rate limiting." (cond ((and (file-exists-p (expand-file-name ".hg" dir)) (string-equal (pb/hg-repo dir) repo)) - (print "checkout directory exists, updating...") + (pb/princ-exists dir) (pb/run-process dir "hg" "pull") (pb/run-process dir "hg" "update")) (t (when (file-exists-p dir) (delete-directory dir t nil)) - (print "cloning repository") + (pb/princ-checkout repo dir) (pb/run-process nil "hg" "clone" repo dir))) (apply 'pb/run-process dir "hg" "log" "--style" "compact" "-l1" (pb/expand-file-list dir config)) @@ -474,18 +482,18 @@ of the same-named package which is to be kept." ;;; Public interface -(defun package-build-archive (file-name) +(defun package-build-archive (name) "Build a package archive for package FILE-NAME." - (interactive (list (completing-read "Package: " - (mapc 'car package-build-alist)))) - (princ (format "\n%s\n" file-name)) - (let* ((name (intern file-name)) + (interactive (list (intern (completing-read "Package: " + package-build-alist)))) + (let* ((file-name (symbol-name name)) (cfg (or (cdr (assoc name package-build-alist)) (error "Cannot find package %s" file-name))) (pkg-cwd (file-name-as-directory (expand-file-name file-name package-build-working-dir)))) + (princ (format "\n%s\n" file-name)) (let* ((version (pb/checkout name cfg pkg-cwd)) (files (pb/expand-file-list pkg-cwd cfg)) (default-directory package-build-working-dir)) @@ -555,8 +563,7 @@ of the same-named package which is to be kept." "Build all packages in the `package-build-alist'." (interactive) (let ((failed (loop for pkg in (mapcar 'car package-build-alist) - when (not (package-build-archive-ignore-errors - (symbol-name pkg))) + when (not (package-build-archive-ignore-errors pkg)) collect pkg))) (if (zerop (length failed)) (princ "\nSuccessfully Compiled All Packages\n") From 8b47179b4d8ba341b5a11eb9245b0b3a2fa0ecae Mon Sep 17 00:00:00 2001 From: Donald Curtis Date: Sat, 21 Apr 2012 15:00:17 -0500 Subject: [PATCH 047/111] default to `message' for everything except full-build information. --- package-build.el | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/package-build.el b/package-build.el index 0edbc833..f14ccecb 100644 --- a/package-build.el +++ b/package-build.el @@ -73,7 +73,7 @@ (defun pb/parse-time (str) "Parse STR as a time, and format as a YYYYMMDD string." - (princ (format "%s\n" (substring-no-properties str))) + (message (format "%s\n" (substring-no-properties str))) (format-time-string "%Y%m%d" (date-to-time @@ -120,9 +120,9 @@ In turn, this function uses the :fetcher option in the config to choose a source-specific fetcher function, which it calls with the same arguments." (let ((repo-type (plist-get config :fetcher))) - (princ (format "%s " repo-type)) + (message (format "%s " repo-type)) (unless (eq 'wiki repo-type) - (princ (format "%s\n" + (message (format "%s\n" (or (plist-get config :repo) (plist-get config :url))))) (funcall (intern (format "pb/checkout-%s" repo-type)) name config cwd))) @@ -161,7 +161,7 @@ rate limiting." (url-copy-file download-url filename t)) (with-current-buffer (pb/with-wiki-rate-limit (url-retrieve-synchronously wiki-url)) - (princ (format "%s\n" download-url)) + (message (format "%s\n" download-url)) (pb/find-parse-time "Last edited \\([0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\} [0-9]\\{2\\}:[0-9]\\{2\\} [A-Z]\\{3\\}\\)")))) @@ -493,7 +493,7 @@ of the same-named package which is to be kept." (file-name-as-directory (expand-file-name file-name package-build-working-dir)))) - (princ (format "\n%s\n" file-name)) + (message (format "\n%s\n" file-name)) (let* ((version (pb/checkout name cfg pkg-cwd)) (files (pb/expand-file-list pkg-cwd cfg)) (default-directory package-build-working-dir)) From b47382e904c002e70a59c521813ed94de68716aa Mon Sep 17 00:00:00 2001 From: Donald Curtis Date: Sat, 21 Apr 2012 15:00:57 -0500 Subject: [PATCH 048/111] Don't print pkg-info. --- package-build.el | 2 -- 1 file changed, 2 deletions(-) diff --git a/package-build.el b/package-build.el index f14ccecb..c937ac4f 100644 --- a/package-build.el +++ b/package-build.el @@ -510,7 +510,6 @@ of the same-named package which is to be kept." file-name version cfg))) - (message "%S" pkg-info) (when (file-exists-p pkgdst) (delete-file pkgdst t)) (copy-file pkgsrc pkgdst) @@ -529,7 +528,6 @@ of the same-named package which is to be kept." version cfg))) - (message "%S" pkg-info) (copy-directory file-name pkg-dir) (pb/write-pkg-file (expand-file-name From 869f22f2be70b94e6675874077123f88202942ed Mon Sep 17 00:00:00 2001 From: Donald Curtis Date: Sat, 21 Apr 2012 15:05:37 -0500 Subject: [PATCH 049/111] princ should be message in update/checkout messages --- package-build.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package-build.el b/package-build.el index c937ac4f..7f3084da 100644 --- a/package-build.el +++ b/package-build.el @@ -217,10 +217,10 @@ rate limiting." str)) (defun pb/princ-exists (dir) - (princ (format "updating %s\n" dir))) + (message (format "updating %s\n" dir))) (defun pb/princ-checkout (repo dir) - (princ (format "cloning %s to %s\n" repo dir))) + (message (format "cloning %s to %s\n" repo dir))) (defun pb/checkout-svn (name config dir) "Check package NAME with config CONFIG out of svn into DIR." From 66b342dc849482c01d2fb8c02abcd57a8d22b9cf Mon Sep 17 00:00:00 2001 From: Donald Curtis Date: Sat, 21 Apr 2012 22:05:20 -0500 Subject: [PATCH 050/111] use symbols in buildpkg --- buildpkg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildpkg b/buildpkg index 0c7518d6..b03337d8 100755 --- a/buildpkg +++ b/buildpkg @@ -4,4 +4,4 @@ (require 'package-build) -(mapc 'package-build-archive argv) +(mapc 'package-build-archive (mapcar 'intern argv)) From ae8e8ec191a5d3f5bbf4395ec886ca78979d1f03 Mon Sep 17 00:00:00 2001 From: Steve Purcell Date: Sat, 21 Apr 2012 13:10:29 +0100 Subject: [PATCH 051/111] Prefer mapc over dolist when an iteration variable is not required --- package-build.el | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/package-build.el b/package-build.el index 7f3084da..5bc88657 100644 --- a/package-build.el +++ b/package-build.el @@ -576,8 +576,7 @@ of the same-named package which is to be kept." (stale-archives (loop for built in package-build-archive-alist when (not (memq (car built) known-package-names)) collect built))) - (dolist (stale stale-archives) - (pb/remove-archive stale)))) + (mapc 'pb/remove-archive stale-archives))) (defun package-build-initialize () "Load the recipe and archive-contents files." From b5f5bbc7b050bff1978ff0bb18f6383d1dbbc0de Mon Sep 17 00:00:00 2001 From: Steve Purcell Date: Sat, 21 Apr 2012 17:57:18 +0100 Subject: [PATCH 052/111] Don't leave modified buffers open after looking for package info in files --- package-build.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package-build.el b/package-build.el index 5bc88657..4436dd21 100644 --- a/package-build.el +++ b/package-build.el @@ -385,8 +385,8 @@ FILES if non-nil. The file is written to "Get a vector of package info from the docstrings in FILE-PATH." (when (file-exists-p file-path) (ignore-errors - (save-window-excursion - (find-file file-path) + (with-temp-buffer + (insert-file-contents file-path) ;; next two lines are a hack for some packages that aren't ;; commented properly. (goto-char (point-max)) From eca898099d912d244bc9e42c9f8725235d617d9e Mon Sep 17 00:00:00 2001 From: Steve Purcell Date: Sat, 21 Apr 2012 21:07:24 +0100 Subject: [PATCH 053/111] Handle elisp files which have no "version" header, but are otherwise well-formatted --- package-build.el | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/package-build.el b/package-build.el index 4436dd21..25f8f573 100644 --- a/package-build.el +++ b/package-build.el @@ -387,11 +387,15 @@ FILES if non-nil. The file is written to (ignore-errors (with-temp-buffer (insert-file-contents file-path) - ;; next two lines are a hack for some packages that aren't + ;; next few lines are a hack for some packages that aren't ;; commented properly. + (goto-char (point-min)) + (forward-line) + (insert ";;; Version: 0") + (newline) (goto-char (point-max)) - (insert (concat "\n;;; " - (file-name-nondirectory file-path) " ends here")) + (newline) + (insert ";;; " (file-name-nondirectory file-path) " ends here") (flet ((package-strip-rcs-id (str) "0")) (package-buffer-info)))))) From 2847d1c03c2b6e0839e1a1dafd04aef1ac87ea08 Mon Sep 17 00:00:00 2001 From: "Paul C. Mantz" Date: Sun, 22 Apr 2012 12:39:35 -0500 Subject: [PATCH 054/111] * recipes/escreen: terminal multiplexer a la GNU Screen --- recipes/escreen | 1 + 1 file changed, 1 insertion(+) create mode 100644 recipes/escreen diff --git a/recipes/escreen b/recipes/escreen new file mode 100644 index 00000000..8ec5b680 --- /dev/null +++ b/recipes/escreen @@ -0,0 +1 @@ +(escreen :repo "emacsmirror/escreen" :fetcher github) From abb7101b2d48af56af09d1dc85c540300dba7b3c Mon Sep 17 00:00:00 2001 From: Donald Curtis Date: Mon, 23 Apr 2012 09:17:18 -0500 Subject: [PATCH 055/111] Add recipe emacs-setup --- recipes/emacs-setup | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 recipes/emacs-setup diff --git a/recipes/emacs-setup b/recipes/emacs-setup new file mode 100644 index 00000000..1c2b6ea1 --- /dev/null +++ b/recipes/emacs-setup @@ -0,0 +1,3 @@ +(emacs-setup + :fetcher github + :repo "echosa/emacs-setup") From 9841d3cfd1ee954eb0ab9b2ca3a3f605eb0fd22a Mon Sep 17 00:00:00 2001 From: Donald Curtis Date: Mon, 23 Apr 2012 09:31:11 -0500 Subject: [PATCH 056/111] add recipe mysql2sqlite --- recipes/mysql2sqlite | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 recipes/mysql2sqlite diff --git a/recipes/mysql2sqlite b/recipes/mysql2sqlite new file mode 100644 index 00000000..25ded13c --- /dev/null +++ b/recipes/mysql2sqlite @@ -0,0 +1,3 @@ +(mysql2sqlite + :fetcher github + :repo "echosa/emacs-mysql2sqlite") From b1ba64ef33c4fe4b6d5912fccaa3e4820347a5e3 Mon Sep 17 00:00:00 2001 From: Steve Purcell Date: Mon, 23 Apr 2012 18:28:41 +0100 Subject: [PATCH 057/111] Use a .dir-locals file to force recipes to open in emacs-lisp mode --- recipes/.dir-locals.el | 1 + 1 file changed, 1 insertion(+) create mode 100644 recipes/.dir-locals.el diff --git a/recipes/.dir-locals.el b/recipes/.dir-locals.el new file mode 100644 index 00000000..fa944367 --- /dev/null +++ b/recipes/.dir-locals.el @@ -0,0 +1 @@ +((nil . ((eval . (emacs-lisp-mode))))) From fdfe060ecff89e873a089f7222e7084106cfb1c7 Mon Sep 17 00:00:00 2001 From: Steve Purcell Date: Tue, 24 Apr 2012 08:11:16 +0100 Subject: [PATCH 058/111] Check more strictly that -pkg files contain a single define-package expression (see #92) --- package-build.el | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/package-build.el b/package-build.el index 25f8f573..289b4145 100644 --- a/package-build.el +++ b/package-build.el @@ -402,15 +402,18 @@ FILES if non-nil. The file is written to (defun pb/get-pkg-file-info (file-path) "Get a vector of package info from \"-pkg.el\" file FILE-PATH." (when (file-exists-p file-path) - (let ((pkgfile-info (cdr (pb/read-from-file file-path)))) - (vector - (nth 0 pkgfile-info) - (mapcar - (lambda (elt) - (list (car elt) (version-to-list (cadr elt)))) - (eval (nth 3 pkgfile-info))) - (nth 2 pkgfile-info) - (nth 1 pkgfile-info))))) + (let ((package-def (pb/read-from-file file-path))) + (if (eq 'define-package (car package-def)) + (let ((pkgfile-info (cdr package-def))) + (vector + (nth 0 pkgfile-info) + (mapcar + (lambda (elt) + (list (car elt) (version-to-list (cadr elt)))) + (eval (nth 3 pkgfile-info))) + (nth 2 pkgfile-info) + (nth 1 pkgfile-info))) + (error "No define-package found in %s" file-path))))) (defun pb/expand-file-list (dir config) "In DIR, expand the :files for CONFIG, some of which may be From 380c231e1f64a82c687c9d4e70b9b87c27247d36 Mon Sep 17 00:00:00 2001 From: Steve Purcell Date: Tue, 24 Apr 2012 19:01:35 +0100 Subject: [PATCH 059/111] Add my name to the copyright --- package-build.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package-build.el b/package-build.el index 289b4145..13380824 100644 --- a/package-build.el +++ b/package-build.el @@ -1,6 +1,7 @@ ;;; package-build.el --- Tools for curating the package archive -;; Copyright (C) 2011 Donald Ephraim Curtis +;; Copyright (C) 2011-2012 Donald Ephraim Curtis +;; Copyright (C) 2012 Steve Purcell ;; Copyright (C) 2009 Phil Hagelberg ;; Author: Donald Ephraim Curtis From 9c652e306e1c3823f1ace8e940d73342b88035a2 Mon Sep 17 00:00:00 2001 From: Donald Ephraim Curtis Date: Tue, 24 Apr 2012 13:17:14 -0500 Subject: [PATCH 060/111] Remove the "Credits" section. --- package-build.el | 5 ----- 1 file changed, 5 deletions(-) diff --git a/package-build.el b/package-build.el index 13380824..e2efc70d 100644 --- a/package-build.el +++ b/package-build.el @@ -9,11 +9,6 @@ ;; Version: 0.1 ;; Keywords: tools -;; -;; Credits: -;; Steve Purcell -;; - ;; This file is not (yet) part of GNU Emacs. ;; However, it is distributed under the same license. From 66db7a2e84d2f41fbac9e2682c3218b6b7e16628 Mon Sep 17 00:00:00 2001 From: Steve Purcell Date: Tue, 24 Apr 2012 19:49:36 +0100 Subject: [PATCH 061/111] Fix rainbow-delimiters recipe --- recipes/rainbow-delimiters | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/rainbow-delimiters b/recipes/rainbow-delimiters index db93ea4a..52d627b9 100644 --- a/recipes/rainbow-delimiters +++ b/recipes/rainbow-delimiters @@ -1,2 +1,2 @@ -(rainbow-delimiters :fetcher wiki) +(rainbow-delimiters :fetcher github :repo "jlr/rainbow-delimiters") From ead07037468e9d95f6beb2d0c7b12801a2d2eaa9 Mon Sep 17 00:00:00 2001 From: Steve Purcell Date: Tue, 24 Apr 2012 20:07:44 +0100 Subject: [PATCH 062/111] Report an error when elisp on EmacsWiki gets deleted upstream (as happened with rainbow-delimiters.el) --- package-build.el | 2 ++ 1 file changed, 2 insertions(+) diff --git a/package-build.el b/package-build.el index e2efc70d..a44a1c9c 100644 --- a/package-build.el +++ b/package-build.el @@ -155,6 +155,8 @@ rate limiting." (format "http://www.emacswiki.org/emacs/%s" filename))) (pb/with-wiki-rate-limit (url-copy-file download-url filename t)) + (when (zerop (nth 7 (file-attributes filename))) + (error "Wiki file %s was empty - has it been removed?" filename)) (with-current-buffer (pb/with-wiki-rate-limit (url-retrieve-synchronously wiki-url)) (message (format "%s\n" download-url)) From 3ab6c30f565b6c6d59dae762e7feeb04e5d09599 Mon Sep 17 00:00:00 2001 From: Marko Bencun Date: Fri, 27 Apr 2012 11:43:59 +0200 Subject: [PATCH 063/111] Add recipe pyregexp --- recipes/pyregexp | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 recipes/pyregexp diff --git a/recipes/pyregexp b/recipes/pyregexp new file mode 100644 index 00000000..e0d84a97 --- /dev/null +++ b/recipes/pyregexp @@ -0,0 +1,4 @@ +(pyregexp :repo "benma/pyregexp" + :fetcher github + :files ("pyregexp.el" "pyregexp.py")) + From b1913f9fdd87e52c657c8620fcd3acb990dd2408 Mon Sep 17 00:00:00 2001 From: Emanuel Evans Date: Sun, 29 Apr 2012 12:27:13 -0400 Subject: [PATCH 064/111] Add recipe for erlang --- recipes/erlang | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 recipes/erlang diff --git a/recipes/erlang b/recipes/erlang new file mode 100644 index 00000000..5b4f30f8 --- /dev/null +++ b/recipes/erlang @@ -0,0 +1,3 @@ +(erlang :repo "erlang/otp" + :fetcher github + :files ("lib/tools/emacs/*.el")) From bcd788336b8b1d3a0ec722ef00722ac7d3c726c3 Mon Sep 17 00:00:00 2001 From: Steve Purcell Date: Sun, 29 Apr 2012 18:53:17 +0100 Subject: [PATCH 065/111] Revert "Add recipe for erlang" (see #96) This reverts commit b1913f9fdd87e52c657c8620fcd3acb990dd2408. --- recipes/erlang | 3 --- 1 file changed, 3 deletions(-) delete mode 100644 recipes/erlang diff --git a/recipes/erlang b/recipes/erlang deleted file mode 100644 index 5b4f30f8..00000000 --- a/recipes/erlang +++ /dev/null @@ -1,3 +0,0 @@ -(erlang :repo "erlang/otp" - :fetcher github - :files ("lib/tools/emacs/*.el")) From 54d80f1f0b1159ee50aae44b04ce58716f8aa799 Mon Sep 17 00:00:00 2001 From: Donald Curtis Date: Sun, 29 Apr 2012 19:18:58 -0500 Subject: [PATCH 066/111] Throw an error if no files are found within the package. --- package-build.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/package-build.el b/package-build.el index a44a1c9c..32fa55d9 100644 --- a/package-build.el +++ b/package-build.el @@ -519,7 +519,7 @@ of the same-named package which is to be kept." (delete-file pkgdst t)) (copy-file pkgsrc pkgdst) (pb/add-to-archive-contents pkg-info 'single))) - (t + ((< 1 (length files)) (let* ((pkg-dir (concat file-name "-" version)) (pkg-file (concat file-name "-pkg.el")) (pkg-info @@ -553,7 +553,8 @@ of the same-named package which is to be kept." files) (delete-directory pkg-dir t nil) - (pb/add-to-archive-contents pkg-info 'tar)))) + (pb/add-to-archive-contents pkg-info 'tar))) + (t (error "Unable to find files matching recipe patterns."))) (pb/dump-archive-contents) file-name))) From cc929e15d52ef3cab5cc62e3f3437c78152ed417 Mon Sep 17 00:00:00 2001 From: Donald Curtis Date: Sun, 29 Apr 2012 19:54:35 -0500 Subject: [PATCH 067/111] fix indentation --- package-build.el | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package-build.el b/package-build.el index 32fa55d9..61d3c7a4 100644 --- a/package-build.el +++ b/package-build.el @@ -119,7 +119,7 @@ the same arguments." (message (format "%s " repo-type)) (unless (eq 'wiki repo-type) (message (format "%s\n" - (or (plist-get config :repo) (plist-get config :url))))) + (or (plist-get config :repo) (plist-get config :url))))) (funcall (intern (format "pb/checkout-%s" repo-type)) name config cwd))) @@ -201,7 +201,7 @@ rate limiting." "\\([a-zA-Z]\\{3\\} [a-zA-Z]\\{3\\} \\( \\|[0-9]\\)[0-9] [0-9]\\{2\\}:[0-9]\\{2\\}:[0-9]\\{2\\} [A-Za-z]\\{3\\} [0-9]\\{4\\}\\)")))) (defun pb/svn-repo (dir) - "Get the current svn repo for DIR." + "Get the current svn repo for DIR." (with-temp-buffer (pb/run-process dir "svn" "info") (goto-char (point-min)) @@ -490,7 +490,7 @@ of the same-named package which is to be kept." (defun package-build-archive (name) "Build a package archive for package FILE-NAME." (interactive (list (intern (completing-read "Package: " - package-build-alist)))) + package-build-alist)))) (let* ((file-name (symbol-name name)) (cfg (or (cdr (assoc name package-build-alist)) (error "Cannot find package %s" file-name))) From dcf97c7df6b99a3e402878525435615d7ec99af7 Mon Sep 17 00:00:00 2001 From: Donald Curtis Date: Sun, 29 Apr 2012 20:01:04 -0500 Subject: [PATCH 068/111] Delete package staging directory before building. --- package-build.el | 3 +++ 1 file changed, 3 insertions(+) diff --git a/package-build.el b/package-build.el index 61d3c7a4..bd359168 100644 --- a/package-build.el +++ b/package-build.el @@ -533,6 +533,9 @@ of the same-named package which is to be kept." version cfg))) + (when (file-exists-p pkg-dir) + (delete-directory pkg-dir t nil)) + (copy-directory file-name pkg-dir) (pb/write-pkg-file (expand-file-name From 0bded518d1544a9442c13c5cbfab64f0f1cbdb6d Mon Sep 17 00:00:00 2001 From: Donald Curtis Date: Sun, 29 Apr 2012 20:05:39 -0500 Subject: [PATCH 069/111] fix vimgolf recipe --- recipes/vimgolf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/vimgolf b/recipes/vimgolf index ce48f02c..5b7b0da7 100644 --- a/recipes/vimgolf +++ b/recipes/vimgolf @@ -1,2 +1,2 @@ -(vimgolf :repo "timvisher/vimgolf" :fetcher github) +(vimgolf :repo "timvisher/vimgolf" :fetcher github :files ("emacs/vimgolf.el")) From 2bd4f0e0dd9d57961f75d1db7a10c573a7d28b1f Mon Sep 17 00:00:00 2001 From: Aleksandar Simic Date: Mon, 30 Apr 2012 10:35:33 +0000 Subject: [PATCH 070/111] Added the recipe for egg mode --- recipes/egg | 1 + 1 file changed, 1 insertion(+) create mode 100644 recipes/egg diff --git a/recipes/egg b/recipes/egg new file mode 100644 index 00000000..4aa41a85 --- /dev/null +++ b/recipes/egg @@ -0,0 +1 @@ +(egg :repo "byplayer/egg" :fetcher github) From abbe137e3811506380d730b95f8158b1fcd832a6 Mon Sep 17 00:00:00 2001 From: Donald Curtis Date: Sun, 29 Apr 2012 19:26:28 -0500 Subject: [PATCH 071/111] Copy files for multi-file packages as individuals, rather than duplicating the repository. --- package-build.el | 50 ++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 46 insertions(+), 4 deletions(-) diff --git a/package-build.el b/package-build.el index bd359168..c3fa7295 100644 --- a/package-build.el +++ b/package-build.el @@ -481,12 +481,47 @@ of the same-named package which is to be kept." (pb/dump-archive-contents)) (defun pb/read-recipes () - "Return a list of data structures for all recipes in `package-build-recipes-dir'." + "Return a list of data structures for all recipes in +`package-build-recipes-dir'." (mapcar 'pb/read-from-file (directory-files package-build-recipes-dir t "^[^.]"))) -;;; Public interface +(defun pb/copy-file (src dst) + "Copy SRC to DST and create parent directories for DST if they +don't exist." + (let ((dstdir (file-name-directory dst))) + (unless (file-exists-p dstdir) + (make-directory dstdir t))) + (cond + ((file-regular-p src) + (copy-file src dst)) + ((file-directory-p src) + (copy-directory src dst)))) +(defun pb/equal (lst) + "Test if all elements in the list are equal." + (let ((first-element (car lst))) + (every (lambda (ele) (equal first-element ele)) lst))) + +(defun pb/common-prefix (lsts) + "Determine the longest starting prefix for LSTS" + (when (pb/equal (mapcar 'car lsts)) + (cons (car (car lsts)) (pb/common-prefix (mapcar 'cdr lsts))))) + +(defun pb/common-path-prefix (files) + "Determine the common path prefix for FILES" + (mapconcat 'identity + (pb/common-prefix + (mapcar (lambda (path) (split-string path "/")) + files)) "/")) + +(defun pb/remove-prefix (pfx str) + "Strip PFX from STR" + (if (string-match (concat "^" pfx) str) + (setq str (replace-match "" nil nil str)) + str)) + +;;; Public interface (defun package-build-archive (name) "Build a package archive for package FILE-NAME." (interactive (list (intern (completing-read "Package: " @@ -531,12 +566,19 @@ of the same-named package which is to be kept." (pb/get-package-info (concat file-name ".el")))) file-name version - cfg))) + cfg)) + (pkg-pathpfx + (file-name-as-directory (pb/common-path-prefix files)))) (when (file-exists-p pkg-dir) (delete-directory pkg-dir t nil)) - (copy-directory file-name pkg-dir) + (mapc (lambda (fn) + (pb/copy-file (expand-file-name fn pkg-cwd) + (expand-file-name + (pb/remove-prefix pkg-pathpfx fn) + pkg-dir))) + files) (pb/write-pkg-file (expand-file-name pkg-file From 34c09152d3f56a79ee9cdc17d1ad4ece44ad3d9e Mon Sep 17 00:00:00 2001 From: Donald Curtis Date: Mon, 30 Apr 2012 15:32:43 -0500 Subject: [PATCH 072/111] Add recipe for erlang (see #96) --- recipes/erlang | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 recipes/erlang diff --git a/recipes/erlang b/recipes/erlang new file mode 100644 index 00000000..5b4f30f8 --- /dev/null +++ b/recipes/erlang @@ -0,0 +1,3 @@ +(erlang :repo "erlang/otp" + :fetcher github + :files ("lib/tools/emacs/*.el")) From 2bebebbcd6304e05fc2c1aae4ecb208e33826e43 Mon Sep 17 00:00:00 2001 From: Donald Curtis Date: Mon, 30 Apr 2012 15:59:33 -0500 Subject: [PATCH 073/111] Add function to parse line from run-process. It is very common to find a regex match after running a process, so make a function for this. --- package-build.el | 40 +++++++++++++++------------------------- 1 file changed, 15 insertions(+), 25 deletions(-) diff --git a/package-build.el b/package-build.el index c3fa7295..1edaef66 100644 --- a/package-build.el +++ b/package-build.el @@ -109,6 +109,15 @@ Output is written to the current buffer." (error "Program '%s' with args '%s' exited with non-zero status %d" prog args exit-code))))) +(defun pb/run-process-match (regex dir prog &rest args) + "In DIR (or `default-directory' if unset) run command PROG with + ARGS and find the output that matches REGEX" + (with-temp-buffer + (apply 'pb/run-process dir prog args) + (goto-char (point-min)) + (re-search-forward regex) + (match-string-no-properties 1))) + (defun pb/checkout (name config cwd) "Check out source for package NAME with CONFIG under working dir CWD. @@ -175,11 +184,7 @@ rate limiting." (defun pb/darcs-repo (dir) "Get the current darcs repo for DIR." - (with-temp-buffer - (pb/run-process dir "darcs" "show" "repo") - (goto-char (point-min)) - (re-search-forward "Default Remote: \\(.*\\)") - (match-string-no-properties 1))) + (pb/run-process-match "Default Remote: \\(.*\\)" dir "darcs" "show" "repo")) (defun pb/checkout-darcs (name config dir) "Check package NAME with config CONFIG out of darcs into DIR." @@ -202,11 +207,7 @@ rate limiting." (defun pb/svn-repo (dir) "Get the current svn repo for DIR." - (with-temp-buffer - (pb/run-process dir "svn" "info") - (goto-char (point-min)) - (re-search-forward "URL: \\(.*\\)") - (match-string-no-properties 1))) + (pb/run-process-match "URL: \\(.*\\)" dir "svn" "info")) (defun pb/trim (str &optional chr) (unless chr (setq chr ? )) @@ -241,11 +242,8 @@ rate limiting." (defun pb/git-repo (dir) "Get the current git repo for DIR." - (with-temp-buffer - (pb/run-process dir "git" "remote" "show" "-n" "origin") - (goto-char (point-min)) - (re-search-forward "Fetch URL: \\(.*\\)") - (match-string-no-properties 1))) + (pb/run-process-match + "Fetch URL: \\(.*\\)" dir "git" "remote" "show" "-n" "origin")) (defun pb/checkout-git (name config dir) "Check package NAME with config CONFIG out of git into DIR." @@ -278,11 +276,7 @@ rate limiting." (defun pb/bzr-repo (dir) "Get the current bzr repo for DIR." - (with-temp-buffer - (pb/run-process dir "bzr" "info") - (goto-char (point-min)) - (re-search-forward "parent branch: \\(.*\\)") - (match-string-no-properties 1))) + (pb/run-process-match "parent branch: \\(.*\\)" dir "bzr" "info")) (defun pb/checkout-bzr (name config dir) "Check package NAME with config CONFIG out of bzr into DIR." @@ -306,11 +300,7 @@ rate limiting." (defun pb/hg-repo (dir) "Get the current hg repo for DIR." - (with-temp-buffer - (pb/run-process dir "hg" "paths") - (goto-char (point-min)) - (re-search-forward "default = \\(.*\\)") - (match-string-no-properties 1))) + (pb/run-process-match "default = \\(.*\\)" dir "hg" "paths")) (defun pb/checkout-hg (name config dir) "Check package NAME with config CONFIG out of hg into DIR." From 310ca31c8d510651bf3181a4099f66feac5cc0a1 Mon Sep 17 00:00:00 2001 From: Donald Curtis Date: Mon, 30 Apr 2012 16:03:22 -0500 Subject: [PATCH 074/111] Expand bzr repos to canonical path. --- package-build.el | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/package-build.el b/package-build.el index 1edaef66..58e5f3a3 100644 --- a/package-build.el +++ b/package-build.el @@ -273,6 +273,9 @@ rate limiting." (let* ((url (format "git://github.com/%s.git" (plist-get config :repo)))) (pb/checkout-git name (plist-put (copy-sequence config) :url url) dir))) +(defun pb/bzr-expand-repo (repo) + "Get REPO expanded name." + (pb/run-process-match "branch root: \\(.*\\)" nil "bzr" "info" repo)) (defun pb/bzr-repo (dir) "Get the current bzr repo for DIR." @@ -280,7 +283,7 @@ rate limiting." (defun pb/checkout-bzr (name config dir) "Check package NAME with config CONFIG out of bzr into DIR." - (let ((repo (plist-get config :url))) + (let ((repo (pb/bzr-expand-repo (plist-get config :url)))) (with-current-buffer (get-buffer-create "*package-build-checkout*") (goto-char (point-max)) (cond From e34e399bf1d34291b6e52432e45751fc64aa93c0 Mon Sep 17 00:00:00 2001 From: Donald Curtis Date: Mon, 30 Apr 2012 16:54:04 -0500 Subject: [PATCH 075/111] minor update to index to hopefully make it look cleaner. --- html/index.erb | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/html/index.erb b/html/index.erb index 47d5182c..4abe5060 100644 --- a/html/index.erb +++ b/html/index.erb @@ -1,15 +1,13 @@ %% MELPA +*MELPA* or *Milkypostman's ELPA* or *Milkypostman's Experimental Lisp Package Repository* if you're not into the whole brevity thing. + [ [Packages](#current-list-of-packages) ] [ [Installing](#installing) ] [ [Known Issues](#known-issues) ] [ [Updating Packages](#updating-packages) ] [ [Development](#development) ] -*MELPA* or *Milkypostman's ELPA* or *Milkypostman's Experimental Lisp Package Repository* if you're not into the whole brevity thing. - -> a repository for development versions of Emacs packages (hot from the repo). - **Last Update:** *<%= Time.now.strftime("%Y.%m.%d %H:%M %z") %>* ## Current List of Packages From c7f03d86b4f1ccc771677b865b6defbc49a53559 Mon Sep 17 00:00:00 2001 From: Donald Curtis Date: Mon, 30 Apr 2012 17:13:46 -0500 Subject: [PATCH 076/111] Major update to README include TOC --- README.md | 273 +++++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 207 insertions(+), 66 deletions(-) diff --git a/README.md b/README.md index 8e577efc..a35ccb32 100644 --- a/README.md +++ b/README.md @@ -6,8 +6,7 @@ code using simple recipes. (Think of it as a server-side version of [el-get](https://github.com/dimitri/el-get), or even [homebrew](https://github.com/mxcl/homebrew).) -Packages are updated when changes are made to the MELPA repository, -or at least daily. +Packages are updated hourly. If you just want to browse and install packages, check out the [archive index page](http://melpa.milkbox.net/) for instructions. @@ -15,64 +14,94 @@ If you just want to browse and install packages, check out the Adding packages is as simple as submitting a pull request; read on for details. -### About the name +## Table of Contents -*MELPA* is *Milkypostman's ELPA* or *Milkypostman's Experimental Lisp - Package Archive* if you're not into the whole brevity thing. +* [Usage](#usage) +* [Contributing](#contributing-new-packages) +* [Package Format](#package-format) +* [Server Scripts](#server-scripts) +* [API](#api) +* [MELPA Package](#melpa-package) +* [About](#about) -## Scripts -* `buildpkg` -- Create an archive of the package(s) passed as -arguments to the script. Built packages are put in the `packages/` -folder with version corresponding to the newest HEAD revision -available; given according to the `%Y%m%d` format. +## Usage -* `melpa` -- All the logic for generating everything in the repository -based on the recipe files. By default this will clean the `packages/` directory, -build all packages -listed under `recipes/`, and compile the `index.html` file for the [melpa] -website front page. +To use the MELPA repository, add it to `package-archives` before the +call to `package-initialize` in your `init.el` file. -The following arguments are accepted: + (add-to-list 'package-archives + '("melpa" . "http://melpa.milkbox.net/packages/") t) + +Since `package.el` doesn't allow locking packages to certain version, +we also provide a package `melpa.el` which contains code to allow +restricting packages to specific repositories. This allows someone to +blacklist packages that come from a specific repository, or blacklist +all packages from a repository and only whitelist certain packages. -clear -: clean out the `packages/` directory +See the [MELPA Package](#melpa-package) section below or +[Installing](http://melpa.milkbox.net/#installing) section on the +MELPA homepage. -build -: build all packages in `pkglist` - -index -: build the `index.html` file - -validate -: naively validate that the correct number of packages were built. - -Note that these scripts require an Emacs with `package.el` installed, -such as Emacs 24. If you have an older version of Emacs, you can get a -suitable `package.el` [here](http://bit.ly/pkg-el23). - -[melpa]: http://melpa.milkbox.net - -## Code - -The `package-build.el` file contains all the heavy lifting. The -scripts above call the `package-build-archive` function from the -command-line to actually build the package(s). - -Use `(package-build-all)` to build all melpa packages. - -Alternatively you can -load this file from within Emacs and issues commands from there. - -The `package-build.el` automatically generates any required -information for the package. For multi-file packages this include -generating the file `-pkg.el` which contains *description*, -*version*, and *requires* information determined by searching -`-pkg.el`, `.el`, and `-pkg.el.in` if they exist in -the repository. ## Contributing New Packages +For submitting new packages we ask you following the following +guidelines, + +* Upstream source must be stored in an authoritative + [SCM](http://en.wikipedia.org/wiki/Software_configuration_management) + repository or on the Emacswiki. + + + + + +* Submit one pull request per recipe. You can create multiple + branches and create a pull request for each branch. + +* Recipes should try to minimize the size of the resulting package by + specifying only files relevant to the package. See the + [Package Format](#package-format) section for more information on + specifying package files. + +* The package name should match the name of the feature provided. See + the `package` function for more information. + +* Packages should adhere to the `package.el` format as specified by + `(info "(elisp) Packaging")`. More information on this format is + provided by the + [marmalade package manual](http://marmalade-repo.org/doc-files/package.5.html). + + + +### Testing + +Let `` denote the name of the recipe to submit. + +1. Fork the MELPA repository. +2. Add your new file under the directory specified by +`package-build-recipes-dir` (default: `recipes/` directory where +`package-build` was loaded). +3. Confirm your package build properly by running + + ./buildpkg + +4. Install the file you built by running `package-install-file` from +within Emacs and specifying the newly built package in the directory +specified by `package-build-archive-dir` (default: `packages/` +directory where `package-build` was loaded). + +### Submitting + +After verifying the entry works properly please open a pull request on +Github. Consider the [hub](https://github.com/defunkt/hub) +command-line utility by [defunkt](http://chriswanstrath.com/) which +helps simplify this process. + + +## Package Format + Packages are specified by files in the `recipes` directory. You can contribute a new package by adding a new file under `recipes` using the following form, @@ -85,15 +114,15 @@ the following form, [:files ("", ...)]) ``` -`package-name` -: a lisp symbol that has the same name as the package being specified. +- `package-name` +a lisp symbol that has the same name as the package being specified. -`:url` -: specifies the URL of the version control repository. *required for +- `:url` +specifies the URL of the version control repository. *required for the `git`, `bzr`, `hg`, `darcs` and `svn` fetchers* -`:fetcher` -: specifies the type of repository that `:url` points to. Right now +- `:fetcher` +specifies the type of repository that `:url` points to. Right now package-build supports [git][git], [github][github], [bazaar (bzr)][bzr], [mercurial (hg)][hg], [subversion (svn)][svn], [darcs][darcs], and @@ -109,8 +138,8 @@ differs from the package name being built. In the case of the `github` fetcher, use `:repo` instead of `:url`; the git URL will then be deduced. -`:files` -: optional property specifying the explicit files used to build the +- `:files` +optional property specifying the explicit files used to build the package. Automatically populated by matching all `.el` files in the root of the repository. This is necessary when there are multiple `.el` files in the repository but the package should only be built @@ -163,16 +192,70 @@ directory of the repository. The `starter-kit-bindings` repository is contained in the `modules/` subdirectory and thus needs the packages files specified explicitly. -### Submitting the Package -You should first fork the MELPA repository, add your new file under -`recipes`, and confirm your new package builds properly by running -`buildpkg `. You can install the package that you built by -running the interactive command `package-install-file` in Emacs, and -specifying the newly built package which should be in the `packages/` -subdirectory under the melpa directory. -After verifying the entry works properly please open a pull request on Github. + +## Build Scripts + +The scripts described here + +* `buildpkg` -- Create an archive of the package(s) passed as +arguments to the script. Built packages are put in the `packages/` +folder with version corresponding to the newest HEAD revision +available; given according to the `%Y%m%d` format. + +* `melpa` -- All the logic for generating everything in the repository +based on the recipe files. By default build all packages listed under +`recipes/`, and compile the `index.html` file for the [melpa] website. + + The following arguments are accepted: + + clear : clean out the `packages/` directory + + build : build all packages in `pkglist` + + index : build the `index.html` file + + validate :naively validate that the correct number of packages were built. + + Note that these scripts require an Emacs with `package.el` installed, + such as Emacs 24. If you have an older version of Emacs, you can get a + suitable `package.el` [here](http://bit.ly/pkg-el23). + +[melpa]: http://melpa.milkbox.net + +## API + +All repository code is contained in the `package-build.el`. + +### Functions + +- `(package-build-all)` : build packages for all recipes in the +directory specified by `package-build-recipes-dir`. + + +- `(package-build-archive)` : interactive function to build a single +archive. Packages are staged in the directory specified by +`package-build-working-dir` and built packages are placed in the +directory specified by `package-build-archive-dir`. Packages are +versioned based on the most recent commit date to package files based +on commits to upstream package repository. For multi-file packages, +the file `-pkg.el` is automatically generated and contains +*description*, *version*, and *requires* information determined by +searching `-pkg.el`, `.el`, and `-pkg.el.in`, if they +exist in the repository. + +### Variables + +- `package-build-working-dir` : Staging area containing package +repositories and package directories being built. + +- `package-build-archive-dir` : Location to store `archive-contents` and +any built packages. + +- `package-build-recipes-dir` : Directory containing MELPA compatible +recipes. See [Package Format](#package-format) section for more details. + ## Configuration @@ -181,3 +264,61 @@ This can be configured using the `package-build-archive-dir` variable. Repositories are checked out to the `working/` directory by default. This can be configured using the `package-build-working-dir` variable. + +## MELPA Package + +The `melpa.el` package---available in MELPA--allows creating a +whitelist or blacklist of packages for a specific repository. This +allows for disabling all packages from a specific repository and only +enabling certain packages, or simply blacklist a certain subset of packages. + +### Configuring + +By default there are two variables that can be customized to specify +which packages will be enabled (whitelist packages only) or excluded +(blacklist of packages) + + +- `package-archive-enable-alist` : Optional Alist of enabled packages + used by `package-filter`. The format is (ARCHIVE . PACKAGE ...), + where ARCHIVE is a string matching an archive name in + `package-archives`, PACKAGE is a symbol of a package in ARCHIVE to + enable. If no ARCHIVE exists in the alist, all packages are + enabled. + + If no ARCHIVE exists in the alist, all packages are enabled. + + + +- `package-archive-exclude-alist` : Alist of packages excluded by + `package-filter`. The format is (ARCHIVE . PACKAGE ...), where + ARCHIVE is a string matching an archive name in + `package-archives`, PACKAGE is a symbol of a package in that + archive to exclude. Any specified package is excluded regardless + of the value of `package-archive-enable-alist` + + + If a particular ARCHIVE has an entry in +`package-archive-enable-alist` then only packages + + + +### Manual Installation + +You can install the package manually by pasting this into yoru `*scratch*` buffer and evaluating it. + + (progn + (switch-to-buffer + (url-retrieve-synchronously + "https://raw.github.com/milkypostman/melpa/master/melpa.el")) + (package-install-from-buffer (package-buffer-info) 'single)) + + + + + +## About + +*MELPA* is *Milkypostman's ELPA* or *Milkypostman's Experimental Lisp + Package Archive* if you're not into the whole brevity thing. + From 41fdeb80d32c454e5987ebd14f9edeb2080e39af Mon Sep 17 00:00:00 2001 From: Donald Curtis Date: Mon, 30 Apr 2012 17:24:48 -0500 Subject: [PATCH 077/111] Fix expansion problem of bzr repos. --- package-build.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package-build.el b/package-build.el index 58e5f3a3..142999cb 100644 --- a/package-build.el +++ b/package-build.el @@ -275,7 +275,7 @@ rate limiting." (defun pb/bzr-expand-repo (repo) "Get REPO expanded name." - (pb/run-process-match "branch root: \\(.*\\)" nil "bzr" "info" repo)) + (pb/run-process-match "\\(?:branch root\\|repository branch\\): \\(.*\\)" nil "bzr" "info" repo)) (defun pb/bzr-repo (dir) "Get the current bzr repo for DIR." From 198dbe1a9f9addd8f96dc914b691729f75ce2a30 Mon Sep 17 00:00:00 2001 From: Donald Curtis Date: Tue, 1 May 2012 07:32:08 -0500 Subject: [PATCH 078/111] Remove path prefix before tar creation. Closes #97 --- package-build.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package-build.el b/package-build.el index 142999cb..39fe8014 100644 --- a/package-build.el +++ b/package-build.el @@ -588,7 +588,7 @@ don't exist." (expand-file-name (concat file-name "-" version ".tar") package-build-archive-dir) pkg-dir - files) + (mapcar (lambda (fn) (pb/remove-prefix pkg-pathpfx fn)) files)) (delete-directory pkg-dir t nil) (pb/add-to-archive-contents pkg-info 'tar))) From 7dc07903da02c5736db891ba99696d45859519d9 Mon Sep 17 00:00:00 2001 From: Donald Curtis Date: Tue, 1 May 2012 08:16:02 -0500 Subject: [PATCH 079/111] Minor README update. --- README.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index a35ccb32..dbcbe6c8 100644 --- a/README.md +++ b/README.md @@ -234,16 +234,17 @@ All repository code is contained in the `package-build.el`. directory specified by `package-build-recipes-dir`. -- `(package-build-archive)` : interactive function to build a single -archive. Packages are staged in the directory specified by +- `(package-build-archive NAME)` : interactive elisp function to build +a single archive. NAME is a symbol for the package to be built. +Packages are staged in the directory specified by `package-build-working-dir` and built packages are placed in the directory specified by `package-build-archive-dir`. Packages are versioned based on the most recent commit date to package files based on commits to upstream package repository. For multi-file packages, the file `-pkg.el` is automatically generated and contains *description*, *version*, and *requires* information determined by -searching `-pkg.el`, `.el`, and `-pkg.el.in`, if they -exist in the repository. +searching `-pkg.el`, `.el`, and `-pkg.el.in`, if +they exist in the repository. ### Variables From fa271f3c9a03fb542ea72cb6c341e9b5a23aacf8 Mon Sep 17 00:00:00 2001 From: Steve Purcell Date: Tue, 1 May 2012 14:09:50 +0100 Subject: [PATCH 080/111] Fix all checkdoc warnings --- package-build.el | 67 ++++++++++++++++++++---------------------------- 1 file changed, 28 insertions(+), 39 deletions(-) diff --git a/package-build.el b/package-build.el index 39fe8014..65ec6ea5 100644 --- a/package-build.el +++ b/package-build.el @@ -32,7 +32,7 @@ ;; This file allows a curator to publish an archive of Emacs packages. ;; The archive is generated from an index, which contains a list of -;; projects and repositories from which to get them. The term +;; projects and repositories from which to get them. The term ;; "package" here is used to mean a specific version of a project that ;; is prepared for download and installation. @@ -76,8 +76,7 @@ (substring-no-properties str)))) (defun pb/string-match-all (regex str &optional group) - "Find every match for `REGEX' within `STR', returning the full -match string or group `GROUP'." + "Find every match for `REGEX' within `STR', returning the full match string or group `GROUP'." (let (result (pos 0) (group (or group 0))) @@ -87,14 +86,12 @@ match string or group `GROUP'." result)) (defun pb/find-parse-time (regex &optional bound) - "Find REGEX in current buffer and format as a proper time -version, optionally looking only as far as BOUND." + "Find REGEX in current buffer and format as a time version, optionally looking only as far as BOUND." (pb/parse-time (progn (re-search-backward regex bound) (match-string-no-properties 1)))) (defun pb/find-parse-time-latest (regex &optional bound) - "Find the latest timestamp matching REGEX, optionally looking -only as far as BOUND." + "Find the latest timestamp matching REGEX, optionally looking only as far as BOUND." (let* ((text (buffer-substring-no-properties (or bound (point-min)) (point))) (times (mapcar 'pb/parse-time (pb/string-match-all regex text 1)))) @@ -110,8 +107,7 @@ Output is written to the current buffer." prog args exit-code))))) (defun pb/run-process-match (regex dir prog &rest args) - "In DIR (or `default-directory' if unset) run command PROG with - ARGS and find the output that matches REGEX" + "Find match for REGEX when - in DIR, or `default-directory' if unset - we run PROG with ARGS." (with-temp-buffer (apply 'pb/run-process dir prog args) (goto-char (point-min)) @@ -133,17 +129,15 @@ the same arguments." name config cwd))) (defvar pb/last-wiki-fetch-time 0 - "The time at which an emacswiki URL was last requested. This is -used to avoid exceeding the rate limit of 1 request per 2 + "The time at which an emacswiki URL was last requested. +This is used to avoid exceeding the rate limit of 1 request per 2 seconds; the server cuts off after 10 requests in 20 seconds.") (defvar pb/wiki-min-request-interval 2 - "The shortest permissible interval between successive requests -for Emacswiki URLs.") + "The shortest permissible interval between successive requests for Emacswiki URLs.") (defmacro pb/with-wiki-rate-limit (&rest body) - "Rate-limit BODY code passed to this macro to match EmacsWiki's -rate limiting." + "Rate-limit BODY code passed to this macro to match EmacsWiki's rate limiting." (let ((now (gensym)) (elapsed (gensym))) `(let* ((,now (float-time)) @@ -210,15 +204,17 @@ rate limiting." (pb/run-process-match "URL: \\(.*\\)" dir "svn" "info")) (defun pb/trim (str &optional chr) - (unless chr (setq chr ? )) - (if (equal (elt str (1- (length str))) chr) + "Return a copy of STR without any trailing CHR (or space if unspecified)." + (if (equal (elt str (1- (length str))) (or chr ? )) (substring str 0 (1- (length str))) str)) (defun pb/princ-exists (dir) + "Print a message that the contents of DIR will be updated." (message (format "updating %s\n" dir))) (defun pb/princ-checkout (repo dir) + "Print a message that REPO will be checked out into DIR." (message (format "cloning %s to %s\n" repo dir))) (defun pb/checkout-svn (name config dir) @@ -345,8 +341,7 @@ rate limiting." pkg-file)) (defun pb/read-from-file (file-name) - "Read and return the Lisp data stored in FILE-NAME,or nil if no -such file exists." + "Read and return the Lisp data stored in FILE-NAME,or nil if no such file exists." (when (file-exists-p file-name) (with-temp-buffer (insert-file-contents-literally file-name) @@ -355,9 +350,8 @@ such file exists." (defun pb/create-tar (file dir &optional files) - "Create a tar FILE containing the contents of DIR, or just -FILES if non-nil. The file is written to -`package-build-working-dir'." + "Create a tar FILE containing the contents of DIR, or just FILES if non-nil. +The file is written to `package-build-working-dir'." (let* ((default-directory package-build-working-dir)) (apply 'process-file "tar" nil @@ -407,14 +401,13 @@ FILES if non-nil. The file is written to (error "No define-package found in %s" file-path))))) (defun pb/expand-file-list (dir config) - "In DIR, expand the :files for CONFIG, some of which may be -shell-style wildcards." + "In DIR, expand the :files for CONFIG, some of which may be shell-style wildcards." (let ((default-directory dir)) (mapcan 'file-expand-wildcards (or (plist-get config :files) (list "*.el"))))) (defun pb/merge-package-info (pkg-info name version config) - "Return a version of PKG-INFO updated with NAME and VERSION. + "Return a version of PKG-INFO updated with NAME, VERSION and info from CONFIG. If PKG-INFO is nil, an empty one is created." (let* ((merged (or (copy-seq pkg-info) (vector name nil "No description available." version)))) @@ -431,8 +424,7 @@ If PKG-INFO is nil, an empty one is created." package-build-archive-dir))) (defun pb/add-to-archive-contents (pkg-info type) - "Add the built archive with info PKG-INFO and TYPE to -`package-build-archive-alist'." + "Add the built archive with info PKG-INFO and TYPE to `package-build-archive-alist'." (let* ((name (intern (aref pkg-info 0))) (requires (aref pkg-info 1)) (desc (or (aref pkg-info 2) "No description available.")) @@ -450,8 +442,7 @@ If PKG-INFO is nil, an empty one is created." type))))) (defun pb/archive-file-name (archive-entry) - "Return the path of the file in which the package for -ARCHIVE-ENTRY is stored." + "Return the path of the file in which the package for ARCHIVE-ENTRY is stored." (expand-file-name (format "%s-%s.%s" (car archive-entry) (car (aref (cdr archive-entry) 0)) @@ -474,14 +465,12 @@ of the same-named package which is to be kept." (pb/dump-archive-contents)) (defun pb/read-recipes () - "Return a list of data structures for all recipes in -`package-build-recipes-dir'." + "Return a list of data structures for all recipes in `package-build-recipes-dir'." (mapcar 'pb/read-from-file (directory-files package-build-recipes-dir t "^[^.]"))) (defun pb/copy-file (src dst) - "Copy SRC to DST and create parent directories for DST if they -don't exist." + "Copy SRC to DST and create parent directories for DST if they don't exist." (let ((dstdir (file-name-directory dst))) (unless (file-exists-p dstdir) (make-directory dstdir t))) @@ -492,31 +481,31 @@ don't exist." (copy-directory src dst)))) (defun pb/equal (lst) - "Test if all elements in the list are equal." + "Test if all elements in LST are equal." (let ((first-element (car lst))) (every (lambda (ele) (equal first-element ele)) lst))) (defun pb/common-prefix (lsts) - "Determine the longest starting prefix for LSTS" + "Determine the longest starting prefix for LSTS." (when (pb/equal (mapcar 'car lsts)) (cons (car (car lsts)) (pb/common-prefix (mapcar 'cdr lsts))))) (defun pb/common-path-prefix (files) - "Determine the common path prefix for FILES" + "Determine the common path prefix for FILES." (mapconcat 'identity (pb/common-prefix (mapcar (lambda (path) (split-string path "/")) files)) "/")) (defun pb/remove-prefix (pfx str) - "Strip PFX from STR" + "Strip PFX from STR." (if (string-match (concat "^" pfx) str) (setq str (replace-match "" nil nil str)) str)) ;;; Public interface (defun package-build-archive (name) - "Build a package archive for package FILE-NAME." + "Build a package archive for package NAME." (interactive (list (intern (completing-read "Package: " package-build-alist)))) (let* ((file-name (symbol-name name)) @@ -592,7 +581,7 @@ don't exist." (delete-directory pkg-dir t nil) (pb/add-to-archive-contents pkg-info 'tar))) - (t (error "Unable to find files matching recipe patterns."))) + (t (error "Unable to find files matching recipe patterns"))) (pb/dump-archive-contents) file-name))) From afb0db688d12e74859b5e118f78b1d6220e29857 Mon Sep 17 00:00:00 2001 From: Steve Purcell Date: Tue, 1 May 2012 14:15:12 +0100 Subject: [PATCH 081/111] Eliminate side effects in pb/remove-prefix, and note that the prefix is a regexp --- package-build.el | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/package-build.el b/package-build.el index 65ec6ea5..6ecbbda9 100644 --- a/package-build.el +++ b/package-build.el @@ -497,11 +497,11 @@ of the same-named package which is to be kept." (mapcar (lambda (path) (split-string path "/")) files)) "/")) -(defun pb/remove-prefix (pfx str) - "Strip PFX from STR." - (if (string-match (concat "^" pfx) str) - (setq str (replace-match "" nil nil str)) - str)) +(defun pb/remove-prefix (prefix string) + "Strip PREFIX (a regexp) from STRING." + (if (string-match (concat "^" prefix) string) + (replace-match "" nil nil string) + string)) ;;; Public interface (defun package-build-archive (name) From c5f641f8fb6d23e71192e8d123d233064e9d9583 Mon Sep 17 00:00:00 2001 From: Steve Purcell Date: Tue, 1 May 2012 14:19:10 +0100 Subject: [PATCH 082/111] Rename pathpfx variable for clarity --- package-build.el | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package-build.el b/package-build.el index 6ecbbda9..e8daa3a6 100644 --- a/package-build.el +++ b/package-build.el @@ -549,7 +549,7 @@ of the same-named package which is to be kept." file-name version cfg)) - (pkg-pathpfx + (pkg-path-prefix (file-name-as-directory (pb/common-path-prefix files)))) (when (file-exists-p pkg-dir) @@ -558,7 +558,7 @@ of the same-named package which is to be kept." (mapc (lambda (fn) (pb/copy-file (expand-file-name fn pkg-cwd) (expand-file-name - (pb/remove-prefix pkg-pathpfx fn) + (pb/remove-prefix pkg-path-prefix fn) pkg-dir))) files) @@ -577,7 +577,7 @@ of the same-named package which is to be kept." (expand-file-name (concat file-name "-" version ".tar") package-build-archive-dir) pkg-dir - (mapcar (lambda (fn) (pb/remove-prefix pkg-pathpfx fn)) files)) + (mapcar (lambda (fn) (pb/remove-prefix pkg-path-prefix fn)) files)) (delete-directory pkg-dir t nil) (pb/add-to-archive-contents pkg-info 'tar))) From 2bdf9d0a8735a0a475bb1ac5d171059b29d68549 Mon Sep 17 00:00:00 2001 From: Steve Purcell Date: Tue, 1 May 2012 14:22:29 +0100 Subject: [PATCH 083/111] Don't interpret PREFIX as a regexp in pb/remove-prefix --- package-build.el | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package-build.el b/package-build.el index e8daa3a6..77031959 100644 --- a/package-build.el +++ b/package-build.el @@ -498,9 +498,9 @@ of the same-named package which is to be kept." files)) "/")) (defun pb/remove-prefix (prefix string) - "Strip PREFIX (a regexp) from STRING." - (if (string-match (concat "^" prefix) string) - (replace-match "" nil nil string) + "Strip PREFIX from STRING." + (if (string-prefix-p prefix string) + (substring string (length prefix)) string)) ;;; Public interface From 877b5a3e612e1b1d6d51e60c66b0b79f231abdb2 Mon Sep 17 00:00:00 2001 From: Steve Purcell Date: Tue, 1 May 2012 17:02:58 +0100 Subject: [PATCH 084/111] Add Brian Carlson's "jade-mode", "stylus-mode" and "sws-mode" (see #82) --- recipes/jade-mode | 1 + recipes/stylus-mode | 1 + recipes/sws-mode | 1 + 3 files changed, 3 insertions(+) create mode 100644 recipes/jade-mode create mode 100644 recipes/stylus-mode create mode 100644 recipes/sws-mode diff --git a/recipes/jade-mode b/recipes/jade-mode new file mode 100644 index 00000000..0ba63da0 --- /dev/null +++ b/recipes/jade-mode @@ -0,0 +1 @@ +(jade-mode :fetcher github :repo "brianc/jade-mode" :files ("jade-mode.el")) diff --git a/recipes/stylus-mode b/recipes/stylus-mode new file mode 100644 index 00000000..52ff8e2f --- /dev/null +++ b/recipes/stylus-mode @@ -0,0 +1 @@ +(stylus-mode :fetcher github :repo "brianc/jade-mode" :files ("stylus-mode.el")) diff --git a/recipes/sws-mode b/recipes/sws-mode new file mode 100644 index 00000000..3c02c545 --- /dev/null +++ b/recipes/sws-mode @@ -0,0 +1 @@ +(sws-mode :fetcher github :repo "brianc/jade-mode" :files ("sws-mode.el")) From 743322efcf2a355d8e721968b07c27a50b1ec5a3 Mon Sep 17 00:00:00 2001 From: Donald Curtis Date: Wed, 2 May 2012 15:53:00 -0500 Subject: [PATCH 085/111] Fix builds where the *-pkg.el file is in a subdirectory (prefix) --- package-build.el | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/package-build.el b/package-build.el index 77031959..7337dd6f 100644 --- a/package-build.el +++ b/package-build.el @@ -537,30 +537,32 @@ of the same-named package which is to be kept." (copy-file pkgsrc pkgdst) (pb/add-to-archive-contents pkg-info 'single))) ((< 1 (length files)) - (let* ((pkg-dir (concat file-name "-" version)) + (let* ((pkg-path-prefix + (file-name-as-directory (pb/common-path-prefix files))) + (pkg-files (mapcar + (lambda (fn) (pb/remove-prefix pkg-path-prefix fn)) + files)) + (pkg-dir (concat file-name "-" version)) (pkg-file (concat file-name "-pkg.el")) (pkg-info (pb/merge-package-info (let ((default-directory pkg-cwd)) (or (pb/get-pkg-file-info pkg-file) + (pb/get-pkg-file-info (concat pkg-path-prefix pkg-file)) ;; some packages (like magit) provide name-pkg.el.in (pb/get-pkg-file-info (concat pkg-file ".in")) (pb/get-package-info (concat file-name ".el")))) file-name version - cfg)) - (pkg-path-prefix - (file-name-as-directory (pb/common-path-prefix files)))) + cfg))) (when (file-exists-p pkg-dir) (delete-directory pkg-dir t nil)) - (mapc (lambda (fn) - (pb/copy-file (expand-file-name fn pkg-cwd) - (expand-file-name - (pb/remove-prefix pkg-path-prefix fn) - pkg-dir))) - files) + (loop for src in files + for dst in pkg-files + do (pb/copy-file (expand-file-name src pkg-cwd) + (expand-file-name dst pkg-dir))) (pb/write-pkg-file (expand-file-name pkg-file @@ -571,13 +573,13 @@ of the same-named package which is to be kept." pkg-info) (when files - (add-to-list 'files pkg-file)) + (add-to-list 'pkg-files pkg-file)) (pb/create-tar (expand-file-name (concat file-name "-" version ".tar") package-build-archive-dir) pkg-dir - (mapcar (lambda (fn) (pb/remove-prefix pkg-path-prefix fn)) files)) + pkg-files) (delete-directory pkg-dir t nil) (pb/add-to-archive-contents pkg-info 'tar))) From 49fec624df4d36ed955a29c469298b8152185593 Mon Sep 17 00:00:00 2001 From: Donald Curtis Date: Wed, 2 May 2012 15:54:23 -0500 Subject: [PATCH 086/111] Add pony-mode. --- recipes/pony-mode | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 recipes/pony-mode diff --git a/recipes/pony-mode b/recipes/pony-mode new file mode 100644 index 00000000..59f0db23 --- /dev/null +++ b/recipes/pony-mode @@ -0,0 +1,4 @@ +(pony-mode + :repo "davidmiller/pony-mode" + :fetcher github + :files ("src/*.el")) From d13e2386e4143ded35275d39bbc742b2f87a459d Mon Sep 17 00:00:00 2001 From: Steve Purcell Date: Thu, 3 May 2012 11:18:42 +0100 Subject: [PATCH 087/111] pretty-mode should be a wiki recipe --- recipes/pretty-mode | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/recipes/pretty-mode b/recipes/pretty-mode index ef9bbdef..9e660586 100644 --- a/recipes/pretty-mode +++ b/recipes/pretty-mode @@ -1,2 +1 @@ -(pretty-mode :repo "emacsmirror/pretty-mode" :fetcher github) - +(pretty-mode :fetcher wiki) From a6e1dbe97798189818926846448efcf22ee7b892 Mon Sep 17 00:00:00 2001 From: Donald Curtis Date: Thu, 3 May 2012 20:15:52 -0500 Subject: [PATCH 088/111] New style :files directive in recipes. --- package-build.el | 126 +++++++++++++++++++++++++---------------------- 1 file changed, 68 insertions(+), 58 deletions(-) diff --git a/package-build.el b/package-build.el index 7337dd6f..3c57675e 100644 --- a/package-build.el +++ b/package-build.el @@ -195,7 +195,7 @@ seconds; the server cuts off after 10 requests in 20 seconds.") (pb/princ-checkout repo dir) (pb/run-process nil "darcs" "get" repo dir))) (apply 'pb/run-process dir "darcs" "changes" "--max-count" "1" - (pb/expand-file-list dir config)) + (pb/source-file-list (pb/expand-config-file-list dir config))) (pb/find-parse-time "\\([a-zA-Z]\\{3\\} [a-zA-Z]\\{3\\} \\( \\|[0-9]\\)[0-9] [0-9]\\{2\\}:[0-9]\\{2\\}:[0-9]\\{2\\} [A-Za-z]\\{3\\} [0-9]\\{4\\}\\)")))) @@ -232,7 +232,8 @@ seconds; the server cuts off after 10 requests in 20 seconds.") (delete-directory dir t nil)) (pb/princ-checkout repo dir) (pb/run-process nil "svn" "checkout" repo dir))) - (apply 'pb/run-process dir "svn" "info" (pb/expand-file-list dir config)) + (apply 'pb/run-process dir "svn" "info" + (pb/source-file-list (pb/expand-config-file-list dir config))) (or (pb/find-parse-time-latest "Last Changed Date: \\([0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\} [0-9]\\{2\\}:[0-9]\\{2\\}:[0-9]\\{2\\}\\)" bound) (error "No valid timestamps found!"))))) @@ -260,7 +261,7 @@ seconds; the server cuts off after 10 requests in 20 seconds.") (when commit (pb/run-process dir "git" "checkout" commit)) (apply 'pb/run-process dir "git" "log" "-n1" "--pretty=format:'\%ci'" - (pb/expand-file-list dir config)) + (pb/source-file-list (pb/expand-config-file-list dir config))) (pb/find-parse-time "\\([0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\} [0-9]\\{2\\}:[0-9]\\{2\\}:[0-9]\\{2\\}\\)")))) @@ -293,7 +294,7 @@ seconds; the server cuts off after 10 requests in 20 seconds.") (pb/princ-checkout repo dir) (pb/run-process nil "bzr" "branch" repo dir))) (apply 'pb/run-process dir "bzr" "log" "-l1" - (pb/expand-file-list dir config)) + (pb/source-file-list (pb/expand-config-file-list dir config))) (pb/find-parse-time "\\([0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\} [0-9]\\{2\\}:[0-9]\\{2\\}:[0-9]\\{2\\}\\)")))) @@ -318,7 +319,7 @@ seconds; the server cuts off after 10 requests in 20 seconds.") (pb/princ-checkout repo dir) (pb/run-process nil "hg" "clone" repo dir))) (apply 'pb/run-process dir "hg" "log" "--style" "compact" "-l1" - (pb/expand-file-list dir config)) + (pb/source-file-list (pb/expand-config-file-list dir config))) (pb/find-parse-time "\\([0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\} [0-9]\\{2\\}:[0-9]\\{2\\}\\)")))) @@ -400,11 +401,6 @@ The file is written to `package-build-working-dir'." (nth 1 pkgfile-info))) (error "No define-package found in %s" file-path))))) -(defun pb/expand-file-list (dir config) - "In DIR, expand the :files for CONFIG, some of which may be shell-style wildcards." - (let ((default-directory dir)) - (mapcan 'file-expand-wildcards - (or (plist-get config :files) (list "*.el"))))) (defun pb/merge-package-info (pkg-info name version config) "Return a version of PKG-INFO updated with NAME, VERSION and info from CONFIG. @@ -469,39 +465,62 @@ of the same-named package which is to be kept." (mapcar 'pb/read-from-file (directory-files package-build-recipes-dir t "^[^.]"))) -(defun pb/copy-file (src dst) - "Copy SRC to DST and create parent directories for DST if they don't exist." - (let ((dstdir (file-name-directory dst))) - (unless (file-exists-p dstdir) - (make-directory dstdir t))) + +(defun pb/source-file-list (files) + "Generate a flat source file listing from FILES." + (mapcan (lambda (fn) (if (consp fn) + (pb/source-file-list (cdr fn)) + (list fn))) files)) + +(defun pb/target-file-list (files) + "Generate a flat target file listing from FILES." + (loop for fn in files + nconc (if (consp fn) + (loop for res in (pb/target-file-list (cdr fn)) + collect (concat (car fn) "/" res)) + (list (file-name-nondirectory fn))))) + + +(defun pb/expand-config-file-list (dir config) + "In DIR, expand the :files for CONFIG and flatten the list." + (pb/expand-file-list dir (or (plist-get cfg :files) (list "*.el")))) + +(defun pb/expand-file-list (dir wildcards) + "In DIR, expand WILDCARDS, some of which may be shell-style wildcards." + (let ((default-directory dir)) + (mapcan (lambda (wc) + (if (consp wc) + (list (cons (car wc) (pb/expand-file-list dir (cdr wc)))) + (file-expand-wildcards wc))) + wildcards))) + + +(defun pb/copy-package-files (files source target) + "Copy FILES from the SOURCE directory to TARGET directory. +FILES is in the form (FILE-OR-CONS ...). + +FILE-OR-CONS is either a path relative to SOURCE or +a cons of the form (TARGET-SUBDIR FILE-OR-CONS). + +TARGET-SUBDIR is a directory relative to TARGET." + (loop for fn in files + if (consp fn) do (pb/copy-package-files (cdr fn) + source (expand-file-name (car fn) target)) + else do (pb/copy-file + (expand-file-name fn source) + (expand-file-name (file-name-nondirectory fn) target)))) + +(defun pb/copy-file (file newname) + "Copy FILE to NEWNAME and create parent directories for NEWNAME if they don't exist." + (let ((newdir (file-name-directory newname))) + (unless (file-exists-p newdir) + (make-directory newdir t))) (cond - ((file-regular-p src) - (copy-file src dst)) - ((file-directory-p src) - (copy-directory src dst)))) + ((file-regular-p file) + (copy-file file newname)) + ((file-directory-p file) + (copy-directory file newname)))) -(defun pb/equal (lst) - "Test if all elements in LST are equal." - (let ((first-element (car lst))) - (every (lambda (ele) (equal first-element ele)) lst))) - -(defun pb/common-prefix (lsts) - "Determine the longest starting prefix for LSTS." - (when (pb/equal (mapcar 'car lsts)) - (cons (car (car lsts)) (pb/common-prefix (mapcar 'cdr lsts))))) - -(defun pb/common-path-prefix (files) - "Determine the common path prefix for FILES." - (mapconcat 'identity - (pb/common-prefix - (mapcar (lambda (path) (split-string path "/")) - files)) "/")) - -(defun pb/remove-prefix (prefix string) - "Strip PREFIX from STRING." - (if (string-prefix-p prefix string) - (substring string (length prefix)) - string)) ;;; Public interface (defun package-build-archive (name) @@ -517,7 +536,7 @@ of the same-named package which is to be kept." (message (format "\n%s\n" file-name)) (let* ((version (pb/checkout name cfg pkg-cwd)) - (files (pb/expand-file-list pkg-cwd cfg)) + (files (pb/expand-config-file-list pkg-cwd cfg)) (default-directory package-build-working-dir)) (cond ((not version) @@ -537,18 +556,13 @@ of the same-named package which is to be kept." (copy-file pkgsrc pkgdst) (pb/add-to-archive-contents pkg-info 'single))) ((< 1 (length files)) - (let* ((pkg-path-prefix - (file-name-as-directory (pb/common-path-prefix files))) - (pkg-files (mapcar - (lambda (fn) (pb/remove-prefix pkg-path-prefix fn)) - files)) + (let* ((pkg-files (pb/target-file-list files)) (pkg-dir (concat file-name "-" version)) (pkg-file (concat file-name "-pkg.el")) (pkg-info (pb/merge-package-info (let ((default-directory pkg-cwd)) (or (pb/get-pkg-file-info pkg-file) - (pb/get-pkg-file-info (concat pkg-path-prefix pkg-file)) ;; some packages (like magit) provide name-pkg.el.in (pb/get-pkg-file-info (concat pkg-file ".in")) (pb/get-package-info (concat file-name ".el")))) @@ -559,17 +573,13 @@ of the same-named package which is to be kept." (when (file-exists-p pkg-dir) (delete-directory pkg-dir t nil)) - (loop for src in files - for dst in pkg-files - do (pb/copy-file (expand-file-name src pkg-cwd) - (expand-file-name dst pkg-dir))) + (pb/copy-package-files files pkg-cwd pkg-dir) - (pb/write-pkg-file (expand-file-name - pkg-file - (file-name-as-directory - (expand-file-name - pkg-dir - package-build-working-dir))) + (pb/write-pkg-file (expand-file-name pkg-file + (file-name-as-directory + (expand-file-name + pkg-dir + package-build-working-dir))) pkg-info) (when files From ca7bf43ef8893bf04e9658390e306ef69e80a156 Mon Sep 17 00:00:00 2001 From: Donald Curtis Date: Thu, 3 May 2012 20:42:32 -0500 Subject: [PATCH 089/111] Update recipes based on new style --- recipes/auto-complete | 2 +- recipes/ess | 4 +++- recipes/flymake-perlcritic | 5 +++-- recipes/git-blame | 5 +++-- recipes/helm-projectile | 5 +++-- recipes/icicles | 17 +++++++++++++++-- recipes/inflections | 5 +++-- recipes/jabber-mode | 5 +++-- recipes/load-theme-buffer-local | 4 ++-- recipes/lua-mode | 2 +- recipes/markdown-mode+ | 6 ++++-- recipes/melpa | 5 +++-- recipes/org-toodledo | 5 +++-- recipes/paredit | 5 +++-- recipes/pkgbuild-mode | 5 +++-- recipes/pony-mode | 2 +- recipes/popup | 5 +++-- recipes/projectile | 5 +++-- recipes/ruby-compilation | 5 +++-- recipes/ruby-interpolation | 2 +- recipes/ruby-mode | 5 +++-- recipes/slime | 5 +++-- recipes/slime-ritz | 5 +++-- recipes/starter-kit-bindings | 5 +++-- recipes/starter-kit-eshell | 5 +++-- recipes/starter-kit-js | 5 +++-- recipes/starter-kit-lisp | 5 +++-- recipes/starter-kit-perl | 5 +++-- recipes/starter-kit-ruby | 5 +++-- recipes/yari | 5 +++-- recipes/yasnippet | 5 +++-- recipes/zenburn-theme | 5 +++-- 32 files changed, 100 insertions(+), 59 deletions(-) diff --git a/recipes/auto-complete b/recipes/auto-complete index 004fc91e..d4b9caed 100644 --- a/recipes/auto-complete +++ b/recipes/auto-complete @@ -1,3 +1,3 @@ (auto-complete :repo "m2ym/auto-complete" :fetcher github :files - ("*.el" "dict/*")) + ("*.el" "dict")) diff --git a/recipes/ess b/recipes/ess index e43f32d1..e99748dc 100644 --- a/recipes/ess +++ b/recipes/ess @@ -1,3 +1,5 @@ (ess :repo "milkypostman/ESS" :fetcher github :files - ("*.el" "lisp/*.el" "etc/*")) + ("*.el" ("lisp" "lisp/*.el") ("etc" "etc/*"))) + + diff --git a/recipes/flymake-perlcritic b/recipes/flymake-perlcritic index d824230e..033eaefa 100644 --- a/recipes/flymake-perlcritic +++ b/recipes/flymake-perlcritic @@ -1,3 +1,4 @@ -(flymake-perlcritic :repo "illusori/emacs-flymake-perlcritic" :fetcher github :files - ("*.el" "bin/flymake_perlcritic")) +(flymake-perlcritic :repo "illusori/emacs-flymake-perlcritic" + :fetcher github + :files ("*.el" ("bin" "bin/flymake_perlcritic"))) diff --git a/recipes/git-blame b/recipes/git-blame index 57def06b..f6e266c1 100644 --- a/recipes/git-blame +++ b/recipes/git-blame @@ -1,3 +1,4 @@ -(git-blame :repo "tsgates/git-emacs" :fetcher github :files - ("git-blame.el")) +(git-blame :repo "tsgates/git-emacs" + :fetcher github + :files ("git-blame.el")) diff --git a/recipes/helm-projectile b/recipes/helm-projectile index e7134c60..547e5d78 100644 --- a/recipes/helm-projectile +++ b/recipes/helm-projectile @@ -1,3 +1,4 @@ -(helm-projectile :repo "bbatsov/projectile" :fetcher github :files - ("helm-projectile.el")) +(helm-projectile :repo "bbatsov/projectile" + :fetcher github + :files ("helm-projectile.el")) diff --git a/recipes/icicles b/recipes/icicles index 38dd8f71..aa45f027 100644 --- a/recipes/icicles +++ b/recipes/icicles @@ -1,3 +1,16 @@ -(icicles :fetcher wiki :files - ("icicles.el" "icicles-chg.el" "icicles-cmd1.el" "icicles-cmd2.el" "icicles-doc1.el" "icicles-doc2.el" "icicles-face.el" "icicles-fn.el" "icicles-mac.el" "icicles-mcmd.el" "icicles-mode.el" "icicles-opt.el" "icicles-var.el")) +(icicles + :fetcher wiki + :files ("icicles.el" + "icicles-chg.el" + "icicles-cmd1.el" + "icicles-cmd2.el" + "icicles-doc1.el" + "icicles-doc2.el" + "icicles-face.el" + "icicles-fn.el" + "icicles-mac.el" + "icicles-mcmd.el" + "icicles-mode.el" + "icicles-opt.el" + "icicles-var.el")) diff --git a/recipes/inflections b/recipes/inflections index 0e3b1bce..f5d5b3c7 100644 --- a/recipes/inflections +++ b/recipes/inflections @@ -1,3 +1,4 @@ -(inflections :repo "milkypostman/jump.el" :fetcher github :files - ("inflections.el")) +(inflections :repo "milkypostman/jump.el" + :fetcher github + :files ("inflections.el")) diff --git a/recipes/jabber-mode b/recipes/jabber-mode index c521bb60..eb4cb72a 100644 --- a/recipes/jabber-mode +++ b/recipes/jabber-mode @@ -1,2 +1,3 @@ -(jabber-mode :url "git://emacs-jabber.git.sourceforge.net/gitroot/emacs-jabber/emacs-jabber" - :fetcher git) \ No newline at end of file +(jabber-mode + :url "git://emacs-jabber.git.sourceforge.net/gitroot/emacs-jabber/emacs-jabber" + :fetcher git) diff --git a/recipes/load-theme-buffer-local b/recipes/load-theme-buffer-local index 4a58e546..619c93a1 100644 --- a/recipes/load-theme-buffer-local +++ b/recipes/load-theme-buffer-local @@ -1,3 +1,3 @@ (load-theme-buffer-local :fetcher github - :repo "vic/color-theme-buffer-local" - :files ("load-theme-buffer-local.el")) + :repo "vic/color-theme-buffer-local" + :files ("load-theme-buffer-local.el")) diff --git a/recipes/lua-mode b/recipes/lua-mode index 571c3d77..bb2c9e31 100644 --- a/recipes/lua-mode +++ b/recipes/lua-mode @@ -1,3 +1,3 @@ (lua-mode :repo "immerrr/lua-mode" - :fetcher github) + :fetcher github) diff --git a/recipes/markdown-mode+ b/recipes/markdown-mode+ index 72d12f6c..c03063d1 100644 --- a/recipes/markdown-mode+ +++ b/recipes/markdown-mode+ @@ -1,3 +1,5 @@ -(markdown-mode+ :repo "milkypostman/markdown-mode-plus" :fetcher github :files - ("markdown-mode+.el" "HTML as Markdown in Emacs.applescript")) +(markdown-mode+ :repo "milkypostman/markdown-mode-plus" + :fetcher github + :files ("markdown-mode+.el" + "HTML as Markdown in Emacs.applescript")) diff --git a/recipes/melpa b/recipes/melpa index bacfc1a7..5dd5534f 100644 --- a/recipes/melpa +++ b/recipes/melpa @@ -1,3 +1,4 @@ -(melpa :repo "milkypostman/melpa" :fetcher github :files - ("melpa.el")) +(melpa :repo "milkypostman/melpa" + :fetcher github + :files ("melpa.el")) diff --git a/recipes/org-toodledo b/recipes/org-toodledo index 65ba440d..2bbc294f 100644 --- a/recipes/org-toodledo +++ b/recipes/org-toodledo @@ -1,3 +1,4 @@ -(org-toodledo :repo "christopherjwhite/org-toodledo" :fetcher github :files - ("http-post-simple.el" "org-toodledo.el" "w3mexcerpt.el")) +(org-toodledo :repo "christopherjwhite/org-toodledo" + :fetcher github + :files ("http-post-simple.el" "org-toodledo.el" "w3mexcerpt.el")) diff --git a/recipes/paredit b/recipes/paredit index 25847ccb..80c941d2 100644 --- a/recipes/paredit +++ b/recipes/paredit @@ -1,3 +1,4 @@ -(paredit :url "http://mumble.net/~campbell/emacs/paredit" :fetcher darcs :files - ("paredit.el")) +(paredit :url "http://mumble.net/~campbell/emacs/paredit" + :fetcher darcs + :files ("paredit.el")) diff --git a/recipes/pkgbuild-mode b/recipes/pkgbuild-mode index d91df694..e35496ea 100644 --- a/recipes/pkgbuild-mode +++ b/recipes/pkgbuild-mode @@ -1,3 +1,4 @@ -(pkgbuild-mode :repo "juergenhoetzel/pkgbuild-mode" :fetcher github :files - ("pkgbuild-mode.el")) +(pkgbuild-mode :repo "juergenhoetzel/pkgbuild-mode" + :fetcher github + :files ("pkgbuild-mode.el")) diff --git a/recipes/pony-mode b/recipes/pony-mode index 59f0db23..b2b2b036 100644 --- a/recipes/pony-mode +++ b/recipes/pony-mode @@ -1,4 +1,4 @@ (pony-mode :repo "davidmiller/pony-mode" :fetcher github - :files ("src/*.el")) + :files ("src/*.el" "snippets")) diff --git a/recipes/popup b/recipes/popup index 9af7e322..04c63770 100644 --- a/recipes/popup +++ b/recipes/popup @@ -1,3 +1,4 @@ -(popup :repo "m2ym/popup-el" :fetcher github :files - ("popup.el")) +(popup :repo "m2ym/popup-el" + :fetcher github + :files ("popup.el")) diff --git a/recipes/projectile b/recipes/projectile index f2c29d5e..6bfd5454 100644 --- a/recipes/projectile +++ b/recipes/projectile @@ -1,3 +1,4 @@ -(projectile :repo "bbatsov/projectile" :fetcher github :files - ("projectile.el")) +(projectile :repo "bbatsov/projectile" + :fetcher github + :files ("projectile.el")) diff --git a/recipes/ruby-compilation b/recipes/ruby-compilation index ce6e96b0..9eb1ac47 100644 --- a/recipes/ruby-compilation +++ b/recipes/ruby-compilation @@ -1,3 +1,4 @@ -(ruby-compilation :repo "eschulte/rinari" :fetcher github :files - ("util/ruby-compilation.el")) +(ruby-compilation :repo "eschulte/rinari" + :fetcher github + :files ("util/ruby-compilation.el")) diff --git a/recipes/ruby-interpolation b/recipes/ruby-interpolation index e0a83496..b267cbe1 100644 --- a/recipes/ruby-interpolation +++ b/recipes/ruby-interpolation @@ -1,3 +1,3 @@ (ruby-interpolation :repo "leoc/ruby-interpolation.el" - :fetcher github) + :fetcher github) diff --git a/recipes/ruby-mode b/recipes/ruby-mode index 5c11e9cb..7a0ea746 100644 --- a/recipes/ruby-mode +++ b/recipes/ruby-mode @@ -1,3 +1,4 @@ -(ruby-mode :url "http://svn.ruby-lang.org/repos/ruby/trunk/misc" :fetcher svn :files - ("ruby-mode.el")) +(ruby-mode :url "http://svn.ruby-lang.org/repos/ruby/trunk/misc" + :fetcher svn + :files ("ruby-mode.el")) diff --git a/recipes/slime b/recipes/slime index c5aeca93..51f121cc 100644 --- a/recipes/slime +++ b/recipes/slime @@ -1,3 +1,4 @@ -(slime :repo "nablaone/slime" :fetcher github :files - ("slime.el")) +(slime :repo "nablaone/slime" + :fetcher github + :files ("slime.el")) diff --git a/recipes/slime-ritz b/recipes/slime-ritz index 0ec5170e..4b55d853 100644 --- a/recipes/slime-ritz +++ b/recipes/slime-ritz @@ -1,3 +1,4 @@ -(slime-ritz :repo "pallet/ritz" :fetcher github :files - ("src/main/elisp/slime-ritz.el")) +(slime-ritz :repo "pallet/ritz" + :fetcher github + :files ("src/main/elisp/slime-ritz.el")) diff --git a/recipes/starter-kit-bindings b/recipes/starter-kit-bindings index 2a60a963..2096e04a 100644 --- a/recipes/starter-kit-bindings +++ b/recipes/starter-kit-bindings @@ -1,3 +1,4 @@ -(starter-kit-bindings :repo "technomancy/emacs-starter-kit" :fetcher github :files - ("modules/starter-kit-bindings.el")) +(starter-kit-bindings :repo "technomancy/emacs-starter-kit" + :fetcher github + :files ("modules/starter-kit-bindings.el")) diff --git a/recipes/starter-kit-eshell b/recipes/starter-kit-eshell index a4c0824e..278fdc2e 100644 --- a/recipes/starter-kit-eshell +++ b/recipes/starter-kit-eshell @@ -1,3 +1,4 @@ -(starter-kit-eshell :repo "technomancy/emacs-starter-kit" :fetcher github :files - ("modules/starter-kit-eshell.el")) +(starter-kit-eshell :repo "technomancy/emacs-starter-kit" + :fetcher github + :files ("modules/starter-kit-eshell.el")) diff --git a/recipes/starter-kit-js b/recipes/starter-kit-js index 73fb788c..55721b13 100644 --- a/recipes/starter-kit-js +++ b/recipes/starter-kit-js @@ -1,3 +1,4 @@ -(starter-kit-js :repo "technomancy/emacs-starter-kit" :fetcher github :files - ("modules/starter-kit-js.el")) +(starter-kit-js :repo "technomancy/emacs-starter-kit" + :fetcher github + :files ("modules/starter-kit-js.el")) diff --git a/recipes/starter-kit-lisp b/recipes/starter-kit-lisp index 4dca7073..db39ae18 100644 --- a/recipes/starter-kit-lisp +++ b/recipes/starter-kit-lisp @@ -1,3 +1,4 @@ -(starter-kit-lisp :repo "technomancy/emacs-starter-kit" :fetcher github :files - ("modules/starter-kit-lisp.el")) +(starter-kit-lisp :repo "technomancy/emacs-starter-kit" + :fetcher github + :files ("modules/starter-kit-lisp.el")) diff --git a/recipes/starter-kit-perl b/recipes/starter-kit-perl index f5d0d904..3f2b934b 100644 --- a/recipes/starter-kit-perl +++ b/recipes/starter-kit-perl @@ -1,3 +1,4 @@ -(starter-kit-perl :repo "technomancy/emacs-starter-kit" :fetcher github :files - ("modules/starter-kit-perl.el")) +(starter-kit-perl :repo "technomancy/emacs-starter-kit" + :fetcher github + :files ("modules/starter-kit-perl.el")) diff --git a/recipes/starter-kit-ruby b/recipes/starter-kit-ruby index ffb347a5..b9c0a43a 100644 --- a/recipes/starter-kit-ruby +++ b/recipes/starter-kit-ruby @@ -1,3 +1,4 @@ -(starter-kit-ruby :repo "technomancy/emacs-starter-kit" :fetcher github :files - ("modules/starter-kit-ruby.el")) +(starter-kit-ruby :repo "technomancy/emacs-starter-kit" + :fetcher github + :files ("modules/starter-kit-ruby.el")) diff --git a/recipes/yari b/recipes/yari index 7e255f9b..7edebeae 100644 --- a/recipes/yari +++ b/recipes/yari @@ -1,3 +1,4 @@ -(yari :repo "hron/yari.el" :fetcher github :files - ("yari.el")) +(yari :repo "hron/yari.el" + :fetcher github + :files ("yari.el")) diff --git a/recipes/yasnippet b/recipes/yasnippet index e0b7abda..b01ed1c7 100644 --- a/recipes/yasnippet +++ b/recipes/yasnippet @@ -1,3 +1,4 @@ -(yasnippet :repo "capitaomorte/yasnippet" :fetcher github :files - ("*.el" "snippets")) +(yasnippet :repo "capitaomorte/yasnippet" + :fetcher github + :files ("*.el" "snippets")) diff --git a/recipes/zenburn-theme b/recipes/zenburn-theme index 7d930884..e6caf7fc 100644 --- a/recipes/zenburn-theme +++ b/recipes/zenburn-theme @@ -1,3 +1,4 @@ -(zenburn-theme :repo "bbatsov/zenburn-emacs" :fetcher github :files - ("zenburn-theme.el")) +(zenburn-theme :repo "bbatsov/zenburn-emacs" + :fetcher github + :files ("zenburn-theme.el")) From e6f81bf99a521dfa4b0aa686af5aebfc75640eca Mon Sep 17 00:00:00 2001 From: Donald Curtis Date: Thu, 3 May 2012 20:41:47 -0500 Subject: [PATCH 090/111] README changes for new recipe format --- README.md | 89 ++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 88 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index dbcbe6c8..e9699919 100644 --- a/README.md +++ b/README.md @@ -143,7 +143,8 @@ optional property specifying the explicit files used to build the package. Automatically populated by matching all `.el` files in the root of the repository. This is necessary when there are multiple `.el` files in the repository but the package should only be built -from a subset. +from a subset. *Any file in any path in the repository is copied to +the root of the package* [git]: http://git-scm.com/ [github]: https://github.com/ @@ -193,6 +194,92 @@ contained in the `modules/` subdirectory and thus needs the packages files specified explicitly. +### Multiple Files in Multiple Directories + +There are special cases when we need +There are special cases where creation of the package comes from many +different sub-directories in the repository and the destination +sub-directories need to be explicitly set. + +Consider the `flymake-perlcritic` recipe, + +```elisp +(flymake-perlcritic :repo "illusori/emacs-flymake-perlcritic" + :fetcher github + :files ("*.el" ("bin" "bin/flymake_perlcritic"))) +``` + +which will result in a package structure of, + +``` +flymake-perlcritic-YYYMMDD +|-- bin +| `-- flymake_perlcritic +|-- flymake-perlcritic-pkg.el +`-- flymake-perlcritic.el +``` + +Notice that specifying an entry in `:files` that is a list takes the +first element to be the destination directory. These can be embedded +further, such as the following---hypothetical---entry for `:files`, + +```elisp +("*.el" ("snippets" + ("html-mode" "snippets/html-mode/*") + ("python-mode" "snippets/python-mode/*"))) +``` + +which would result in a package with `*.el` in something like, + +``` +package-YYYYMMDD +|-- snippets +| |-- html-mode +| | |-- div +| | `-- html +| `-- python-mode +| |-- for +| `-- main +`-- package.el +``` + +But a better solution, given that we probably want to copy the +*entire* `snippets` directory to the root of the package, we could +just specify that directory. Consider the `pony-mode` recipe, + +```elisp +(pony-mode + :repo "davidmiller/pony-mode" + :fetcher github + :files ("src/*.el" "snippets")) +``` + +which generates the package, + +``` +pony-mode-YYYYMMDD +|-- pony-mode-pkg.el +|-- pony-mode.el +|-- pony-tpl.el +`-- snippets + |-- html-mode + | |-- bl + | |-- ex + | |-- for + | |-- if + | |-- loa + | |-- sup + | |-- testc + | `-- {{ + `-- python-mode + |-- auth-view + |-- bn + |-- model + |-- modelform + |-- render-to + |-- testc + `-- view +``` ## Build Scripts From 65aaef511a77986b8a616eb381750ad6c509f122 Mon Sep 17 00:00:00 2001 From: Donald Curtis Date: Thu, 3 May 2012 20:44:17 -0500 Subject: [PATCH 091/111] use "source" and "target" consistently --- package-build.el | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/package-build.el b/package-build.el index 3c57675e..3f08a138 100644 --- a/package-build.el +++ b/package-build.el @@ -542,18 +542,18 @@ TARGET-SUBDIR is a directory relative to TARGET." ((not version) (message "Unable to check out repository for %s" name)) ((= 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)) + (let* ((pkg-source (expand-file-name (car files) pkg-cwd)) + (pkg-target (expand-file-name + (concat file-name "-" version ".el") + package-build-archive-dir)) (pkg-info (pb/merge-package-info - (pb/get-package-info pkgsrc) + (pb/get-package-info pkg-source) file-name version cfg))) - (when (file-exists-p pkgdst) - (delete-file pkgdst t)) - (copy-file pkgsrc pkgdst) + (when (file-exists-p pkg-target) + (delete-file pkg-target t)) + (copy-file pkg-source pkg-target) (pb/add-to-archive-contents pkg-info 'single))) ((< 1 (length files)) (let* ((pkg-files (pb/target-file-list files)) @@ -582,8 +582,8 @@ TARGET-SUBDIR is a directory relative to TARGET." package-build-working-dir))) pkg-info) - (when files - (add-to-list 'pkg-files pkg-file)) + (print pkg-files) + (add-to-list 'pkg-files pkg-file) (pb/create-tar (expand-file-name @@ -593,6 +593,7 @@ TARGET-SUBDIR is a directory relative to TARGET." (delete-directory pkg-dir t nil) (pb/add-to-archive-contents pkg-info 'tar))) + (t (error "Unable to find files matching recipe patterns"))) (pb/dump-archive-contents) file-name))) From 2f7bfdd9d04fe593c72f132912b124fe2e91390c Mon Sep 17 00:00:00 2001 From: Donald Curtis Date: Thu, 3 May 2012 20:43:11 -0500 Subject: [PATCH 092/111] use `;;;` to denote package name --- package-build.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package-build.el b/package-build.el index 3f08a138..0eb5b9c4 100644 --- a/package-build.el +++ b/package-build.el @@ -534,7 +534,7 @@ TARGET-SUBDIR is a directory relative to TARGET." (file-name-as-directory (expand-file-name file-name package-build-working-dir)))) - (message (format "\n%s\n" file-name)) + (message (format "\n;;; %s\n" file-name)) (let* ((version (pb/checkout name cfg pkg-cwd)) (files (pb/expand-config-file-list pkg-cwd cfg)) (default-directory package-build-working-dir)) From e54824d6c3a3ad3c6c0326e85fe92c40e526ce71 Mon Sep 17 00:00:00 2001 From: Donald Curtis Date: Thu, 3 May 2012 20:44:46 -0500 Subject: [PATCH 093/111] Dump error backtrace to stderr while ignoring errors. --- package-build.el | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/package-build.el b/package-build.el index 0eb5b9c4..49382c91 100644 --- a/package-build.el +++ b/package-build.el @@ -601,7 +601,19 @@ TARGET-SUBDIR is a directory relative to TARGET." (defun package-build-archive-ignore-errors (pkg) "Build archive for package PKG, ignoring any errors." (interactive) - (ignore-errors (package-build-archive pkg))) + (let ((debug-on-error t) + (debug-on-signal t) + (pb/debugger-return nil) + (debugger (lambda (&rest args) + (setq pb/debugger-return (with-output-to-string + (backtrace)))))) + (condition-case err + (package-build-archive pkg) + ('error + (message "%s" (error-message-string err)) + (message "%s" (mapconcat + 'identity + (nthcdr 8 (split-string pb/debugger-return "\n")) "\n")))))) (defun package-build-all () "Build all packages in the `package-build-alist'." From 203315d8cd76e8780d877f05c1361230c3e4cbe9 Mon Sep 17 00:00:00 2001 From: Donald Curtis Date: Thu, 3 May 2012 21:03:10 -0500 Subject: [PATCH 094/111] Clean out debugging code. Add others. --- package-build.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package-build.el b/package-build.el index 49382c91..b7e3e1ff 100644 --- a/package-build.el +++ b/package-build.el @@ -517,8 +517,10 @@ TARGET-SUBDIR is a directory relative to TARGET." (make-directory newdir t))) (cond ((file-regular-p file) + (message "%s -> %s" file newname) (copy-file file newname)) ((file-directory-p file) + (message "%s => %s" file newname) (copy-directory file newname)))) @@ -582,7 +584,6 @@ TARGET-SUBDIR is a directory relative to TARGET." package-build-working-dir))) pkg-info) - (print pkg-files) (add-to-list 'pkg-files pkg-file) (pb/create-tar From 000bffabf677cb1da0e6d3f9f34bbcc76f9f3727 Mon Sep 17 00:00:00 2001 From: Donald Curtis Date: Thu, 3 May 2012 21:04:06 -0500 Subject: [PATCH 095/111] On error return nil --- package-build.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package-build.el b/package-build.el index b7e3e1ff..05782343 100644 --- a/package-build.el +++ b/package-build.el @@ -614,7 +614,8 @@ TARGET-SUBDIR is a directory relative to TARGET." (message "%s" (error-message-string err)) (message "%s" (mapconcat 'identity - (nthcdr 8 (split-string pb/debugger-return "\n")) "\n")))))) + (nthcdr 8 (split-string pb/debugger-return "\n")) "\n")) + nil)))) (defun package-build-all () "Build all packages in the `package-build-alist'." From dbfefe681b1141359c591a9b0f7281defd39804a Mon Sep 17 00:00:00 2001 From: Donald Curtis Date: Thu, 3 May 2012 21:39:23 -0500 Subject: [PATCH 096/111] add tango-2-theme recipe --- recipes/tango-2-theme | 1 + 1 file changed, 1 insertion(+) create mode 100644 recipes/tango-2-theme diff --git a/recipes/tango-2-theme b/recipes/tango-2-theme new file mode 100644 index 00000000..c7ece185 --- /dev/null +++ b/recipes/tango-2-theme @@ -0,0 +1 @@ +(tango-2-theme :repo "2024464" :fetcher github) From 5292ee7ff864aee42f1cb0ebf402031713dd01c9 Mon Sep 17 00:00:00 2001 From: Donald Curtis Date: Thu, 3 May 2012 21:51:16 -0500 Subject: [PATCH 097/111] Adding zf-mode recipe. Closes #86 --- recipes/zf-mode | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 recipes/zf-mode diff --git a/recipes/zf-mode b/recipes/zf-mode new file mode 100644 index 00000000..2da2bb14 --- /dev/null +++ b/recipes/zf-mode @@ -0,0 +1,4 @@ +(zf-mode + :fetcher github + :repo "echosa/zf-mode" + :files ("*.el" "ZFMode" "bundled")) From f17809801c5ccce3e335ed5d8e7dc667539e6b9f Mon Sep 17 00:00:00 2001 From: Steve Purcell Date: Fri, 4 May 2012 20:33:25 +0100 Subject: [PATCH 098/111] Fix compilation warnings about references to free variables --- package-build.el | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/package-build.el b/package-build.el index 05782343..e2a27401 100644 --- a/package-build.el +++ b/package-build.el @@ -483,7 +483,7 @@ of the same-named package which is to be kept." (defun pb/expand-config-file-list (dir config) "In DIR, expand the :files for CONFIG and flatten the list." - (pb/expand-file-list dir (or (plist-get cfg :files) (list "*.el")))) + (pb/expand-file-list dir (or (plist-get config :files) (list "*.el")))) (defun pb/expand-file-list (dir wildcards) "In DIR, expand WILDCARDS, some of which may be shell-style wildcards." @@ -602,12 +602,12 @@ TARGET-SUBDIR is a directory relative to TARGET." (defun package-build-archive-ignore-errors (pkg) "Build archive for package PKG, ignoring any errors." (interactive) - (let ((debug-on-error t) - (debug-on-signal t) - (pb/debugger-return nil) - (debugger (lambda (&rest args) - (setq pb/debugger-return (with-output-to-string - (backtrace)))))) + (let* ((debug-on-error t) + (debug-on-signal t) + (pb/debugger-return nil) + (debugger (lambda (&rest args) + (setq pb/debugger-return (with-output-to-string + (backtrace)))))) (condition-case err (package-build-archive pkg) ('error From 8e8696fa14ffa5748df1e8b44d97e91f3bf23ac4 Mon Sep 17 00:00:00 2001 From: Steve Purcell Date: Fri, 4 May 2012 20:34:28 +0100 Subject: [PATCH 099/111] Use idiomatic "not" in place of "(zerop (length lst))" --- package-build.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package-build.el b/package-build.el index e2a27401..ba1205bf 100644 --- a/package-build.el +++ b/package-build.el @@ -623,7 +623,7 @@ TARGET-SUBDIR is a directory relative to TARGET." (let ((failed (loop for pkg in (mapcar 'car package-build-alist) when (not (package-build-archive-ignore-errors pkg)) collect pkg))) - (if (zerop (length failed)) + (if (not failed) (princ "\nSuccessfully Compiled All Packages\n") (princ "\nFailed to Build the Following Packages\n") (princ (mapconcat 'symbol-name failed "\n")))) From d23d831e30623dca2b4016a5e0468ac44c73c69b Mon Sep 17 00:00:00 2001 From: Steve Purcell Date: Sat, 5 May 2012 08:32:24 +0100 Subject: [PATCH 100/111] Stop recipes dir-locals from breaking dired (fixes #103) --- recipes/.dir-locals.el | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/recipes/.dir-locals.el b/recipes/.dir-locals.el index fa944367..38e1fd1a 100644 --- a/recipes/.dir-locals.el +++ b/recipes/.dir-locals.el @@ -1 +1,4 @@ -((nil . ((eval . (emacs-lisp-mode))))) +((nil . ((eval . (when (and (buffer-file-name) + (file-regular-p (buffer-file-name)) + (string-match-p "^[^.]" (buffer-file-name))) + (emacs-lisp-mode)))))) From c269f0ef82e8e69394e2eb984de86047ab43352f Mon Sep 17 00:00:00 2001 From: Steve Purcell Date: Sat, 5 May 2012 08:46:31 +0100 Subject: [PATCH 101/111] Remove some duplication by introducing pb/expand-source-file-list --- package-build.el | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/package-build.el b/package-build.el index ba1205bf..1052b6bc 100644 --- a/package-build.el +++ b/package-build.el @@ -195,7 +195,7 @@ seconds; the server cuts off after 10 requests in 20 seconds.") (pb/princ-checkout repo dir) (pb/run-process nil "darcs" "get" repo dir))) (apply 'pb/run-process dir "darcs" "changes" "--max-count" "1" - (pb/source-file-list (pb/expand-config-file-list dir config))) + (pb/expand-source-file-list dir config)) (pb/find-parse-time "\\([a-zA-Z]\\{3\\} [a-zA-Z]\\{3\\} \\( \\|[0-9]\\)[0-9] [0-9]\\{2\\}:[0-9]\\{2\\}:[0-9]\\{2\\} [A-Za-z]\\{3\\} [0-9]\\{4\\}\\)")))) @@ -233,7 +233,7 @@ seconds; the server cuts off after 10 requests in 20 seconds.") (pb/princ-checkout repo dir) (pb/run-process nil "svn" "checkout" repo dir))) (apply 'pb/run-process dir "svn" "info" - (pb/source-file-list (pb/expand-config-file-list dir config))) + (pb/expand-source-file-list dir config)) (or (pb/find-parse-time-latest "Last Changed Date: \\([0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\} [0-9]\\{2\\}:[0-9]\\{2\\}:[0-9]\\{2\\}\\)" bound) (error "No valid timestamps found!"))))) @@ -261,7 +261,7 @@ seconds; the server cuts off after 10 requests in 20 seconds.") (when commit (pb/run-process dir "git" "checkout" commit)) (apply 'pb/run-process dir "git" "log" "-n1" "--pretty=format:'\%ci'" - (pb/source-file-list (pb/expand-config-file-list dir config))) + (pb/expand-source-file-list dir config)) (pb/find-parse-time "\\([0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\} [0-9]\\{2\\}:[0-9]\\{2\\}:[0-9]\\{2\\}\\)")))) @@ -294,7 +294,7 @@ seconds; the server cuts off after 10 requests in 20 seconds.") (pb/princ-checkout repo dir) (pb/run-process nil "bzr" "branch" repo dir))) (apply 'pb/run-process dir "bzr" "log" "-l1" - (pb/source-file-list (pb/expand-config-file-list dir config))) + (pb/expand-source-file-list dir config)) (pb/find-parse-time "\\([0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\} [0-9]\\{2\\}:[0-9]\\{2\\}:[0-9]\\{2\\}\\)")))) @@ -319,7 +319,7 @@ seconds; the server cuts off after 10 requests in 20 seconds.") (pb/princ-checkout repo dir) (pb/run-process nil "hg" "clone" repo dir))) (apply 'pb/run-process dir "hg" "log" "--style" "compact" "-l1" - (pb/source-file-list (pb/expand-config-file-list dir config))) + (pb/expand-source-file-list dir config)) (pb/find-parse-time "\\([0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\} [0-9]\\{2\\}:[0-9]\\{2\\}\\)")))) @@ -494,6 +494,9 @@ of the same-named package which is to be kept." (file-expand-wildcards wc))) wildcards))) +(defun pb/expand-source-file-list (dir config) + "Shorthand way to expand paths in DIR for files listed in CONFIG." + (pb/source-file-list (pb/expand-config-file-list dir config))) (defun pb/copy-package-files (files source target) "Copy FILES from the SOURCE directory to TARGET directory. From 5dafae1ef1f40f58a3fb1953f4690ede7c7cd123 Mon Sep 17 00:00:00 2001 From: Marian Schubert Date: Sat, 5 May 2012 12:07:44 +0200 Subject: [PATCH 102/111] Add recipe for helm-git --- recipes/helm-git | 1 + 1 file changed, 1 insertion(+) create mode 100644 recipes/helm-git diff --git a/recipes/helm-git b/recipes/helm-git new file mode 100644 index 00000000..84f6e34b --- /dev/null +++ b/recipes/helm-git @@ -0,0 +1 @@ +(helm-git :repo "maio/helm-git" :fetcher github) From 096c549c163961d73205a43963baaffcf5cb0d46 Mon Sep 17 00:00:00 2001 From: sindikat Date: Sat, 5 May 2012 18:54:43 +0600 Subject: [PATCH 103/111] added outline-magic.el --- recipes/outline-magic | 1 + 1 file changed, 1 insertion(+) create mode 100644 recipes/outline-magic diff --git a/recipes/outline-magic b/recipes/outline-magic new file mode 100644 index 00000000..f8441e55 --- /dev/null +++ b/recipes/outline-magic @@ -0,0 +1 @@ +(outline-magic :fetcher wiki) From f4540078c539d73d5f7ba8386879eebb857db00a Mon Sep 17 00:00:00 2001 From: sindikat Date: Sat, 5 May 2012 19:25:18 +0600 Subject: [PATCH 104/111] python-magic --- recipes/python-magic | 1 + 1 file changed, 1 insertion(+) create mode 100644 recipes/python-magic diff --git a/recipes/python-magic b/recipes/python-magic new file mode 100644 index 00000000..2dbb48f3 --- /dev/null +++ b/recipes/python-magic @@ -0,0 +1 @@ +(python-magic :fetcher wiki) \ No newline at end of file From bd6ce27c31a1c73d6ee1f6b22147eda8c6b34243 Mon Sep 17 00:00:00 2001 From: Sarah Iovan Date: Fri, 4 May 2012 18:27:12 -0500 Subject: [PATCH 105/111] added emacs24-inkpot color theme Closes #102 Signed-off-by: Donald Curtis --- recipes/inkpot-theme | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 recipes/inkpot-theme diff --git a/recipes/inkpot-theme b/recipes/inkpot-theme new file mode 100644 index 00000000..6aa48dcf --- /dev/null +++ b/recipes/inkpot-theme @@ -0,0 +1,3 @@ +(inkpot-theme + :repo "siovan/emacs24-inkpot" + :fetcher github) From c9220870edc65d2d05c19757e8e92627aca03bff Mon Sep 17 00:00:00 2001 From: Steve Purcell Date: Sat, 5 May 2012 08:53:48 +0100 Subject: [PATCH 106/111] Normalise the file-list functions so they can be assessed for similarities --- package-build.el | 36 +++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/package-build.el b/package-build.el index 1052b6bc..d7a2eaa4 100644 --- a/package-build.el +++ b/package-build.el @@ -468,31 +468,33 @@ of the same-named package which is to be kept." (defun pb/source-file-list (files) "Generate a flat source file listing from FILES." - (mapcan (lambda (fn) (if (consp fn) - (pb/source-file-list (cdr fn)) - (list fn))) files)) + (mapcan (lambda (entry) + (if (consp entry) + (pb/source-file-list (cdr entry)) + (list entry))) + files)) (defun pb/target-file-list (files) "Generate a flat target file listing from FILES." - (loop for fn in files - nconc (if (consp fn) - (loop for res in (pb/target-file-list (cdr fn)) - collect (concat (car fn) "/" res)) - (list (file-name-nondirectory fn))))) - + (mapcan (lambda (entry) + (if (consp entry) + (loop for res in (pb/target-file-list (cdr entry)) + collect (concat (car entry) "/" res)) + (list (file-name-nondirectory entry)))) + files)) (defun pb/expand-config-file-list (dir config) "In DIR, expand the :files for CONFIG and flatten the list." (pb/expand-file-list dir (or (plist-get config :files) (list "*.el")))) -(defun pb/expand-file-list (dir wildcards) - "In DIR, expand WILDCARDS, some of which may be shell-style wildcards." - (let ((default-directory dir)) - (mapcan (lambda (wc) - (if (consp wc) - (list (cons (car wc) (pb/expand-file-list dir (cdr wc)))) - (file-expand-wildcards wc))) - wildcards))) +(defun pb/expand-file-list (dir files) + "In DIR, expand FILES, some of which may be shell-style wildcards." + (mapcan (lambda (entry) + (if (consp entry) + (list (cons (car entry) (pb/expand-file-list dir (cdr entry)))) + (let ((default-directory dir)) + (file-expand-wildcards entry)))) + files)) (defun pb/expand-source-file-list (dir config) "Shorthand way to expand paths in DIR for files listed in CONFIG." From 8be7c714c7ddc9212cd6c943d1da8023bfe6cd8b Mon Sep 17 00:00:00 2001 From: Steve Purcell Date: Sun, 6 May 2012 09:38:43 +0100 Subject: [PATCH 107/111] Simplify the functions dealing with source/dest file paths (see #97) This commit introduces pb/expand-file-specs, which expands a :files list into a list of (SOURCE . DEST) pairs -- SOURCE is the relative path of a source file or directory, and DEST is the relative path to which it should be copied. By mapcar'ing this list, it's then easy to get lists of the source and destination files, and copying files becomes as easy as copying each SOURCE to its corresponding DEST. --- package-build.el | 85 ++++++++++++++++++++---------------------------- 1 file changed, 36 insertions(+), 49 deletions(-) diff --git a/package-build.el b/package-build.el index d7a2eaa4..15564e14 100644 --- a/package-build.el +++ b/package-build.el @@ -466,54 +466,43 @@ of the same-named package which is to be kept." (directory-files package-build-recipes-dir t "^[^.]"))) -(defun pb/source-file-list (files) - "Generate a flat source file listing from FILES." - (mapcan (lambda (entry) - (if (consp entry) - (pb/source-file-list (cdr entry)) - (list entry))) - files)) - -(defun pb/target-file-list (files) - "Generate a flat target file listing from FILES." - (mapcan (lambda (entry) - (if (consp entry) - (loop for res in (pb/target-file-list (cdr entry)) - collect (concat (car entry) "/" res)) - (list (file-name-nondirectory entry)))) - files)) +(defun pb/expand-file-specs (dir specs &optional subdir) + "In DIR, expand SPECS, optionally under SUBDIR. +The result is a list of (SOURCE . DEST), where SOURCE is a source +file path and DEST is the relative path to which it should be copied." + (let ((default-directory dir) + (prefix (if subdir + (format "%s/" subdir) + ""))) + (mapcan + (lambda (entry) + (if (consp entry) + (pb/expand-file-specs dir + (cdr entry) + (concat prefix (car entry))) + (mapcar (lambda (f) + (cons f (concat prefix (file-name-nondirectory f)))) + (or (file-expand-wildcards entry) + (error "No matching file(s) found in %s: %s" + dir + entry))))) + specs))) (defun pb/expand-config-file-list (dir config) - "In DIR, expand the :files for CONFIG and flatten the list." - (pb/expand-file-list dir (or (plist-get config :files) (list "*.el")))) - -(defun pb/expand-file-list (dir files) - "In DIR, expand FILES, some of which may be shell-style wildcards." - (mapcan (lambda (entry) - (if (consp entry) - (list (cons (car entry) (pb/expand-file-list dir (cdr entry)))) - (let ((default-directory dir)) - (file-expand-wildcards entry)))) - files)) + "In DIR, expand the :files for CONFIG using 'pb/expand-file-specs." + (pb/expand-file-specs dir (or (plist-get config :files) (list "*.el")))) (defun pb/expand-source-file-list (dir config) - "Shorthand way to expand paths in DIR for files listed in CONFIG." - (pb/source-file-list (pb/expand-config-file-list dir config))) + "Shorthand way to expand paths in DIR for source files listed in CONFIG." + (mapcar 'car (pb/expand-config-file-list dir config))) -(defun pb/copy-package-files (files source target) - "Copy FILES from the SOURCE directory to TARGET directory. -FILES is in the form (FILE-OR-CONS ...). - -FILE-OR-CONS is either a path relative to SOURCE or -a cons of the form (TARGET-SUBDIR FILE-OR-CONS). - -TARGET-SUBDIR is a directory relative to TARGET." - (loop for fn in files - if (consp fn) do (pb/copy-package-files (cdr fn) - source (expand-file-name (car fn) target)) - else do (pb/copy-file - (expand-file-name fn source) - (expand-file-name (file-name-nondirectory fn) target)))) +(defun pb/copy-package-files (files source-dir target-dir) + "Copy FILES from SOURCE-DIR to TARGET-DIR. +FILES is a list of (SOURCE . DEST) relative filepath pairs." + (loop for (source-file . dest-file) in files + do (pb/copy-file + (expand-file-name source-file source-dir) + (expand-file-name dest-file target-dir)))) (defun pb/copy-file (file newname) "Copy FILE to NEWNAME and create parent directories for NEWNAME if they don't exist." @@ -549,7 +538,7 @@ TARGET-SUBDIR is a directory relative to TARGET." ((not version) (message "Unable to check out repository for %s" name)) ((= 1 (length files)) - (let* ((pkg-source (expand-file-name (car files) pkg-cwd)) + (let* ((pkg-source (expand-file-name (caar files) pkg-cwd)) (pkg-target (expand-file-name (concat file-name "-" version ".el") package-build-archive-dir)) @@ -563,8 +552,8 @@ TARGET-SUBDIR is a directory relative to TARGET." (copy-file pkg-source pkg-target) (pb/add-to-archive-contents pkg-info 'single))) ((< 1 (length files)) - (let* ((pkg-files (pb/target-file-list files)) - (pkg-dir (concat file-name "-" version)) + (let* ((pkg-dir (concat file-name "-" version)) + ;; TODO: What if the upstream "-pkg.el" file is in a subdir? (pkg-file (concat file-name "-pkg.el")) (pkg-info (pb/merge-package-info @@ -589,13 +578,11 @@ TARGET-SUBDIR is a directory relative to TARGET." package-build-working-dir))) pkg-info) - (add-to-list 'pkg-files pkg-file) - (pb/create-tar (expand-file-name (concat file-name "-" version ".tar") package-build-archive-dir) pkg-dir - pkg-files) + (append (mapcar 'cdr files) (list pkg-file))) (delete-directory pkg-dir t nil) (pb/add-to-archive-contents pkg-info 'tar))) From f421778f5fef4f41feaca52c1d09ba28350d302d Mon Sep 17 00:00:00 2001 From: Steve Purcell Date: Sun, 6 May 2012 11:52:49 +0100 Subject: [PATCH 108/111] Fix broken autopair recipe, which referred to a missing autopair-pkg.el file --- recipes/autopair | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/autopair b/recipes/autopair index 4a6e3078..5493cefe 100644 --- a/recipes/autopair +++ b/recipes/autopair @@ -1,4 +1,4 @@ (autopair :fetcher svn :url "http://autopair.googlecode.com/svn/trunk/" - :files ("autopair-pkg.el" "autopair.el")) + :files ("autopair.el")) From 83265caeb7248f251e792d249bfce7a46a64ed36 Mon Sep 17 00:00:00 2001 From: Steve Purcell Date: Sun, 6 May 2012 11:55:06 +0100 Subject: [PATCH 109/111] Print timestamps when starting to build packages (convenient when viewing build output) --- melpa | 3 +++ 1 file changed, 3 insertions(+) diff --git a/melpa b/melpa index 8c194148..bfc4b144 100755 --- a/melpa +++ b/melpa @@ -7,6 +7,7 @@ cd ${BASEDIR} || exit 1 function melpa_clear_packages { echo "*** Clearing the packages folder..." + date rm -rf packages/* echo } @@ -14,12 +15,14 @@ function melpa_clear_packages { function melpa_build_pkglist { echo "*** Building all packages..." + date emacs --batch -l package-build.el --eval "(package-build-all)" echo } function melpa_generate_html { echo "*** Building html..." + date cd html || return 1 erb index.erb > index.md pandoc --template=template.html --css=style.css -s --mathml -t html --smart index.md > index.html From 73cd32ccae745c55090be720f2ca355911215d27 Mon Sep 17 00:00:00 2001 From: Steve Purcell Date: Sun, 6 May 2012 12:13:12 +0100 Subject: [PATCH 110/111] Make 'package-build-archive-ignore-errors prompt for package name when called interactively --- package-build.el | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/package-build.el b/package-build.el index 15564e14..9665b453 100644 --- a/package-build.el +++ b/package-build.el @@ -518,11 +518,14 @@ FILES is a list of (SOURCE . DEST) relative filepath pairs." (copy-directory file newname)))) +(defun pb/package-name-completing-read () + "Prompt for a package name, returning a symbol." + (intern (completing-read "Package: " package-build-alist))) + ;;; Public interface (defun package-build-archive (name) "Build a package archive for package NAME." - (interactive (list (intern (completing-read "Package: " - package-build-alist)))) + (interactive (list (pb/package-name-completing-read))) (let* ((file-name (symbol-name name)) (cfg (or (cdr (assoc name package-build-alist)) (error "Cannot find package %s" file-name))) @@ -593,7 +596,7 @@ FILES is a list of (SOURCE . DEST) relative filepath pairs." (defun package-build-archive-ignore-errors (pkg) "Build archive for package PKG, ignoring any errors." - (interactive) + (interactive (list (pb/package-name-completing-read))) (let* ((debug-on-error t) (debug-on-signal t) (pb/debugger-return nil) From e456ea3cbfac96ea5e5ae876f006d7f1161c11cf Mon Sep 17 00:00:00 2001 From: Donald Curtis Date: Sun, 6 May 2012 08:21:44 -0500 Subject: [PATCH 111/111] Hotfix to let build continue after error. --- package-build.el | 3 --- 1 file changed, 3 deletions(-) diff --git a/package-build.el b/package-build.el index 9665b453..6e192969 100644 --- a/package-build.el +++ b/package-build.el @@ -607,9 +607,6 @@ FILES is a list of (SOURCE . DEST) relative filepath pairs." (package-build-archive pkg) ('error (message "%s" (error-message-string err)) - (message "%s" (mapconcat - 'identity - (nthcdr 8 (split-string pb/debugger-return "\n")) "\n")) nil)))) (defun package-build-all ()