aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2012-05-17 16:30:10 +0300
committerSergey Poznyakoff <gray@gnu.org.ua>2012-05-17 16:30:10 +0300
commitcf48db9c8a4eb204af72363040e9adc4b1945dca (patch)
treea4e7905c9bdf60e589901d6532a5cdaa71b0f890
parent459243cf5c5b8ac1d74355dee29ef1c1d5948e85 (diff)
downloadbeam-cf48db9c8a4eb204af72363040e9adc4b1945dca.tar.gz
beam-cf48db9c8a4eb204af72363040e9adc4b1945dca.tar.bz2
Minor changes.
* Makefile.am: Generate ChangeLog. * README: New file. * git2chg.awk: New file.
-rw-r--r--Makefile.am10
-rw-r--r--README1
-rw-r--r--git2chg.awk76
3 files changed, 87 insertions, 0 deletions
diff --git a/Makefile.am b/Makefile.am
index 7702ede..9a6e098 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -32,3 +32,13 @@ $(top_builddir)/build.sed: Makefile
} > $(top_builddir)/build.sed
DISTCLEANFILES=build.sed backup.sh restore.sh
include $(top_srcdir)/Make.rules
+
+.PHONY: ChangeLog
+ChangeLog:
+ $(AM_V_GEN)if test -d .git; then \
+ git log --pretty='format:%ct %an <%ae>%n%n%s%n%n%b%n' | \
+ awk -f $(top_srcdir)/git2chg.awk > ChangeLog.tmp; \
+ cmp ChangeLog ChangeLog.tmp > /dev/null 2>&1 || \
+ mv ChangeLog.tmp ChangeLog; \
+ rm -f ChangeLog.tmp; \
+ fi
diff --git a/README b/README
new file mode 100644
index 0000000..cee4adf
--- /dev/null
+++ b/README
@@ -0,0 +1 @@
+This package provides generic backup and restore scripts.
diff --git a/git2chg.awk b/git2chg.awk
new file mode 100644
index 0000000..166f6b2
--- /dev/null
+++ b/git2chg.awk
@@ -0,0 +1,76 @@
+# This file is part of grecs
+# Copyright (C) 2007, 2009-2012 Sergey Poznyakoff
+#
+# Grecs is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3, or (at your option)
+# any later version.
+#
+# Grecs is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with Grecs. If not, see <http://www.gnu.org/licenses/>.
+
+BEGIN {
+ if (since)
+ split(since,since_a,"-")
+}
+
+function timeok(t, a) {
+ if (!since)
+ return 1
+ split(t,a,"-")
+ if (a[1] < since_a[1])
+ return 0
+ if (a[1] >= since_a[1])
+ return 1
+ if (a[2] < since_a[2])
+ return 0
+ if (a[2] >= since_a[2])
+ return 1
+ return a[3] >= since_a[3]
+}
+
+/^[0-9]+ .* +<[^>]+>/ {
+ s = strftime("%F", $1)
+ if (!timeok(s))
+ exit
+ sub(/^[0-9]+ +/,"")
+ if (s == datestr && author == $0)
+ next
+ datestr = s
+ author = $0
+ if (runlen) { runlen = 0; print "" }
+ printf("%s %s\n", datestr, author)
+ next
+}
+/^Signed-off-by:/ { next }
+/^git-svn-id:/ { next }
+/^<unknown>$/ { next }
+NF==0 {
+ runlen++
+ next
+}
+{ if (runlen) { runlen = 0; print "" }
+ print "\t" $0 }
+
+END {
+ if (append) {
+ print ""
+ while ((getline < append) > 0) {
+ if (match($0, /^Local *Variables:/))
+ break
+ print
+ }
+ }
+ print "\f"
+ # Make sure Emacs won't recognize this line:
+ print "Local", "Variables:"
+ print "mode: change-log"
+ print "version-control: never"
+ print "buffer-read-only: t"
+ print "End:"
+}

Return to:

Send suggestions and report system problems to the System administrator.