GNU bug report logs - #14118
[PATCH] Add pinning support for packages

Previous Next

Package: emacs;

Reported by: Yann Hodique <yann.hodique <at> gmail.com>

Date: Mon, 1 Apr 2013 18:43:02 UTC

Severity: wishlist

Tags: patch

Done: Stefan Monnier <monnier <at> iro.umontreal.ca>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 14118 in the body.
You can then email your comments to 14118 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#14118; Package emacs. (Mon, 01 Apr 2013 18:43:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Yann Hodique <yann.hodique <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 01 Apr 2013 18:43:03 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Yann Hodique <yann.hodique <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: [PATCH] Add pinning support for packages
Date: Mon, 01 Apr 2013 19:39:33 +0100
Add pinning support for packages

With the current code, the greatest available version of a package wins,
even across repositories.
This can be a problem with repositories such as melpa
(http://melpa.milkbox.net/) that generate packages directly from source
control, thus taking always precedence over released version
of packages. It would be nice to give users the ability to live on the
bleeding edge only for some packages, and stick to more controlled
versions for others. This change provides a way to do that, by allowing
"pinning" a package to a given repository. In particular, this allows
users to store well-known versions of packages in a private repository,
while relying on public ones to provide others.


2013-04-01  Yann Hodique  <yann.hodique <at> gmail.com>

	Add pinning feature to package.el
	* lisp/emacs-lisp/package.el: bump version to 1.0.1
	(package-pinned-packages): new custom variable to hold pinning data
	(package--add-to-archive-contents): don't add the package if it doesn't
	fit the pinning requirements


*** /var/folders/5v/p46z8rl56452tz_1c_fm_zmr0000gn/T//ECKODq_package.el	2013-04-01 19:35:32.000000000 +0100
--- lisp/emacs-lisp/package.el	2013-04-01 19:20:21.000000000 +0100
***************
*** 4,10 ****
  
  ;; Author: Tom Tromey <tromey <at> redhat.com>
  ;; Created: 10 Mar 2007
! ;; Version: 1.0
  ;; Keywords: tools
  
  ;; This file is part of GNU Emacs.
--- 4,10 ----
  
  ;; Author: Tom Tromey <tromey <at> redhat.com>
  ;; Created: 10 Mar 2007
! ;; Version: 1.0.1
  ;; Keywords: tools
  
  ;; This file is part of GNU Emacs.
*************** a package can run arbitrary code."
*** 234,244 ****
    :group 'package
    :version "24.1")
  
  (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"
    "Version of package.el.")
  
  ;; We don't prime the cache since it tends to get out of date.
--- 234,261 ----
    :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.1"
    "Version of package.el.")
  
  ;; We don't prime the cache since it tends to get out of date.
*************** Also, add the originating archive to the
*** 857,864 ****
           (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)
  	   (add-to-list 'package-archive-contents entry))
  	  ((version-list-< (package-desc-vers (cdr existing-package))
  			   version)
--- 874,886 ----
           (version (package-desc-vers (cdr package)))
           (entry   (cons name
  			(vconcat (cdr package) (vector archive))))
!          (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)

-- 
One uses power by grasping it lightly.  To grasp with too much force is to be 
taken over by power, thus becoming its victim.

  -- Bene Gesserit Axiom




Reply sent to Stefan Monnier <monnier <at> iro.umontreal.ca>:
You have taken responsibility. (Thu, 04 Apr 2013 01:56:02 GMT) Full text and rfc822 format available.

Notification sent to Yann Hodique <yann.hodique <at> gmail.com>:
bug acknowledged by developer. (Thu, 04 Apr 2013 01:56:02 GMT) Full text and rfc822 format available.

Message #10 received at 14118-done <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Yann Hodique <yann.hodique <at> gmail.com>
Cc: 14118-done <at> debbugs.gnu.org
Subject: Re: bug#14118: [PATCH] Add pinning support for packages
Date: Wed, 03 Apr 2013 21:52:30 -0400
> Add pinning support for packages

Installed (with tiny comment style fix), thank you.
You might like to sign a copyright assignment for Emacs if you intend to
contribute further patches,


        Stefan




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#14118; Package emacs. (Thu, 04 Apr 2013 06:45:03 GMT) Full text and rfc822 format available.

Message #13 received at 14118-done <at> debbugs.gnu.org (full text, mbox):

From: Yann Hodique <yann.hodique <at> gmail.com>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 14118-done <at> debbugs.gnu.org
Subject: Re: bug#14118: [PATCH] Add pinning support for packages
Date: Thu, 04 Apr 2013 07:41:04 +0100
>>>>> "Stefan" == Stefan Monnier <monnier <at> iro.umontreal.ca> writes:

> Installed (with tiny comment style fix), thank you.
> You might like to sign a copyright assignment for Emacs if you intend to
> contribute further patches,

Thanks,

actually the paperwork should already in order (due to contributions to
org-mode).

Yann.

-- 
Truth is a chameleon.

  -- Zensunni Aphorism




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 02 May 2013 11:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 12 years and 55 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.