reports: DEBUG must be enabled, CHECK must be disabled
We cannot get IMAGE_OUTPATH from the build.log, and there is currently no other mechanism. Creating a CHECK directory was a bad idea. It should have been created only for CHECK, but it was always created when DEBUG was not enabled. So it's better to just issue a warning.
This commit is contained in:
parent
835e895eca
commit
b627d75552
10
Makefile
10
Makefile
@ -2,6 +2,14 @@
|
||||
# iterate over multiple goals/arches,
|
||||
# collect proceedings
|
||||
|
||||
ifeq (,$(CHECK))
|
||||
ifeq (,$(DEBUG))
|
||||
ifneq (,$(REPORT))
|
||||
$(warning REPORT is disabled, DEBUG must be enabled for this)
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
ifndef BRANCH
|
||||
BRANCH := $(shell rpm --eval %_priority_distbranch | cut -d _ -f 1)
|
||||
export BRANCH
|
||||
@ -69,7 +77,7 @@ SHELL = /bin/bash
|
||||
fi; \
|
||||
say "** ARCH: $$ARCH"; \
|
||||
fi; \
|
||||
if [ -n "$(REPORT)" ]; then \
|
||||
if [ -n "$(REPORT)" ] && [ -n "$(DEBUG)" ] && [ -z "$(CHECK)" ]; then \
|
||||
REPORT_PATH=$$(mktemp --tmpdir mkimage-profiles.report.XXXXXXX); \
|
||||
$(MAKE) -f main.mk ARCH=$$ARCH $@ | report-filter > $$REPORT_PATH || exit 1; \
|
||||
$(MAKE) -f reports.mk ARCH=$$ARCH REPORT=$(REPORT) REPORT_PATH=$$REPORT_PATH; \
|
||||
|
@ -122,6 +122,7 @@ $HOME/.mkimage/profiles.mk.
|
||||
|
||||
* REPORT
|
||||
** запрашивает создание отчётов о собранном образе
|
||||
** требует включения DEBUG и отключения CHECK
|
||||
** значение:
|
||||
** пусто (по умолчанию) - создание отчёта выключено
|
||||
** 2 - создать архив из каталога отчёта
|
||||
|
@ -1,5 +1,7 @@
|
||||
# enable make target tracing
|
||||
|
||||
ifeq (,$(CHECK))
|
||||
ifneq (,$(DEBUG))
|
||||
ifneq (,$(REPORT))
|
||||
TRACE_PREFIX := trace:building
|
||||
OLD_SHELL := $(SHELL)
|
||||
@ -7,3 +9,5 @@ SHELL = $(info $(TRACE_PREFIX) $@$(if $^$|, -> $^ $|))$(OLD_SHELL)
|
||||
# piggyback BUILDDIR back into supervising environment
|
||||
$(info $(TRACE_PREFIX) BUILDDIR = $(BUILDDIR))
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
21
reports.mk
21
reports.mk
@ -14,12 +14,6 @@ LOGDIR := $(shell sed -n 's/^LOGDIR = \(.*\)/\1/p' $(BUILDLOG))
|
||||
ifeq (,$(LOGDIR))
|
||||
LOGDIR := $(shell sed -n 's/^LOGDIR ?= \(.*\)/\1/p' $(BUILDCFG))
|
||||
endif
|
||||
ifeq (,$(IMAGE_OUTPATH))
|
||||
TARGET_NAME := $(shell sed -n 's/^IMAGE_NAME = \(.*\)/\1/p' $(BUILDDIR)/distcfg.mk)
|
||||
TARGET_TYPE := $(shell sed -n 's/^IMAGE_TYPE = \(.*\)/\1/p' $(BUILDDIR)/distcfg.mk)
|
||||
TARGET_NAME := $(TARGET_NAME).$(TARGET_TYPE)
|
||||
LOGDIR := $(LOGDIR)/CHECK
|
||||
endif
|
||||
|
||||
# for a multi-image build there's no sense to refer to buildroot
|
||||
# contained reports as these are very ephemeral between builds
|
||||
@ -36,7 +30,6 @@ define report_body
|
||||
fi; }
|
||||
endef
|
||||
|
||||
ifneq (,$(IMAGE_OUTPATH))
|
||||
all: reports/targets reports/scripts reports/cleanlog \
|
||||
reports/contents reports/packages
|
||||
@rm -fr "$(LOGDIR)/$(IMAGE_OUTFILE).reports"
|
||||
@ -49,20 +42,6 @@ ifeq (2,$(REPORT))
|
||||
@cd "$(LOGDIR)" && tar -cf "$(IMAGE_OUTFILE).reports.tar" "$(IMAGE_OUTFILE).reports" && \
|
||||
rm -r "$(IMAGE_OUTFILE).reports"
|
||||
endif
|
||||
else
|
||||
all: reports/prep reports/targets reports/scripts
|
||||
@rm -fr "$(LOGDIR)/$(TARGET_NAME).reports"
|
||||
@cp -a "$(REPORTDIR)" "$(LOGDIR)/$(TARGET_NAME).reports"
|
||||
@if [ -f "$(BUILDCFG)" ]; then \
|
||||
cp -a "$(BUILDCFG)" "$(LOGDIR)/$(TARGET_NAME).reports/build.cfg"; \
|
||||
fi
|
||||
@find $(BUILDDIR)/pkg/ -type f | sed 's:$(BUILDDIR)/pkg/::' > \
|
||||
"$(LOGDIR)/$(TARGET_NAME).reports/pkg.list"
|
||||
ifeq (2,$(REPORT))
|
||||
@cd "$(LOGDIR)" && tar -cf "$(TARGET_NAME).reports.tar" "$(TARGET_NAME).reports" && \
|
||||
rm -r "$(TARGET_NAME).reports"
|
||||
endif
|
||||
endif
|
||||
|
||||
reports/prep:
|
||||
@mkdir -p "$(REPORTDIR)" "$(LOGDIR)"
|
||||
|
Loading…
x
Reference in New Issue
Block a user