+* [Bug 2547] Automate update of "Last Update" datestamps in .html files.
* [Bug 2623] Missing {} in refclock_oncore.c.
* Quiet warnings from ntp_calendar.h: avoid using argument names.
(4.2.7p448) 2014/07/15 Released by Harlan Stenn <stenn@ntp.org>
BUILT_SOURCES = \
.gcc-warning \
libtool \
+ html/.datecheck \
sntp/built-sources-only \
$(srcdir)/COPYRIGHT \
$(srcdir)/.checkChangeLog \
$(NULL)
+.gcc-warning:
+ @echo "Compiling with GCC now generates lots of new warnings."
+ @echo " "
+ @echo "Don't be concerned. They're just warnings."
+ @echo " "
+ @echo "Don't send bug reports about the warnings, either."
+ @echo " "
+ @echo "Feel free to send patches that fix these warnings, though."
+ @echo " "
+ @sleep 1
+ @touch $@
+
+html/.datecheck: FRC.html
+ cd $(srcdir)/html && \
+ ../scripts/build/checkHtmlFileDates
+
+libtool: $(LIBTOOL_DEPS)
+ ./config.status --recheck
+
+sntp/built-sources-only: FRC.sntp
+ @cd sntp && $(MAKE) $(AM_MAKEFLAGS) built-sources-only
+
$(srcdir)/COPYRIGHT: $(srcdir)/html/copyright.html
{ echo "This file is automatically generated from html/copyright.html" ; \
lynx -dump $(srcdir)/html/copyright.html ;} > COPYRIGHT.new \
cd $(srcdir) && \
./scripts/build/checkChangeLog
-sntp/built-sources-only: FRC.sntp
- @cd sntp && $(MAKE) $(AM_MAKEFLAGS) built-sources-only
-
dist-hook:
@find $(distdir) -type d -name SCCS -print | xargs rm -rf
uninstall-local:
rm -rf $(DESTDIR)$(htmldir)/html
-.gcc-warning:
- @echo "Compiling with GCC now generates lots of new warnings."
- @echo " "
- @echo "Don't be concerned. They're just warnings."
- @echo " "
- @echo "Don't send bug reports about the warnings, either."
- @echo " "
- @echo "Feel free to send patches that fix these warnings, though."
- @echo " "
- @sleep 1
- @touch $@
-
CommitLog: FRC.CommitLog
cd $(srcdir) \
&& $(PATH_TEST) -e CommitLog \
-a SCCS/s.ChangeSet -ot CommitLog \
|| scripts/build/genCommitLog
-libtool: $(LIBTOOL_DEPS)
- ./config.status --recheck
-
# HMS: The following seems to be a work-in-progress...
CVO=`$(srcdir)/sntp/libevent/build-aux/config.guess`
echo " "; \
fi
-FRC.CommitLog FRC.distwarn FRC.checkcvo FRC.checkhost FRC.sntp:
+FRC.CommitLog FRC.checkcvo FRC.checkhost FRC.distwarn FRC.html FRC.sntp:
@: do-nothing action prevents any default
# HMS: what was I trying to do with this?
--- /dev/null
+#! /bin/sh
+
+bk version > /dev/null 2>&1 || exit 0
+
+for i in `find * -type f -name '*.html' -print | grep -v SCCS/`
+do
+ # echo $i
+ set `bk diffs $i | wc -l`
+ lines=$1
+ case "$lines" in
+ 0) ;;
+ *) echo "Processing <$i>"
+ ../scripts/build/updateBEDate $i
+ ;;
+ esac
+done
--- /dev/null
+#! /usr/bin/env perl
+use warnings;
+use strict;
+
+# for each filename on the command line
+# get the modtime
+# make a backup of the file
+# - error if there is already a backup?
+# flush the live version(?)
+# start a line-by-line copy of the backup to the new file,
+# doing the BeginDate/EndDate substitution
+
+# <!-- #BeginDate format:En1m -->3-oct-11 18:20<!-- #EndDate -->
+# <!-- #BeginDate format:En2m -->01-Aug-2011 17:56<!-- #EndDate -->
+# without the 'm' no minutes are included.
+
+my $i;
+my $mod_time;
+my $stamp;
+my @m_abbr = qw(Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec);
+
+foreach ( @ARGV ) {
+ $i = $_;
+ $mod_time = (stat ($i))[9];
+ $stamp = localtime($mod_time);
+ my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) =
+ localtime($mod_time);
+ $year += 1900;
+
+ # print "<$i> at <$stamp>\n";
+
+ open(my $IFILE, "<", $i) or die "Cannot open < $i: $!";
+ open(my $OFILE, ">", $i.".new") or die "Cannot open > $i.new: $!";
+ while(<$IFILE>) {
+ if (/(.*<!--\s*#BeginDate\s*format:)(\S*)(\s*-->).*(<!--\s*#EndDate\s*-->.*)/) {
+ # print "Got: $_";
+ # print "as: <$1><$2><$3>...<$4>\n";
+ print { $OFILE } $1,$2,$3;
+ printf { $OFILE } "%s-%s-%s %02d:%02d", $mday,$m_abbr[$mon],$year,$hour,$min;
+ print { $OFILE } $4,"\n";
+ }
+ else {
+ print { $OFILE } $_;
+ }
+ }
+ close($IFILE);
+ close($OFILE);
+ #
+ utime(time, $mod_time, "$i.new") || die "touch $i.new failed: $!";
+ #
+ rename $i,"$i.old" || die "rename $i,$i.old failed: $!";
+ rename "$i.new",$i || die "rename $i.new,$i failed: $!";
+}