]> git.eshelyaron.com Git - emacs.git/commitdiff
gitlog-to-changelog coding cookie and mv -i
authorPaul Eggert <eggert@cs.ucla.edu>
Thu, 9 Apr 2015 16:50:48 +0000 (09:50 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Thu, 9 Apr 2015 16:51:09 +0000 (09:51 -0700)
* build-aux/gitlog-to-emacslog: Use ChangeLog.1, not Makefile.in,
for copyright notice prototype, so that we get a proper "coding:"
cookie.  Use 'mv -i' to avoid unconditionally overwriting an
existing ChangeLog.  Problems reported by Eli Zaretskii in:
http://lists.gnu.org/archive/html/emacs-devel/2015-04/msg00504.html

build-aux/gitlog-to-emacslog

index 553607ae299d9b84605e54528d63a286d8744d9b..a523d861611a302ab572cd3aefa9b580966fb297 100755 (executable)
@@ -58,12 +58,15 @@ if test -s "${distprefix}ChangeLog.tmp"; then
   fi
 
   # Append a proper copyright notice.
-  sed "1d
-       s/\\(Copyright[ (C)]*\\)[0-9]*-[0-9]*/\\1$year_range/
-       s/^# //
-       /http:/q
-  " <Makefile.in >>"${distprefix}ChangeLog.tmp" || exit
+  sed -n '
+    1i\
+
+    /^;; Local Variables:/,${
+       s/\(Copyright[ (C)]*\)[0-9]*-[0-9]*/\1'"$year_range"'/
+       p
+    }
+  ' <ChangeLog.1 >>"${distprefix}ChangeLog.tmp" || exit
 fi
 
 # Install the generated ChangeLog.
-mv -f "${distprefix}ChangeLog.tmp" "${distprefix}ChangeLog"
+mv -i "${distprefix}ChangeLog.tmp" "${distprefix}ChangeLog"