From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Johan Andersson Newsgroups: gmane.emacs.bugs Subject: bug#16762: Installed packages are not considered part of the archive contents Date: Mon, 24 Mar 2014 09:10:42 +0100 Message-ID: References: <87lhw4nj42.fsf@yandex.ru> <532CC639.6000309@yandex.ru> <532E9868.60207@yandex.ru> <532FCEC0.4020304@yandex.ru> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=f46d0447a051c904d204f555c670 X-Trace: ger.gmane.org 1395648726 27597 80.91.229.3 (24 Mar 2014 08:12:06 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 24 Mar 2014 08:12:06 +0000 (UTC) Cc: 16762@debbugs.gnu.org To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Mar 24 09:12:15 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 1WRzzS-0001Pt-UP for geb-bug-gnu-emacs@m.gmane.org; Mon, 24 Mar 2014 09:12:15 +0100 Original-Received: from localhost ([::1]:34893 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WRzzS-0001R1-Ge for geb-bug-gnu-emacs@m.gmane.org; Mon, 24 Mar 2014 04:12:14 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50640) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WRzzL-0001Qu-De for bug-gnu-emacs@gnu.org; Mon, 24 Mar 2014 04:12:11 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WRzzG-0001Ee-VR for bug-gnu-emacs@gnu.org; Mon, 24 Mar 2014 04:12:07 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:45521) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WRzzG-0001EZ-PU for bug-gnu-emacs@gnu.org; Mon, 24 Mar 2014 04:12:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1WRzzG-0000Po-Is for bug-gnu-emacs@gnu.org; Mon, 24 Mar 2014 04:12:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Johan Andersson Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 24 Mar 2014 08:12:02 +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.13956486721429 (code B ref 16762); Mon, 24 Mar 2014 08:12:02 +0000 Original-Received: (at 16762) by debbugs.gnu.org; 24 Mar 2014 08:11:12 +0000 Original-Received: from localhost ([127.0.0.1]:46702 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WRzyR-0000Mx-1t for submit@debbugs.gnu.org; Mon, 24 Mar 2014 04:11:11 -0400 Original-Received: from mail-oa0-f44.google.com ([209.85.219.44]:58972) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WRzyO-0000MW-IS for 16762@debbugs.gnu.org; Mon, 24 Mar 2014 04:11:09 -0400 Original-Received: by mail-oa0-f44.google.com with SMTP id n16so5489567oag.31 for <16762@debbugs.gnu.org>; Mon, 24 Mar 2014 01:11:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=vWNA7LaDDKNXKfkYyvWxSXnwmpaKkyooyukS+Tuzz8M=; b=lGHnxpLNrMlYJ+D/riiZmNVxggufWcvfruImcAcVs1tp/42dPw5ipe831KAh4rADeA mi1pKPMBeAv7R5/v7MI3D2flIZmDhYB1uTVXVkHG2+TqB+DMMxgSWC8bmvnKkG8WWu/T 4ETo8Gch3gsqCXHl+MA/r4Jga3lKm2oh56oxaf3SQ6hcZ9NvVvh3ckHN7pCj2VWC/NiE bliE+joKJIk2hCTPWRz0HYXEdpVjovfeEzFq++NMW6d6/r0uEah6vBtqCua0RNGztDvy ISzqL1ajZ5sP6Iqw/ipZb1L01OHSv8Gj46evM5ZNmePARqGY74ncnwHmB+hRIBKCiuFF xdmA== X-Received: by 10.182.10.5 with SMTP id e5mr25008497obb.28.1395648662927; Mon, 24 Mar 2014 01:11:02 -0700 (PDT) Original-Received: by 10.182.130.17 with HTTP; Mon, 24 Mar 2014 01:10:42 -0700 (PDT) In-Reply-To: <532FCEC0.4020304@yandex.ru> 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:87289 Archived-At: --f46d0447a051c904d204f555c670 Content-Type: text/plain; charset=KOI8-R > Johan? I actually found a way around the issue because I had no time waiting for it to get fixed. But I still think that this should be fixed for the reason I mention that other packages, such as Epl depends on the (non) package API. This specific issue will break for example this function: https://github.com/cask/epl/blob/master/epl.el#L447-L452 On Mon, Mar 24, 2014 at 7:20 AM, Dmitry Gutov wrote: > 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) > > > --f46d0447a051c904d204f555c670 Content-Type: text/html; charset=KOI8-R Content-Transfer-Encoding: quoted-printable
> Johan?

I actually found= a way around the issue because I had no time waiting for it to get fixed.<= /div>

But I still think that this should be fixed for th= e reason I mention that other packages, such as Epl depends on the (non) pa= ckage API. This specific issue will break for example this function: https://gith= ub.com/cask/epl/blob/master/epl.el#L447-L452


On Mon,= Mar 24, 2014 at 7:20 AM, Dmitry Gutov <dgutov@yandex.ru> wro= te:
On 24.03.2014 02:55, Stefa= n 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 th= e
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.


=3D=3D=3D modified file 'lisp/emacs-lisp/package.el'
--- lisp/emacs-lisp/package.el =9A2014-03-23 08:35:56 +0000
+++ lisp/emacs-lisp/package.el =9A2014-03-24 06:11:52 +0000
@@ -1047,14 +1047,9 @@

=9A =9A =9A =9A =9A (existing-packages (assq name package-archive-contents)= )
=9A =9A =9A =9A =9A (pinned-to-archive (assoc name package-pinned-packages)= ))
=9A =9A =9A(cond
- =9A =9A ;; Skip entirely if pinned to another archive or already installe= d.
- =9A =9A ((or (and pinned-to-archive
- =9A =9A =9A =9A =9A =9A =9A (not (equal (cdr pinned-to-archive) archive))= )
- =9A =9A =9A =9A =9A(let ((bi (assq name package--builtin-versions)))

- =9A =9A =9A =9A =9A =9A(and bi (version-list-=3D version (cdr bi))))
- =9A =9A =9A =9A =9A(let ((ins (cdr (assq name package-alist))))
- =9A =9A =9A =9A =9A =9A(and ins (version-list-=3D version
- =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A (= package-desc-version (car ins))))))
+ =9A =9A ;; Skip entirely if pinned to another archive.
+ =9A =9A ((and pinned-to-archive
+ =9A =9A =9A =9A =9A (not (equal (cdr pinned-to-archive) archive)))

=9A =9A =9A =9Anil)
=9A =9A =9A ((not existing-packages)
=9A =9A =9A =9A(push (list name pkg-desc) package-archive-contents))
@@ -1090,8 +1085,11 @@

=9A =9A =9A =9A (package-refresh-contents))
=9A =9A =9A (list (intern (completing-read
=9A =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A"Install package: " - =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A(mapcar (lambda (elt) (symbol-name= (car elt)))
- =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A =9Apackage-archive-co= ntents)
+ =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A(delq nil
+ =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A(mapcar (lambda (elt)<= br> + =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A(u= nless (package-installed-p (car elt))
+ =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A = =9A(symbol-name (car elt))))
+ =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A =9Apackag= e-archive-contents))
=9A =9A =9A =9A =9A =9A =9A =9A =9A =9A =9Anil t)))))
=9A =9A(package-download-transaction
=9A =9A (if (package-desc-p pkg)



--f46d0447a051c904d204f555c670--