Michael Shigorin 720a579690 wash, rinse, repeat
install2 cleanups:

- functionally indifferent ones: particularly, install2/*/98system's
  "mkdir -p /image" was superfluous as it was done by that time already
  by sub.in/stage2/image-scripts.d/00stage1

- taken apart, prepared for tags: so far it's a mostly moot change
  since the installer cleanup scripts themselves are mostly the same as
  preceding 90cleanup was (with some additions corresponding to recent
  kernel development); it's still unclear what the mechanism for
  configuring the cleanups in effect will be, either directory/package
  regex lists or tagged scripts excluded from execution by yet another tag

fixes:

- image.in/Makefile: fix metadata related test; the actual test was
  assuming that stage1 kernel means installer, which is not the case
  since generic stage2 introduction; oh well

- 85cleanup-lowmem: a "_" too much was the culprit in destroying the
  needed translations along with those deemed superfluous; thanks go to
  Oleg Ivanov and Lenar Shakirov for finding the bug and proposing the
  fix altogether

additions:

- features.in/Makefile: reworked help target; it was rather inaccessible
  due to BUILDDIR normally undefined at the time of direct make
  invocation, and BUILDDIR is normally defined during normal builds
  anyways so let's try it this way.

- README++

daydreams:

- 01-genbasedir: we should drop bzip2 compressed pkglists some day
  but see genbasedir and apt-cdrom first, 90-pkg.sh (alterator-pkg)
  will fail miserably otherwise
2011-11-04 16:15:31 +02:00

81 lines
2.3 KiB
Makefile

# step 3: copy the needed features to $(BUILDDIR)
# (only regarding the needed subprofiles)
ifndef BUILDDIR
help all:
@echo "** BUILDDIR not defined; available features:"
@for dir in */; do \
echo -n "$$dir: "; \
grep -h '^use/' $$dir/config.mk \
| cut -f1 -d: \
| tr '\n' ' ' \
| sort -u; \
done
else
include $(BUILDDIR)/distcfg.mk
# first rsync what's static, and make backups (*~) --
# these might signal of file clashes (or plain dirt);
# second, care for toplevel and tagged script dirs;
# then handle two more ways of implementing a feature
#
# NB: some subprofiles will be specified as "src/dst"
# -- then both src/ and dst/ can hold the addons;
# still both pieces go into a single destination
### {image-,}scripts.d/ get rsynced twice :-/
### still we don't want the trimmed-down case
all:
@echo "** starting feature configuration"
@if [ -n "$(GLOBAL_DEBUG)" ]; then \
echo "** target subprofiles: $(SUBPROFILES)"; \
echo "** requested features: $(FEATURES)"; \
fi
@for feat in $(FEATURES); do \
pushd "$$feat" && \
for sub in / $(SUBPROFILES); do \
src="$${sub%/*}"; \
dst="$${sub#*/}"; \
if [ -d "$$src" ]; then rsync -qab "$$src/" "$(BUILDDIR)/$$dst/"; fi; \
if [ -d "$$dst" ]; then rsync -qab "$$dst/" "$(BUILDDIR)/$$dst/"; fi; \
for scr in {image-,}scripts.d; do \
scriptdir="$(BUILDDIR)/$$dst/$$scr/"; \
if [ -d "$$scriptdir" ]; then \
if [ -d "$$scr" ]; then \
rsync -qab "$$scr/" "$$scriptdir/"; \
fi; \
if [ -d "tagged/$$scr" ]; then \
pushd "tagged/$$scr" && \
echo "$$feat && ($$src || $$dst)" \
| tags2lists . \
| xargs -r cp -v -pLt "$$scriptdir" --; \
popd; \
fi; \
fi; \
done; \
type -t git >&/dev/null && \
pushd "$(BUILDDIR)/$$dst/" && \
git add . && \
if [ -n "$$dst" ]; then \
the="$$sub subprofile"; \
else \
the="toplevel"; \
fi; \
git commit -qam "$$feat feature ($$the part)" ||:; \
popd; \
done; \
if [ -x "generate.sh" ]; then sh generate.sh; fi; \
if [ -s "generate.mk" ]; then $(MAKE) -f generate.mk; fi; \
type -t git >&/dev/null && \
pushd "$(BUILDDIR)/" && \
git add . && \
git commit -qam "$$feat feature generation complete" ||:; \
popd; \
popd; \
done
@find "$(BUILDDIR)/" -name '*~' \
| sed "s,$(BUILDDIR)/,** warning: file clash: ," >&2
endif