From 397703b4ab20d96ff63c1dc25ffcbe4e76a71ae8 Mon Sep 17 00:00:00 2001 From: Yann Hodique Date: Wed, 3 Apr 2013 21:51:33 -0400 Subject: * lisp/emacs-lisp/package.el (package-pinned-packages): New var. (package--add-to-archive-contents): Obey it. Fixes: debbugs:14118 --- lisp/emacs-lisp/package.el | 30 ++++++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-) (limited to 'lisp/emacs-lisp/package.el') diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index c15c9e079fe..f9a2881a45c 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -4,7 +4,7 @@ ;; Author: Tom Tromey ;; Created: 10 Mar 2007 -;; Version: 1.0 +;; Version: 1.0.1 ;; Keywords: tools ;; This file is part of GNU Emacs. @@ -234,11 +234,28 @@ a package can run arbitrary code." :group 'package :version "24.1") +(defcustom package-pinned-packages nil + "An alist of packages that are pinned to a specific archive + +Each element has the form (SYM . ID). + SYM is a package, as a symbol. + ID is an archive name, as a string. This should correspond to an + entry in `package-archives'. + +If the archive of name ID does not contain the package SYM, no +other location will be considered, which will make the +package unavailable." + :type '(alist :key-type (symbol :tag "Package") + :value-type (string :tag "Archive name")) + :risky t + :group 'package + :version "24.4") + (defconst package-archive-version 1 "Version number of the package archive understood by this file. Lower version numbers than this will probably be understood as well.") -(defconst package-el-version "1.0" +(defconst package-el-version "1.0.1" "Version of package.el.") ;; We don't prime the cache since it tends to get out of date. @@ -857,8 +874,13 @@ Also, add the originating archive to the end of the package vector." (version (package-desc-vers (cdr package))) (entry (cons name (vconcat (cdr package) (vector archive)))) - (existing-package (assq name package-archive-contents))) - (cond ((not existing-package) + (existing-package (assq name package-archive-contents)) + (pinned-to-archive (assoc name package-pinned-packages))) + (cond ((and pinned-to-archive + ;; If pinned to another archive, skip entirely. + (not (equal (cdr pinned-to-archive) archive))) + nil) + ((not existing-package) (add-to-list 'package-archive-contents entry)) ((version-list-< (package-desc-vers (cdr existing-package)) version) -- cgit v1.2.3 From b208ebc6e75d2dd78fa8b3d5dc6548215b0d3ef4 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Wed, 3 Apr 2013 22:46:38 -0400 Subject: * lisp/emacs-lisp/package.el (package-compute-transaction): Fix ordering when a package is required several times. Fixes: debbugs:14082 --- lisp/ChangeLog | 5 +++++ lisp/emacs-lisp/package.el | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) (limited to 'lisp/emacs-lisp/package.el') diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 1e50cce354d..1f033f175c5 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2013-04-04 Stefan Monnier + + * emacs-lisp/package.el (package-compute-transaction): Fix ordering + when a package is required several times (bug#14082). + 2013-04-04 Roland Winkler * faces.el (read-face-name): Behave as promised by the docstring. diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index f9a2881a45c..d005c200d0c 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -811,7 +811,10 @@ but version %s required" (package-version-join (package-desc-vers (cdr pkg-desc))))) ;; Only add to the transaction if we don't already have it. (unless (memq next-pkg package-list) - (push next-pkg package-list)) + (setq package-list + ;; Move to front, so it gets installed early enough + ;; (bug#14082). + (cons next-pkg (delq next-pkg package-list)))) (setq package-list (package-compute-transaction package-list (package-desc-reqs -- cgit v1.2.3