Project 'ximper/mkimage-profiles' was moved to 'ximperlinux/mkimage-profiles'. Please update any links and bookmarks that may still have the old path.
Commit 5739103f authored by Anton Midyukov's avatar Anton Midyukov

Expand @KFLAVOUR in package lists

The line containing @KFLAVOUR is expanded into several lines, it is successively replaced with values from the KFLAVOURS variable. This will allow to specify kernel modules and kernel headers in lists.
parent f0e06227
#!/bin/sh -efu
kflavours="${1:-}"
[ -n "$kflavours" ] || exit 0
f="${2:-}"
[ -n "$f" ] || exit 0
grep -q @KFLAVOUR "$f" || exit 0
while IFS= read -r line; do
if [[ "$line" =~ @KFLAVOUR ]]; then
for i in $kflavours; do
echo "$line" | sed "s/@KFLAVOUR/$i/"
done
else
echo "$line"
fi
done < "$f" > "$f".temp
mv "$f".temp "$f"
......@@ -18,7 +18,7 @@ include $(BUILDDIR)/functions.mk
SUFFIX := pkg/lists
TARGET := $(BUILDDIR)/$(SUFFIX)
all: | $(TARGET) $(GLOBAL_DEBUG) copy-lists copy-groups save_packages_to_lists grep-metadep grep-archdep check-lists
all: | $(TARGET) $(GLOBAL_DEBUG) copy-lists copy-groups save_packages_to_lists grep-kflavours grep-metadep grep-archdep check-lists
@mp-commit "$(TARGET)" "requested $(SUFFIX) copied over"
# env | grep _LISTS | sort -u | xargs -r cp -t
......@@ -58,6 +58,10 @@ grep-metadep:
| xargs -r -I __ -- metadep-expander "$$APT_CACHE" __; \
fi
grep-kflavours:
@find $(TARGET) -type f \
| xargs -r -I __ -- kflavours-expander "$(KFLAVOURS)" __
# do beforehand as foreach gets expanded before recipe execution
$(TARGET):
@mkdir -p $(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