]> git.eshelyaron.com Git - emacs.git/commitdiff
emacs-lisp/package.el and package-x.el: References to package-desc-kind
authorArtur Malabarba <bruce.connor.am@gmail.com>
Wed, 14 Jan 2015 14:57:32 +0000 (12:57 -0200)
committerArtur Malabarba <bruce.connor.am@gmail.com>
Sat, 17 Jan 2015 00:21:12 +0000 (22:21 -0200)
lisp/ChangeLog
lisp/emacs-lisp/package-x.el
lisp/emacs-lisp/package.el

index b69df34e673e78af2304cd03836ad4d5fb5b1df9..f78714b32172633dedf4fdc4c47fd6034898be77 100644 (file)
@@ -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  <contact@jorgenschaefer.de>
 
index f2bcdad172065664bc3397eeceb6ac82ca3db3c5..e0945d47a4573203d089a6509e455fd7a49ed3ed 100644 (file)
@@ -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)
index f585c0be47a6acf8035e79f7af9743ff27a7ecfc..08031c846cf6f09b3d1eefdae611051f8fac1ba7 100644 (file)
@@ -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)))