Commit 3a5b47e7 authored by Michael Shigorin's avatar Michael Shigorin

improved logging during profile creation

- better *_LISTS printout - somewhat cleaner .base comments - more comprehensible git log messages + special handling for complex subprofiles + no need to commit build.log ;-)
parent 2b90dffa
......@@ -5,25 +5,29 @@ ifndef BUILDDIR
$(error BUILDDIR not defined)
endif
-include $(BUILDDIR)/distcfg.mk
include $(BUILDDIR)/distcfg.mk
# first rsync what's static, and make backups --
# first rsync what's static, and make backups (*~) --
# these might signal of file clashes (or plain dirt);
# then handle two more ways of implementing a feature
# NB: subprofile can be specified as src/dest
# NB: some subprofiles will be specified as src/dest
all:
@echo "** starting feature configuration"
@if test -n "$(GLOBAL_DEBUG)"; then echo "** requested: $(FEATURES)"; fi
@if test -n "$(GLOBAL_DEBUG)"; then \
echo "** target subprofiles: $(notdir $(SUBPROFILES))"; \
echo "** requested features: $(FEATURES)"; \
fi
@for dir in $(FEATURES); do \
for sub in $(SUBPROFILES); do \
dst="$${sub#*/}" && \
if test -d "$$dir/$$dst/"; then \
if rsync -ab "$$dir/$$dst/" "$(BUILDDIR)/$$dst/"; \
if rsync -qab "$$dir/$$dst/" \
"$(BUILDDIR)/$$dst/"; \
then \
type -t git >&/dev/null && \
pushd "$(BUILDDIR)/$$dst/" && \
git add . && \
git commit -qam "$@/$$dir/$$dst" ||:; \
git commit -qam "$$dir feature ($$dst subprofile part)" ||:; \
popd; \
fi; \
fi; \
......@@ -36,8 +40,16 @@ all:
if test -s "$$dir/generate.mk"; then \
$(MAKE) -C "$$dir" -f generate.mk; \
fi; \
type -t git >&/dev/null && \
pushd "$(BUILDDIR)/" && \
git add . && \
git commit -qam "$$dir feature generation complete" ||:; \
popd; \
done
@find "$(BUILDDIR)/" -name '*~' \
| sed "s,$(BUILDDIR)/,** warning: file clash: ," >&2
help:
@echo "** available features:"
@grep -h '^use/' */config.mk
# FIXME: drop or fix regarding undefined BUILDDIR being ok
#help:
# @echo "** available features:"
# @grep -h '^use/' */config.mk | fmt -sw"$$((COLUMNS>>1))" | column -t
#!/bin/sh
# TODO: invent some way to remove this inter-subprofile thing
rm -vf $WORKDIR/{squashcfg.mk,initfs}
rm -vf $WORKDIR/{squashcfg.mk,initfs,.gitignore}
#!/bin/sh
# FIXME: bring to common style
verbose()
{
......
......@@ -5,6 +5,7 @@ ifndef BUILDDIR
$(error BUILDDIR not defined)
endif
# sequential execution, no reason to haste
all:
@for dir in lists groups; do \
$(MAKE) -C $$dir; \
......
......@@ -16,7 +16,7 @@ all: $(GLOBAL_DEBUG)
type -t git >&/dev/null && \
cd $(TARGET) && \
git add . && \
git commit -qam "$(SUFFIX)"; \
git commit -qam "requested $(SUFFIX) copied over"; \
cd - >&/dev/null; \
fi
......
......@@ -18,30 +18,36 @@ all: $(TARGET) $(GLOBAL_DEBUG)
-- $(value $V))))
# construct .base packagelist for alterator-pkg
@( \
echo "### generated via pkg.in/lists/Makefile" && \
echo "### BASE_LISTS" && \
cat $(BASE_LISTS) /dev/null && \
echo "### branding" && \
echo "branding-$(BRANDING)-release" && \
echo "### COMMON_PACKAGES" && \
echo "$(COMMON_PACKAGES)" && \
echo "### BASE_PACKAGES" && \
echo "$(BASE_PACKAGES)" \
echo "## generated via pkg.in/lists/Makefile"; \
[ -n "$(BRANDING)" ] && { \
echo "branding-$(BRANDING)-release"; \
}; \
[ -n "$(BASE_LISTS)" ] && { \
echo "### BASE_LISTS"; \
cat $(BASE_LISTS); \
}; \
[ -n "$(COMMON_PACKAGES)" ] && { \
echo "## COMMON_PACKAGES"; \
echo "$(COMMON_PACKAGES)"; \
}; \
[ -n "$(BASE_PACKAGES)" ] && { \
echo "## BASE_PACKAGES"; \
echo "$(BASE_PACKAGES)"; \
}; \
) | sed -re '/^[^[:space:]#]/ s/[[:space:]]+/\n/g' >$(TARGET)/.base
@[ -z $(GROUPS) ] || cp -at $(TARGET) $(GROUPS)
@[ -z "$(GROUPS)" ] || cp -at $(TARGET) $(GROUPS)
@type -t git >&/dev/null && \
cd $(TARGET) && \
git add . && \
git commit -qam "$(SUFFIX)";
git commit -qam "requested $(SUFFIX) copied over" ||:
# do beforehand as foreach gets expanded before recipe execution
$(TARGET):
@mkdir -p $(TARGET)
# figure out *_LISTS variables and print them out nicely
debug:
@$(foreach V, \
@echo -e $(foreach V, \
$(filter %_LISTS,$(sort $(.VARIABLES))), \
$(if $(filter environment% file,$(origin $V)),\
$(warning $V=$(value $V))))
@echo "** LISTS: -- see above"
@echo "** GROUPS: $(GROUPS)"
$(shell echo '\\n"**"' $V: $(value $V)))) '\n'
......@@ -9,16 +9,16 @@ BUILDDIR := $(shell [ -s build ] \
|| bin/mktmpdir mkimage-profiles.build)
endif
# holds a postprocessor; shell test executes in particular situation
# NB: not exported, for toplevel use only
SHORTEN = $(shell [ "$(DEBUG)" != 2 -a -s build ] \
&& echo "| sed 's,$(BUILDDIR),build,'")
# even smart caching only hurts when every build goes from scratch
NO_CACHE ?= 1
export BUILDDIR NO_CACHE
# holds a postprocessor; shell test executes in particular situation
# NB: not exported, for toplevel use only
SHORTEN = $(shell [ "$(DEBUG)" != 2 -a -s build ] \
&& echo "| sed 's,$(BUILDDIR),build,'")
# step 1: initialize the off-tree mkimage profile (BUILDDIR)
profile/init: distclean
@echo -n "** initializing BUILDDIR: "
......@@ -34,7 +34,7 @@ profile/init: distclean
cd $(BUILDDIR) && \
git init -q && \
git add . && \
git commit -qam 'init'
git commit -qam 'distribution profile initialized'
@rm -f build && \
if [ -w . ]; then \
ln -sf "$(BUILDDIR)" build && \
......
......@@ -12,19 +12,20 @@ all:
@for sub in $(SUBPROFILES); do \
src="$${sub%/*}" && \
dst="$${sub#*/}" && \
neq="$${src#$$dst}" && \
rsync -a "$$src/" "$(BUILDDIR)/$$dst/" && \
type -t git >&/dev/null && \
cd "$(BUILDDIR)/$$dst/" && \
git add . && \
git commit -qam "$$sub"; \
git commit -qam "$$dst subprofile initialized$${neq:+ (using $$src)}"; \
cd - >&/dev/null; \
done
clean:
@for sub in $(SUBPROFILES); do \
dst="${sub#*/}" && \
if [ -n "$$dst" ]; then \
rm -rf "$(BUILDDIR)/$$dst" && \
if [ -n "$$dst" -a -n "$(BUILDDIR)" ]; then \
rm -r "$(BUILDDIR)/$$dst" && \
mkdir -p "$(BUILDDIR)/$$dst"; \
fi; \
done
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