From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.bugs Subject: bug#16762: Installed packages are not considered part of the archive contents Date: Mon, 24 Mar 2014 08:20:48 +0200 Message-ID: <532FCEC0.4020304@yandex.ru> References: <87lhw4nj42.fsf@yandex.ru> <532CC639.6000309@yandex.ru> <532E9868.60207@yandex.ru> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1395642073 24953 80.91.229.3 (24 Mar 2014 06:21:13 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 24 Mar 2014 06:21:13 +0000 (UTC) Cc: Johan Andersson , 16762@debbugs.gnu.org To: Stefan Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Mar 24 07:21:21 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1WRyG9-0000YK-1u for geb-bug-gnu-emacs@m.gmane.org; Mon, 24 Mar 2014 07:21:21 +0100 Original-Received: from localhost ([::1]:34674 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WRyG8-0003Mb-EZ for geb-bug-gnu-emacs@m.gmane.org; Mon, 24 Mar 2014 02:21:20 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54878) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WRyFy-00036p-Ek for bug-gnu-emacs@gnu.org; Mon, 24 Mar 2014 02:21:17 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WRyFr-0003UO-4p for bug-gnu-emacs@gnu.org; Mon, 24 Mar 2014 02:21:10 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:45464) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WRyFr-0003UJ-1L for bug-gnu-emacs@gnu.org; Mon, 24 Mar 2014 02:21:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1WRyFp-00051z-Sv for bug-gnu-emacs@gnu.org; Mon, 24 Mar 2014 02:21:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 24 Mar 2014 06:21:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 16762 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 16762-submit@debbugs.gnu.org id=B16762.139564205819324 (code B ref 16762); Mon, 24 Mar 2014 06:21:01 +0000 Original-Received: (at 16762) by debbugs.gnu.org; 24 Mar 2014 06:20:58 +0000 Original-Received: from localhost ([127.0.0.1]:46646 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WRyFm-00051a-3n for submit@debbugs.gnu.org; Mon, 24 Mar 2014 02:20:58 -0400 Original-Received: from mail-ee0-f44.google.com ([74.125.83.44]:35055) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WRyFi-00051P-Sp for 16762@debbugs.gnu.org; Mon, 24 Mar 2014 02:20:55 -0400 Original-Received: by mail-ee0-f44.google.com with SMTP id e49so4023315eek.31 for <16762@debbugs.gnu.org>; Sun, 23 Mar 2014 23:20:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=XUof1tuaajSEFvceEPsoYRMveh+oAxfOX0Wc0Y0rFS0=; b=eXe00WOt5jn5SvBDJ3iJ8i4vXfhpGuTeOKVduG9Mr6SX8l9fuh5BvCXN9NRDAeIZeu v5T2foaFklTpuJtUseKab7h3EQq7tCrTtI6cmCbds43oylF0YpSBd+BFRw+0hFmHbCTs KNlsQGZ1Zn/SumMX7PTjnXny2IwbuRYNZRYgZIvnDdu4tsQNT4M/Exg17B+50EDBy2wY mNC4VOGgPtgwYRIvTMg9x8iNyJohP1IRYRSTUe25UfI3nbRGbSddtUA5nh8BpgVydRTq 8IgkjhDHUhipYZBeGuUUU1ThOoAJN9jDj/iIbz6aY4a8oouXY075MHcGba7xN8s31MgO 1odg== X-Received: by 10.15.81.135 with SMTP id x7mr3365445eey.61.1395642052983; Sun, 23 Mar 2014 23:20:52 -0700 (PDT) Original-Received: from [192.168.10.2] ([93.109.138.177]) by mx.google.com with ESMTPSA id a4sm31084553eep.12.2014.03.23.23.20.50 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 23 Mar 2014 23:20:52 -0700 (PDT) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 In-Reply-To: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:87285 Archived-At: On 24.03.2014 02:55, Stefan wrote: > Does it affect the output of M-x package-list RET? It's identical (checked with diff). > What about the package-menu-mark-upgrades? It works. Don't see any problems. > If we can keep the already installed packages, couldn't we also keep the > already built-in packages? Yes, seems so. I hadn't tried this before because the previous behavior was to omit them (I think), but the patch below seems to work fine WRT the questions above. === modified file 'lisp/emacs-lisp/package.el' --- lisp/emacs-lisp/package.el 2014-03-23 08:35:56 +0000 +++ lisp/emacs-lisp/package.el 2014-03-24 06:11:52 +0000 @@ -1047,14 +1047,9 @@ (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. - ((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)))))) + ;; Skip entirely if pinned to another archive. + ((and pinned-to-archive + (not (equal (cdr pinned-to-archive) archive))) nil) ((not existing-packages) (push (list name pkg-desc) package-archive-contents)) @@ -1090,8 +1085,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)