emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r112216: * lisp/emacs-lisp/package.el


From: Stefan Monnier
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r112216: * lisp/emacs-lisp/package.el (package-pinned-packages): New var.
Date: Wed, 03 Apr 2013 21:51:33 -0400
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 112216
fixes bug: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=14118
author: Yann Hodique <address@hidden>
committer: Stefan Monnier <address@hidden>
branch nick: trunk
timestamp: Wed 2013-04-03 21:51:33 -0400
message:
  * lisp/emacs-lisp/package.el (package-pinned-packages): New var.
  (package--add-to-archive-contents): Obey it.
modified:
  lisp/ChangeLog
  lisp/emacs-lisp/package.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2013-04-03 17:50:39 +0000
+++ b/lisp/ChangeLog    2013-04-04 01:51:33 +0000
@@ -1,3 +1,8 @@
+2013-04-04  Yann Hodique  <address@hidden>  (tiny change)
+
+       * emacs-lisp/package.el (package-pinned-packages): New var.
+       (package--add-to-archive-contents): Obey it (bug#14118).
+
 2013-04-03  Alan Mackenzie  <address@hidden>
 
        Handle `parse-partial-sexp' landing inside a comment opener

=== modified file 'lisp/emacs-lisp/package.el'
--- a/lisp/emacs-lisp/package.el        2013-02-13 16:02:35 +0000
+++ b/lisp/emacs-lisp/package.el        2013-04-04 01:51:33 +0000
@@ -4,7 +4,7 @@
 
 ;; Author: Tom Tromey <address@hidden>
 ;; Created: 10 Mar 2007
-;; Version: 1.0
+;; Version: 1.0.1
 ;; Keywords: tools
 
 ;; This file is part of GNU Emacs.
@@ -234,11 +234,28 @@
   :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 @@
          (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)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]