Commit aa8699c4 authored by Michael Shigorin's avatar Michael Shigorin

reports.mk: diffable logs

This is a mild generalization of what has been done by hand to figure out a problem with make-initrd-propagator-0.10-alt1: stripping anything intrinsically volatile off the build.log. The filter set isn't perfect, and the proper logging will involve mkimage tweaks as well (e.g., one generally isn't interested in instrumental chroots' population that much, so it should only be verbose at the higher debug levels).
parent 8d96a102
......@@ -17,7 +17,7 @@ ifneq (1,$(NUM_TARGETS))
SHORTEN := >/dev/null
endif
all: reports/targets reports/scripts
all: reports/targets reports/scripts reports/cleanlog
@if [ -n "$(IMAGE_OUTPATH)" ]; then \
cp -a "$(REPORTDIR)" "$(LOGDIR)/$(IMAGE_OUTFILE).reports"; \
fi
......@@ -25,6 +25,31 @@ all: reports/targets reports/scripts
reports/prep:
@mkdir -p "$(REPORTDIR)"
# try to drop common noise rendering diff(1) mostly useless
reports/cleanlog: reports/prep
@OUT="$(REPORTDIR)/$(@F).log"; \
sed -r \
-e 's,$(BUILDDIR),,g' \
-e '/\/var\/lib\/apt\/lists/d' \
-e 's/... .. ..:..:..//g' \
-e 's/\[[0-9]+\]//g' \
-e '/^(Reading Package Lists|Building Dependency Tree)/d' \
-e '/^(Fetched|Need to get|After unpacking) /d' \
-e '/^(Preparing packages for installation|Done\.)/d' \
-e '/^hsh(|-(initroot|install|fakedev|(mk|rm)chroot|run)): /d' \
-e '/^(hasher-priv|mkaptbox|(mk|rm)dir): /d' \
-e '/^mki-((invalidate-|)cache|check-obsolete|prepare): /d' \
-e '/^(mode of|changed (group|ownership)|removed) /d' \
-e '/^chroot\/.in\//d' \
-e '/ has started executing\.$$/d' \
-e '/\/var\/log\/apt\.log$$/d' \
-e '/\/usr\/share\/apt\/scripts\/log\.lua/d' \
-e '/\.rpm$$/d' \
-e "/' -> '/d" \
< $(BUILDLOG) \
> "$(REPORTDIR)/$(@F).log" \
&& echo "** diffable log: $$OUT" $(SHORTEN)
reports/scripts: reports/prep
@OUT="$(REPORTDIR)/$(@F).log"; \
grep "^mki.*scripts: Run: " $(BUILDLOG) \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment