]> code.delx.au - gnu-emacs/blobdiff - admin/admin.el
Fix an error in Tramp for rsync
[gnu-emacs] / admin / admin.el
index fe807ff96fe89cfd57e12816598e88751a43d563..4af1ff9003a90722384cfd62632e9b8995c88c12 100644 (file)
@@ -30,6 +30,7 @@
 
 (defun add-release-logs (root version &optional date)
   "Add \"Version VERSION released.\" change log entries in ROOT.
+Also update the etc/HISTORY file.
 Root must be the root of an Emacs source tree.
 Optional argument DATE is the release date, default today."
   (interactive (list (read-directory-name "Emacs root directory: ")
@@ -42,6 +43,19 @@ Optional argument DATE is the release date, default today."
   (setq root (expand-file-name root))
   (unless (file-exists-p (expand-file-name "src/emacs.c" root))
     (user-error "%s doesn't seem to be the root of an Emacs source tree" root))
+  (let ((clog (expand-file-name "ChangeLog" root)))
+    (if (file-exists-p clog)
+        ;; Basic check that a ChangeLog that exists is not your personal one.
+        ;; TODO Perhaps we should move any existing file and unconditionally
+        ;; call make ChangeLog?  Or make ChangeLog CHANGELOG=temp and compare
+        ;; with the existing?
+        (with-temp-buffer
+          (insert-file-contents clog)
+          (or (re-search-forward "^[ \t]*Copyright.*Free Software" nil t)
+              (user-error "ChangeLog looks like a personal one - remove it?")))
+      (or
+       (zerop (call-process "make" nil nil nil "-C" root "ChangeLog"))
+       (error "Problem generating ChangeLog"))))
   (require 'add-log)
   (or date (setq date (funcall add-log-time-format nil t)))
   (let* ((logs (process-lines "find" root "-name" "ChangeLog"))
@@ -53,7 +67,14 @@ Optional argument DATE is the release date, default today."
     (dolist (log logs)
       (find-file log)
       (goto-char (point-min))
-      (insert entry))))
+      (insert entry)))
+  (let ((histfile (expand-file-name "etc/HISTORY" root)))
+    (unless (file-exists-p histfile)
+      (error "%s not present" histfile))
+    (find-file histfile)
+    (goto-char (point-max))
+    (search-backward "\f")
+    (insert (format "GNU Emacs %s (%s) emacs-%s\n\n" version date version))))
 
 (defun set-version-in-file (root file version rx)
   "Subroutine of `set-version' and `set-copyright'."