summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2015-12-17 11:45:04 -0700
committerDavid Bremner <bremner@debian.org>2016-01-03 19:19:13 -0400
commit0005243731ed9a4da4e8ebedc4daa1a7e0a0589a (patch)
tree5d972994d08967346662359e431b73c2992a1693
parent18cd13596e560a06ccb3a6f808f83d12106fe1f9 (diff)
dhelpa-debianise-deps filters out non-elpa deps
-rw-r--r--dh-elpa.el21
1 files changed, 15 insertions, 6 deletions
diff --git a/dh-elpa.el b/dh-elpa.el
index 84cb3fe..564c9fb 100644
--- a/dh-elpa.el
+++ b/dh-elpa.el
@@ -25,6 +25,7 @@
;; along with dh-elpa. If not, see <http://www.gnu.org/licenses/>.
(require 'package)
+(require 'cl-lib)
;; Originally package-unpack from package.el in Emacs 24.5
(defun dhelpa-unpack (pkg-desc destdir &optional epoch-time)
@@ -61,12 +62,20 @@ current time is used."
(defun dhelpa-debianise-deps (deps)
"Convert a list of package.el deps DEPS to debian/control format."
- (mapconcat
- (lambda (dep)
- (let ((pkg-name (format "elpa-%s" (car dep)))
- (pkg-ver (mapconcat 'number-to-string (car (cdr dep)) ".")))
- (concat pkg-name " (>= " pkg-ver ")")))
- deps ", "))
+ ;; `non-elpa' is a list of libraries that are packaged in Debian
+ ;; outside the elpa-* namespace, plus Emacs itself
+ (let* ((non-elpa (list 'emacs 's 'dash))
+ (filtered-deps (cl-remove-if
+ (lambda (dep)
+ (or (memq (car dep) non-elpa)
+ (package-built-in-p (car dep))))
+ deps)))
+ (mapconcat
+ (lambda (dep)
+ (let ((pkg-name (format "elpa-%s" (car dep)))
+ (pkg-ver (mapconcat 'number-to-string (car (cdr dep)) ".")))
+ (concat pkg-name " (>= " pkg-ver ")")))
+ filtered-deps ", ")))
;; Write out (partial) package description in a form easily parsed by
;; non-lisp tools.