Commit 402b6e08 authored by Michael Shigorin's avatar Michael Shigorin

pkg.in/lists/Makefile: fixed committing what's copied

Was broken during dot-base introduction by wrong recipe split...
parent ca67a209
......@@ -16,7 +16,16 @@ ifneq (,$(findstring install2,$(FEATURES)))
DOTBASE := dot-base
endif
all: $(TARGET) $(GLOBAL_DEBUG) $(DOTBASE)
all: $(TARGET) $(GLOBAL_DEBUG) $(DOTBASE) copy-lists copy-groups
@if type -t git >&/dev/null && cd $(TARGET); then \
if [ -n "`git status -s`" ]; then \
git add . && \
git commit -qam "requested $(SUFFIX) copied over"; \
fi; \
cd - >&/dev/null; \
fi
copy-lists:
@# env | sort -u | grep _LISTS | xargs cp
@$(foreach V, \
$(filter %_LISTS,$(sort $(.VARIABLES))), \
......@@ -24,6 +33,11 @@ all: $(TARGET) $(GLOBAL_DEBUG) $(DOTBASE)
$(shell cp --parents -at $(TARGET) \
-- $(value $V))))
copy-groups:
@if [ -n "$(THE_GROUPS)$(MAIN_GROUPS)" ]; then \
cp -at $(TARGET) -- $(THE_GROUPS) $(MAIN_GROUPS); \
fi
# args: name, suffix, command
define dump-THEM
if [ -n "$($(1)_$(2))" ]; then echo -e "\n## $(1)_$(2)"; $(3) $($(1)_$(2)); fi;
......@@ -39,16 +53,6 @@ dot-base:
$(foreach p,SYSTEM COMMON THE BASE,$(call dump-PACKAGES,$(p))) \
$(foreach l,THE BASE,$(call dump-LISTS,$(l))) \
} | sed -re '/^[^[:space:]#]/ s/[[:space:]]+/\n/g' >$(TARGET)/.base
@if [ -n "$(THE_GROUPS)$(MAIN_GROUPS)" ]; then \
cp -at $(TARGET) -- $(THE_GROUPS) $(MAIN_GROUPS); \
fi
@if type -t git >&/dev/null && cd $(TARGET); then \
if [ -n "`git status -s`" ]; then \
git add . && \
git commit -qam "requested $(SUFFIX) copied over"; \
fi; \
cd - >&/dev/null; \
fi
# do beforehand as foreach gets expanded before recipe execution
$(TARGET):
......
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