summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Olbrich <m.olbrich@pengutronix.de>2010-08-02 09:40:54 +0200
committerMichael Olbrich <m.olbrich@pengutronix.de>2010-10-28 11:35:56 +0200
commitbf46911deb9c5ced647a006dff8fa2d9bb08f409 (patch)
treed0bca3c95e5a456431eb5add7e05e33c4ce37f7e
parent7dad70a7a44da6867c5b370a7298b8ac11241547 (diff)
downloadptxdist-bf46911deb9c5ced647a006dff8fa2d9bb08f409.tar.gz
ptxdist-bf46911deb9c5ced647a006dff8fa2d9bb08f409.tar.xz
[dgen] cleanup makefile list generation
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
-rw-r--r--scripts/lib/ptxd_lib_dgen.sh28
1 files changed, 14 insertions, 14 deletions
diff --git a/scripts/lib/ptxd_lib_dgen.sh b/scripts/lib/ptxd_lib_dgen.sh
index c06e569a4..a0527ca65 100644
--- a/scripts/lib/ptxd_lib_dgen.sh
+++ b/scripts/lib/ptxd_lib_dgen.sh
@@ -38,23 +38,23 @@ ptxd_dgen_configdeps() {
}
#
-# FIXME: gawk it
+# get package *.make files without duplicates
#
ptxd_dgen_rulesfiles() {
{
- if test -d "${PROJECTRULESDIR}"; then
- find "${PROJECTRULESDIR}" \
- -mindepth 1 -maxdepth 1 -name "*.make" -a \! -path "*#*" &&
- find "${RULESDIR}" \
- -mindepth 1 -maxdepth 1 -name "*.make" -a \! -path "*#*" \
- $(find "${PROJECTRULESDIR}" \
- -mindepth 1 -maxdepth 1 -name "*.make" -a \! -path "*#*" \
- -printf "! -name %f ")
- else
- find "${RULESDIR}" \
- -mindepth 1 -maxdepth 1 -name "*.make" -a \! -path "*#*"
- fi
- } | sed -e "s/\(.*\)/include \1/" > "${PTX_DGEN_RULESFILES_MAKE}.tmp"
+ local rulesdir
+ for rulesdir in ${PTXDIST_PATH_RULES//:/ }; do
+ if [ ! -d "${rulesdir}" ]; then
+ continue
+ fi
+ find "${rulesdir}" -mindepth 1 -maxdepth 1 -name "*.make" -a \! -path "*#*"
+ done
+ } | awk '{
+ n=gensub(".*/", "", "g");
+ if (!(n in names))
+ print "include", $0;
+ names[n]=1;
+ }' > "${PTX_DGEN_RULESFILES_MAKE}.tmp"
check_pipe_status
}