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).
This commit is contained in:
parent
8d96a102ae
commit
aa8699c4a4
27
reports.mk
27
reports.mk
@ -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) \
|
||||
|
Loading…
Reference in New Issue
Block a user