emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master a2cd6d9 6/6: emacs-lisp/package.el and package-x.el


From: Artur Malabarba
Subject: [Emacs-diffs] master a2cd6d9 6/6: emacs-lisp/package.el and package-x.el: References to package-desc-kind
Date: Sat, 17 Jan 2015 00:26:44 +0000

branch: master
commit a2cd6d90d20408a6265c8615697dbff94df3f098
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               |    5 +++++
 lisp/emacs-lisp/package-x.el |    4 ++++
 lisp/emacs-lisp/package.el   |    4 ++++
 3 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index b69df34..f78714b 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -7,6 +7,11 @@
        directory. The return result is a `package-desc'.
        (package-install-from-buffer): Install packages from dired buffer.
        (package-install-file): Install packages from directory.
+       (package-desc-suffix)
+       (package-install-from-archive)
+       * emacs-lisp/package-x.el (package-upload-buffer-internal): Ensure
+       all remaining instances of `package-desc-kind' handle the 'dir
+       value.
 
 2015-01-16  Jorgen Schaefer  <address@hidden>
 
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 f585c0b..08031c8 100644
--- a/lisp/emacs-lisp/package.el
+++ b/lisp/emacs-lisp/package.el
@@ -413,6 +413,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)
@@ -939,6 +940,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)))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]