From 402b6e080bce8774f0ccc86fe4ac47a040233cf5 Mon Sep 17 00:00:00 2001 From: Michael Shigorin Date: Mon, 6 Feb 2012 21:49:31 +0200 Subject: [PATCH] pkg.in/lists/Makefile: fixed committing what's copied Was broken during dot-base introduction by wrong recipe split... --- pkg.in/lists/Makefile | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/pkg.in/lists/Makefile b/pkg.in/lists/Makefile index 7bf48348..ccda1abd 100644 --- a/pkg.in/lists/Makefile +++ b/pkg.in/lists/Makefile @@ -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):