aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYann Hodique2013-04-03 21:51:33 -0400
committerStefan Monnier2013-04-03 21:51:33 -0400
commit397703b4ab20d96ff63c1dc25ffcbe4e76a71ae8 (patch)
treeca12aea1ad78b713db58664892e8ee85b3d08bbf
parent09e20374a1a0d82c0d5223d3ef30ae75f9bab8f2 (diff)
downloademacs-397703b4ab20d96ff63c1dc25ffcbe4e76a71ae8.tar.gz
emacs-397703b4ab20d96ff63c1dc25ffcbe4e76a71ae8.zip
* lisp/emacs-lisp/package.el (package-pinned-packages): New var.
(package--add-to-archive-contents): Obey it. Fixes: debbugs:14118
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/emacs-lisp/package.el30
2 files changed, 31 insertions, 4 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index d4e229eb6fa..78015230bab 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
12013-04-04 Yann Hodique <yann.hodique@gmail.com> (tiny change)
2
3 * emacs-lisp/package.el (package-pinned-packages): New var.
4 (package--add-to-archive-contents): Obey it (bug#14118).
5
12013-04-03 Alan Mackenzie <acm@muc.de> 62013-04-03 Alan Mackenzie <acm@muc.de>
2 7
3 Handle `parse-partial-sexp' landing inside a comment opener 8 Handle `parse-partial-sexp' landing inside a comment opener
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 @@
4 4
5;; Author: Tom Tromey <tromey@redhat.com> 5;; Author: Tom Tromey <tromey@redhat.com>
6;; Created: 10 Mar 2007 6;; Created: 10 Mar 2007
7;; Version: 1.0 7;; Version: 1.0.1
8;; Keywords: tools 8;; Keywords: tools
9 9
10;; This file is part of GNU Emacs. 10;; This file is part of GNU Emacs.
@@ -234,11 +234,28 @@ a package can run arbitrary code."
234 :group 'package 234 :group 'package
235 :version "24.1") 235 :version "24.1")
236 236
237(defcustom package-pinned-packages nil
238 "An alist of packages that are pinned to a specific archive
239
240Each element has the form (SYM . ID).
241 SYM is a package, as a symbol.
242 ID is an archive name, as a string. This should correspond to an
243 entry in `package-archives'.
244
245If the archive of name ID does not contain the package SYM, no
246other location will be considered, which will make the
247package unavailable."
248 :type '(alist :key-type (symbol :tag "Package")
249 :value-type (string :tag "Archive name"))
250 :risky t
251 :group 'package
252 :version "24.4")
253
237(defconst package-archive-version 1 254(defconst package-archive-version 1
238 "Version number of the package archive understood by this file. 255 "Version number of the package archive understood by this file.
239Lower version numbers than this will probably be understood as well.") 256Lower version numbers than this will probably be understood as well.")
240 257
241(defconst package-el-version "1.0" 258(defconst package-el-version "1.0.1"
242 "Version of package.el.") 259 "Version of package.el.")
243 260
244;; We don't prime the cache since it tends to get out of date. 261;; 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."
857 (version (package-desc-vers (cdr package))) 874 (version (package-desc-vers (cdr package)))
858 (entry (cons name 875 (entry (cons name
859 (vconcat (cdr package) (vector archive)))) 876 (vconcat (cdr package) (vector archive))))
860 (existing-package (assq name package-archive-contents))) 877 (existing-package (assq name package-archive-contents))
861 (cond ((not existing-package) 878 (pinned-to-archive (assoc name package-pinned-packages)))
879 (cond ((and pinned-to-archive
880 ;; If pinned to another archive, skip entirely.
881 (not (equal (cdr pinned-to-archive) archive)))
882 nil)
883 ((not existing-package)
862 (add-to-list 'package-archive-contents entry)) 884 (add-to-list 'package-archive-contents entry))
863 ((version-list-< (package-desc-vers (cdr existing-package)) 885 ((version-list-< (package-desc-vers (cdr existing-package))
864 version) 886 version)