[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] scratch/install-package-from-directory 7224ac1 2/4: emacs-
From: |
Artur Malabarba |
Subject: |
[Emacs-diffs] scratch/install-package-from-directory 7224ac1 2/4: emacs-lisp/package.el and package-x.el: References to package-desc-kind |
Date: |
Wed, 14 Jan 2015 15:21:07 +0000 |
branch: scratch/install-package-from-directory
commit 7224ac1ed8898d291230b787dea6f8fb2d87f8ee
Author: Artur Malabarba <address@hidden>
Commit: Artur Malabarba <address@hidden>
emacs-lisp/package.el and package-x.el: References to package-desc-kind
---
lisp/ChangeLog | 7 +++++++
lisp/emacs-lisp/package-x.el | 4 ++++
lisp/emacs-lisp/package.el | 4 ++++
3 files changed, 15 insertions(+), 0 deletions(-)
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 13081c3..72d031c 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,10 @@
+2015-01-14 Artur Malabarba <address@hidden>
+
+ * emacs-lisp/package-x.el (package-upload-buffer-internal):
+ * emacs-lisp/package.el (package-desc-suffix)
+ (package-install-from-archive): Ensure all remaining instances of
+ `package-desc-kind' handle the 'dir value.
+
2015-01-13 Artur Malabarba <address@hidden>
* emacs-lisp/package.el (package--read-pkg-desc): New
diff --git a/lisp/emacs-lisp/package-x.el b/lisp/emacs-lisp/package-x.el
index f2bcdad..e0945d4 100644
--- a/lisp/emacs-lisp/package-x.el
+++ b/lisp/emacs-lisp/package-x.el
@@ -207,6 +207,10 @@ if it exists."
(pkg-version (package-version-join split-version))
(pkg-buffer (current-buffer)))
+ ;; `package-upload-file' will error if given a directory,
+ ;; but we check it here as well just in case.
+ (when (eq 'dir file-type)
+ (user-error "Can't upload directory, tar it instead"))
;; Get archive-contents from ARCHIVE-URL if it's non-nil, or
;; from `package-archive-upload-base' otherwise.
(let ((contents (or (package--archive-contents-from-url archive-url)
diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el
index 696b230..dcb63a3 100644
--- a/lisp/emacs-lisp/package.el
+++ b/lisp/emacs-lisp/package.el
@@ -397,6 +397,7 @@ Slots:
(pcase (package-desc-kind pkg-desc)
(`single ".el")
(`tar ".tar")
+ (`dir "")
(kind (error "Unknown package kind: %s" kind))))
(defun package-desc--keywords (pkg-desc)
@@ -917,6 +918,9 @@ GnuPG keyring is located under \"gnupg\" in
`package-user-dir'."
(defun package-install-from-archive (pkg-desc)
"Download and install a tar package."
+ ;; This won't happen, unless the archive is doing something wrong.
+ (when (eq (package-desc-kind pkg-desc) 'dir)
+ (error "Can't install directory package from archive"))
(let* ((location (package-archive-base pkg-desc))
(file (concat (package-desc-full-name pkg-desc)
(package-desc-suffix pkg-desc)))