adjust ChangeLog generation to git
now that log generation is cheap, don't store it in the SCM any more.
(cherry picked from commit 474ce08b3a
)
This commit is contained in:
parent
2074a7ab03
commit
b6ae600419
54
Makefile.am
54
Makefile.am
|
@ -2,11 +2,57 @@ SUBDIRS = src
|
|||
bin_SCRIPTS = get-cert
|
||||
EXTRA_DIST = debian isync.spec $(bin_SCRIPTS)
|
||||
|
||||
LOG_PL = \
|
||||
use POSIX qw(strftime); \
|
||||
use Date::Parse; \
|
||||
use Text::Wrap; \
|
||||
$$Text::Wrap::columns = 72; \
|
||||
while (defined($$_ = <>)) { \
|
||||
/^commit / or die "commit missing: $$_"; \
|
||||
<> =~ /^log size (\d+)$$/ or die "wrong size"; \
|
||||
$$len = $$1; \
|
||||
read(STDIN, $$log, $$len) == $$len or die "unexpected EOF"; \
|
||||
$$log =~ s/^Author: ([^>]+>)\nDate: (\d{4}-\d\d-\d\d \d\d:\d\d:\d\d [-+]\d{4})\n(.*)$$/$$3/s or die "unexpected log format"; \
|
||||
$$author = $$1; $$date = str2time($$2); \
|
||||
scalar(<>); \
|
||||
@files = (); \
|
||||
$$pfx = ""; \
|
||||
while (defined($$l = <>) and $$l ne "\n") { \
|
||||
chomp $$l; \
|
||||
next if ($$l =~ m,^(ChangeLog$$|NEWS$$|TODO$$|debian/),); \
|
||||
if (!@files) { \
|
||||
$$pfx = $$l; \
|
||||
$$pfx =~ s,/?[^/]+$$,,; \
|
||||
} else { \
|
||||
while (length($$pfx)) { \
|
||||
$$l =~ m,^\Q$$pfx/\E, and last; \
|
||||
$$pfx =~ s,/?[^/]+$$,,; \
|
||||
} \
|
||||
} \
|
||||
push @files, $$l; \
|
||||
} \
|
||||
next if (!@files); \
|
||||
print strftime("%F %H:%M", gmtime($$date))." ".$$author."\n\n"; \
|
||||
if (@files > 1 and ($$len = length($$pfx))) { \
|
||||
@efiles = (); \
|
||||
for $$f (@files) { push @efiles, substr($$f, $$len + 1); } \
|
||||
$$fstr = $$pfx."/: "; \
|
||||
} else { \
|
||||
@efiles = @files; \
|
||||
$$fstr = ""; \
|
||||
} \
|
||||
print wrap("\t* ", "\t ", $$fstr.join(", ", @efiles).":")."\n"; \
|
||||
$$log =~ s, +$$,,gm; \
|
||||
$$log =~ s,^ ,\t,gm; \
|
||||
print $$log."\n"; \
|
||||
}
|
||||
|
||||
$(srcdir)/ChangeLog: log
|
||||
log:
|
||||
@perl -p -e "s/^(\\S+)\\s+(\\S.+\\S)\\s+(\\S+)\\s*\$$/\$$1:'\$$2 <\$$3>'\\n/" < ../CVSROOT/accounts > .usermap
|
||||
@if test -f CVS/Tag; then tag=`cut -c2- CVS/Tag`; else tag=trunk; fi; \
|
||||
cvs2cl -U .usermap -F $$tag --no-wrap --separate-header -I ChangeLog -I NEWS -I TODO -I debian/
|
||||
@rm -f .usermap ChangeLog.bak
|
||||
@test -z "$(srcdir)" || cd $(srcdir) && \
|
||||
( ! test -d .git || \
|
||||
git log --date=iso --log-size --name-only | \
|
||||
perl -e '$(LOG_PL)' > ChangeLog )
|
||||
|
||||
deb:
|
||||
CFLAGS="-O2 -mcpu=i686" fakeroot debian/rules binary
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#! /bin/sh
|
||||
set -e -v
|
||||
make -f Makefile.am log
|
||||
aclocal
|
||||
autoheader
|
||||
automake --add-missing
|
||||
|
|
Loading…
Reference in New Issue
Block a user