Package: dpkg-dev-el
Version: 29.3-2
Severity: wishlist
Tags: patch
2008-10-27 Jari Aalto <[EMAIL PROTECTED]>
* debian-changelog-mode.el
(debian-changelog-date-utc-flag): New variable.
(debian-changelog-date-string): If
`debian-changelog-date-utc-flag' is non-nil, return date in UTC.
-- System Information:
Debian Release: lenny/sid
APT prefers testing
APT policy: (990, 'testing'), (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Kernel: Linux 2.6.26-1-openvz-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_DK.UTF-8, LC_CTYPE=en_DK.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Versions of packages dpkg-dev-el depends on:
ii debian-el 29.3-2 Emacs helpers specific to Debian u
ii emacs [emacsen] 22.2+2-3 The GNU Emacs editor (metapackage)
ii emacs22 [emacsen] 22.2+2-4 The GNU Emacs editor
ii xemacs21-mule [emacsen] 21.4.21-4 highly customizable text editor --
Versions of packages dpkg-dev-el recommends:
ii wget 1.11.4-2 retrieves files from the web
Versions of packages dpkg-dev-el suggests:
ii dpkg-dev 1.14.22 Debian package development tools
-- no debconf information
elisp/dpkg-dev-el/debian-changelog-mode.el | 21 +++++++++++++++++++--
1 files changed, 19 insertions(+), 2 deletions(-)
diff --git a/elisp/dpkg-dev-el/debian-changelog-mode.el
b/elisp/dpkg-dev-el/debian-changelog-mode.el
index 5e3dc27..70a06e2 100644
--- a/elisp/dpkg-dev-el/debian-changelog-mode.el
+++ b/elisp/dpkg-dev-el/debian-changelog-mode.el
@@ -411,6 +411,12 @@ new version in debian/changelog."
:group 'debian-changelog
:type 'hook)
+(defcustom debian-changelog-date-utc-flag nil
+ "If non-nil, return date string in UTC when finalizing entry.
+See function `debian-changelog-date-string'."
+ :group 'debian-changelogx
+ :type 'boolean)
+
;; This function is from emacs/lisp/calendar/icalendar.el,
;; necessary to replace "%s" with the bug number in
;; `debian-changelog-close-bug-statement'
@@ -1163,10 +1169,21 @@ If file is empty, create initial entry."
;;
(defun debian-changelog-date-string ()
- "Return RFC-822 format date string."
+ "Return RFC-822 format date string.
+Use UTC if `debian-changelog-date-utc-flag' is non-nil."
(let* ((dp "date")
(cp (point))
- (ret (call-process "date" nil t nil "-R"))
+ (ret
+ (let ((process-environment process-environment)
+ (tz (dolist (item process-environment)
+ (when (and (stringp item)
+ (string-match "^TZ=" item))
+ (return item)))))
+ (when debian-changelog-date-utc-flag
+ (setq process-environment
+ (delete tz process-environment))
+ (push "TZ=UTC" process-environment))
+ (call-process "date" nil t nil "-R")))
(np (point))
(out nil))
(cond ((not (or (eq ret nil) (eq ret 0)))