Commit 292caede authored by Michael Shigorin's avatar Michael Shigorin

pkg/lists: fix the fix (handle no lists too)

cp(1) would get confusing arguments with no files to copy if there are no lists to handle; employ xargs(1) as promised to handle this properly.
parent eadc204b
......@@ -21,12 +21,12 @@ TARGET := $(BUILDDIR)/$(SUFFIX)
all: $(TARGET) $(GLOBAL_DEBUG) $(DOTBASE) copy-lists copy-groups
@mp-commit "$(TARGET)" "requested $(SUFFIX) copied over"
# env | sort -u | grep _LISTS | xargs cp
# env | sort -u | grep _LISTS | xargs -r cp -t
copy-lists:
@cp --parents -at $(TARGET) -- \
$(foreach V, \
$(filter %_LISTS,$(sort $(.VARIABLES))), \
$(if $(filter environment% file,$(origin $V)),$($V)))
@echo $(foreach V, \
$(filter %_LISTS,$(sort $(.VARIABLES))), \
$(if $(filter environment% file,$(origin $V)),$($V))) \
| xargs -r -- cp --parents -at $(TARGET) --
copy-groups:
@if [ -n "$(THE_GROUPS)$(MAIN_GROUPS)" ]; then \
......
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