Package: dpkg-dev-el
Version: 35.1
Severity: wishlist
Tags: patch
Hi,
I'm quite often generating Debian packages for local use only, or for
clients. These packages eventually end up in APT repositories different
than the Debian ones, so the "distribution" field in their changelog has
different constraints. I would therefore like its allowed values to be
customizable, and I propose a defcustom to be added, and the defun to be
changed to something like the following:
$ diff -u /usr/share/emacs/site-lisp/dpkg-dev-el/debian-changelog-mode.el
~/lib/lisp/
--- /usr/share/emacs/site-lisp/dpkg-dev-el/debian-changelog-mode.el
2010-07-28 17:37:24.000000000 +0200
+++ /home/roland/lib/lisp//debian-changelog-mode.el 2011-10-14
10:34:14.658731919 +0200
@@ -386,6 +386,19 @@
:group 'debian-changelog
:type 'string)
+(defcustom debian-changelog-allowed-distributions
+ '("unstable"
+ "testing"
+ "testing-security"
+ "stable"
+ "stable-security"
+ "oldstable-security"
+ "experimental"
+ "UNRELEASED" )
+ "*Allowed values for distribution."
+ :group 'debian-changelog
+ :type '(repeat string))
+
(defcustom debian-changelog-local-variables-maybe-remove t
"*Ask to remove obsolete \"Local Variables:\" block from changelog.
This is done only under certain conditions."
@@ -880,14 +893,7 @@
(error (substitute-command-keys "most recent version has been finalised
- use \\[debian-changelog-unfinalise-last-version] or
\\[debian-changelog-add-version]")))
(let ((str (completing-read
"Select distribution: "
- '(("unstable" 1)
- ("testing" 2)
- ("testing-security" 3)
- ("stable" 4)
- ("stable-security" 5)
- ("oldstable-security" 6)
- ("experimental" 7)
- ("UNRELEASED" 8))
+ debian-changelog-allowed-distributions
nil t nil)))
(if (not (equal str ""))
(debian-changelog-setdistribution str))))
This patch doesn't touch the generation of the menus (where the
distribution list is still hardcoded), nor the default distribution for
new versions (which is still either unstable or UNRELEASED depending on
the last version), but it should be a good start.
For context, and for anyone who might be interested: my .emacs registers
lld-set-debian-changelog-mailing-address and
lld-set-debian-changelog-allowed-distributions into
debian-changelog-mode-hook, with these functions defined as follows:
,----
| (defun lld-set-debian-changelog-mailing-address ()
| (when (string-match "/home/roland/gnurandal/.*/debian/changelog"
buffer-file-name)
| (make-variable-buffer-local 'debian-changelog-mailing-address)
| (setq debian-changelog-mailing-address "[email protected]")
| )
| )
|
| (defun lld-set-debian-changelog-allowed-distributions ()
| (when (string-match "/home/roland/gnurandal/.*/debian/changelog"
buffer-file-name)
| (make-variable-buffer-local 'debian-changelog-allowed-distributions)
| (when (string-match
"/home/roland/gnurandal/.*/client1/.*/debian/changelog" buffer-file-name)
| (setq debian-changelog-allowed-distributions '("client1")))
| (when (string-match
"/home/roland/gnurandal/.*/client2/.*/debian/changelog" buffer-file-name)
| (setq debian-changelog-allowed-distributions '("client2")))
| (when (string-match
"/home/roland/gnurandal/.*/client3/.*/debian/changelog" buffer-file-name)
| (setq debian-changelog-allowed-distributions '("client3")))
| (when (string-match
"/home/roland/gnurandal/.*/client4/.*/debian/changelog" buffer-file-name)
| (setq debian-changelog-allowed-distributions '("client4")))
| )
| )
`----
…so when I work on a Debian package stored in the part of my $HOME that
I use for work, the email address and the distributions are
automatically adjusted.
Roland.
-- System Information:
Debian Release: wheezy/sid
APT prefers unstable
APT policy: (500, 'unstable')
Architecture: i386 (i686)
Kernel: Linux 3.0.0-2-686-pae (SMP w/1 CPU core)
Locale: LANG=fr_FR.utf8, LC_CTYPE=fr_FR.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash
Versions of packages dpkg-dev-el depends on:
ii debian-el 35.1
ii emacs [emacsen] 23.3+1-1.1
ii emacs23 [emacsen] 23.3+1-1.1
Versions of packages dpkg-dev-el recommends:
ii wget 1.13-1
Versions of packages dpkg-dev-el suggests:
ii dpkg-dev 1.16.1
-- no debconf information
--
Roland Mas
Mou ichido ! Hayaku ! Ookii koede !
-- Atsuko Sasaki
--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]