GNU bug report logs - #16762
Installed packages are not considered part of the archive contents

Previous Next

Package: emacs;

Reported by: Johan Andersson <johan.rejeep <at> gmail.com>

Date: Sat, 15 Feb 2014 16:07:02 UTC

Severity: normal

Fixed in version 24.4

Done: Dmitry Gutov <dgutov <at> yandex.ru>

Bug is archived. No further changes may be made.

Full log


Message #20 received at 16762 <at> debbugs.gnu.org (full text, mbox):

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: Johan Andersson <johan.rejeep <at> gmail.com>, 16762 <at> debbugs.gnu.org
Subject: Re: bug#16762: Installed packages are not considered part of the
 archive contents
Date: Sun, 23 Mar 2014 10:16:40 +0200
On 22.03.2014 04:46, Stefan Monnier wrote:

> Yes, but as long as we don't know why this was done, it's too risky to
> change it.  If/when we figure out what that was about and come up with
> a way to fix the problem, we can judge whether that's appropriate for
> 24.4.

From what I can see, except `package-install', all places where 
`package-archive-contents' is used, either append its contents to 
`package-alist' elements, or use a predicate calling `package-installed-p'.

The following patch seems to offer the same functionality:


=== modified file 'lisp/emacs-lisp/package.el'
--- lisp/emacs-lisp/package.el	2014-03-22 08:43:30 +0000
+++ lisp/emacs-lisp/package.el	2014-03-23 08:03:37 +0000
@@ -1047,14 +1047,11 @@
          (existing-packages (assq name package-archive-contents))
          (pinned-to-archive (assoc name package-pinned-packages)))
     (cond
-     ;; Skip entirely if pinned to another archive or already installed.
+     ;; Skip entirely if pinned to another archive or built-in.
      ((or (and pinned-to-archive
                (not (equal (cdr pinned-to-archive) archive)))
           (let ((bi (assq name package--builtin-versions)))
-            (and bi (version-list-= version (cdr bi))))
-          (let ((ins (cdr (assq name package-alist))))
-            (and ins (version-list-= version
-                                     (package-desc-version (car ins))))))
+            (and bi (version-list-= version (cdr bi)))))
       nil)
      ((not existing-packages)
       (push (list name pkg-desc) package-archive-contents))
@@ -1090,8 +1087,11 @@
        (package-refresh-contents))
      (list (intern (completing-read
                     "Install package: "
-                    (mapcar (lambda (elt) (symbol-name (car elt)))
-                            package-archive-contents)
+                    (delq nil
+                          (mapcar (lambda (elt)
+                                    (unless (package-installed-p (car elt))
+                                      (symbol-name (car elt))))
+                                  package-archive-contents))
                     nil t)))))
   (package-download-transaction
    (if (package-desc-p pkg)






This bug report was last modified 11 years and 64 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.