c4311108ea
There were heaps of "if type -t git" there already; it wasn't an unintentional mishap but rather a moderate copy-paste to get the use cases, and now these seem to have essentially settled. So time to scrap some dups. NB: the scripts in the generated profile can't rely on the contents of the metaprofile (these need to be able to work in standalone case either), so a bit of crap still lurks there.
49 lines
1.2 KiB
Makefile
49 lines
1.2 KiB
Makefile
# step 3: copy package lists referenced in distro configuration
|
|
# (and only those!) over to $(BUILDDIR)
|
|
|
|
ifndef BUILDDIR
|
|
|
|
pkgdups:
|
|
@find -type f ! -name README ! -name Makefile \
|
|
| grep -v '~$$' \
|
|
| sed 's,^\./,,g' \
|
|
| xargs ../../bin/pkgdups
|
|
|
|
%:
|
|
$(error BUILDDIR not defined)
|
|
|
|
else
|
|
|
|
include $(BUILDDIR)/distcfg.mk
|
|
SUFFIX := pkg/lists
|
|
TARGET := $(BUILDDIR)/$(SUFFIX)
|
|
|
|
all: $(TARGET) $(GLOBAL_DEBUG) $(DOTBASE) copy-lists copy-groups
|
|
@mp-commit "$(TARGET)" "requested $(SUFFIX) copied over"
|
|
|
|
copy-lists:
|
|
@# env | sort -u | grep _LISTS | xargs cp
|
|
@$(foreach V, \
|
|
$(filter %_LISTS,$(sort $(.VARIABLES))), \
|
|
$(if $(filter environment% file,$(origin $V)),\
|
|
$(shell cp --parents -at $(TARGET) \
|
|
-- $(value $V))))
|
|
|
|
copy-groups:
|
|
@if [ -n "$(THE_GROUPS)$(MAIN_GROUPS)" ]; then \
|
|
cp -at $(TARGET) -- $(THE_GROUPS) $(MAIN_GROUPS); \
|
|
fi
|
|
|
|
# do beforehand as foreach gets expanded before recipe execution
|
|
$(TARGET):
|
|
@mkdir -p $(TARGET)
|
|
|
|
# figure out *_LISTS variables and print them out nicely
|
|
debug:
|
|
@echo -e $(foreach V, \
|
|
$(filter %_LISTS,$(sort $(.VARIABLES))), \
|
|
$(if $(filter environment% file,$(origin $V)),\
|
|
$(shell echo '\\n"**"' $V: $(value $V)))) '\n'
|
|
|
|
endif
|