From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?UTF-8?Q?Jorgen_Sch=C3=A4fer?= Newsgroups: gmane.emacs.devel Subject: Re: [Emacs-diffs] master b689b90: Package archives now have priorities. Date: Sat, 17 Jan 2015 12:02:17 +0100 Message-ID: References: <20150116102411.11014.8945@vcs.savannah.gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1421494680 20207 80.91.229.3 (17 Jan 2015 11:38:00 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 17 Jan 2015 11:38:00 +0000 (UTC) Cc: emacs-devel To: bruce.connor.am@gmail.com Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Jan 17 12:37:56 2015 Return-path: Envelope-to: ged-emacs-devel@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 1YCRhR-00013x-UN for ged-emacs-devel@m.gmane.org; Sat, 17 Jan 2015 12:37:54 +0100 Original-Received: from localhost ([::1]:58891 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YCRhR-0000mR-3p for ged-emacs-devel@m.gmane.org; Sat, 17 Jan 2015 06:37:53 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37099) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YCR98-0003jT-C7 for emacs-devel@gnu.org; Sat, 17 Jan 2015 06:02:27 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YCR94-0007so-CI for emacs-devel@gnu.org; Sat, 17 Jan 2015 06:02:26 -0500 Original-Received: from loki.jorgenschaefer.de ([87.230.15.51]:49779) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YCR94-0007sd-7D for emacs-devel@gnu.org; Sat, 17 Jan 2015 06:02:22 -0500 Original-Received: by loki.jorgenschaefer.de (Postfix, from userid 998) id 33918200E9A; Sat, 17 Jan 2015 12:02:20 +0100 (CET) Original-Received: from mail-wi0-f171.google.com (mail-wi0-f171.google.com [209.85.212.171]) by loki.jorgenschaefer.de (Postfix) with ESMTPSA id 43BEA200E94 for ; Sat, 17 Jan 2015 12:02:18 +0100 (CET) Original-Received: by mail-wi0-f171.google.com with SMTP id ho1so8854886wib.4 for ; Sat, 17 Jan 2015 03:02:17 -0800 (PST) X-Received: by 10.194.191.227 with SMTP id hb3mr39144807wjc.79.1421492537981; Sat, 17 Jan 2015 03:02:17 -0800 (PST) Original-Received: by 10.180.102.202 with HTTP; Sat, 17 Jan 2015 03:02:17 -0800 (PST) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 87.230.15.51 X-Mailman-Approved-At: Sat, 17 Jan 2015 06:37:50 -0500 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:181371 Archived-At: On Sat, Jan 17, 2015 at 12:48 AM, Artur Malabarba wrote: >> +(defcustom package-archive-priorities nil >> + "An alist of priorities for packages. >> + >> +Each element has the form (ARCHIVE-ID . PRIORITY). >> + >> +When installing packages, the package with the highest version >> +number from the archive with the highest priority is >> +selected. When higher versions are available from archives with >> +lower priorities, the user has to select those manually. >> + >> +Archives not in this list have the priority 0." >> + :type 'integer > I think you meant 'alist? Indeed, thanks for catching this. Fixed in d80fed. >> +(defun package--add-to-alist (pkg-desc alist) >> + "Add PKG-DESC to ALIST. >> + >> +Packages are grouped by name. The package descriptions are sorted >> +by version number." >> + (let* ((name (package-desc-name pkg-desc)) >> + (priority-version (package-desc-priority-version pkg-desc)) >> + (existing-packages (assq name alist))) >> + (if (not existing-packages) >> + (cons (list name pkg-desc) > This list should be a cons, probably why the test is failing. Why should this be a cons? The alist maps package names to ordered package descriptors =E2=80=93 I guess (cons name (list pkg-desc)) would be clearer in intent. Regards, Jorgen