Package: dpkg-dev-el
Version: 26.5-2
Severity: normal
Tags: patch

XEmacs's (format-time-string) function doesn't support %z and just returns
"z", which results in README.Debian timestamps like:

 -- Russ Allbery <[EMAIL PROTECTED]>, Fri, 21 Apr 2006 18:59:50 z

The following patch adds a copy of the function used in debian-changelog.el
(I didn't see a good shared file into which to put it) that fixes this
problem by shelling out to 822-date.

-- System Information:
Debian Release: testing/unstable
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'unstable'), (1, 'experimental')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.15-1-686
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)

Versions of packages dpkg-dev-el depends on:
ii  debian-el                     26.5-2     Emacs helpers specific to Debian u
ii  xemacs21-mule [emacsen]       21.4.18-3  highly customizable text editor --

Versions of packages dpkg-dev-el recommends:
ii  wget                          1.10.2-1   retrieves files from the web

-- no debconf information
--- emacs-goodies-el-26.5/elisp/dpkg-dev-el/readme-debian.el.orig       
2006-02-02 18:22:25.000000000 -0800
+++ emacs-goodies-el-26.5/elisp/dpkg-dev-el/readme-debian.el    2006-04-21 
18:56:05.000000000 -0700
@@ -44,6 +44,25 @@
      (3 font-lock-string-face)))
   "Regexp keywords used to fontify README.Debian buffers.")
 
+(defun readme-debian-date-string ()
+  "Return RFC-822 format date string."
+  (let* ((dp "822-date")
+         (cp (point))
+         (ret (call-process "822-date" nil t))
+         (np (point))
+         (out nil))
+    (cond ((not (or (eq ret nil) (eq ret 0)))
+           (setq out (buffer-substring-no-properties cp np))
+           (delete-region cp np)
+           (error (concat "error from " dp ": " out)))
+          (t
+           (backward-char)
+           (or (looking-at "\n")
+               (error (concat "error from " dp ": expected newline after date 
string")))
+           (setq out (buffer-substring-no-properties cp (- np 1)))
+           (delete-region cp np)
+           out))))
+
 (defun readme-debian-update-timestamp ()
   "Function to update timestamp in README.Debian files, automatically invoked 
when saving file."
   (save-excursion
@@ -58,7 +77,7 @@
             " -- "
             debian-changelog-full-name
             " <" debian-changelog-mailing-address ">, "
-             (format-time-string "%a, %e %b %Y %T %z" (current-time))))
+             (readme-debian-date-string)))
     (if (and (= (point)(point-max)) (not (bolp)))
        (insert "\n"))))
 

Reply via email to