diff options
author | Michael Olbrich <m.olbrich@pengutronix.de> | 2012-01-26 08:50:49 +0100 |
---|---|---|
committer | Michael Olbrich <m.olbrich@pengutronix.de> | 2012-03-13 08:40:56 +0100 |
commit | 5b9fbf2f9c112f170a30929514998f9bf85f8a9c (patch) | |
tree | 5e04fc04101cefd89f628a6dbd6a25b78b600ecc /scripts/lib/ptxd_lib_dgen.awk | |
parent | 49a704577af3ed8621654655e24b94206cdbfa3b (diff) | |
download | ptxdist-5b9fbf2f9c112f170a30929514998f9bf85f8a9c.tar.gz ptxdist-5b9fbf2f9c112f170a30929514998f9bf85f8a9c.tar.xz |
ptxd_lib_dgen: simplify deps generation
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Diffstat (limited to 'scripts/lib/ptxd_lib_dgen.awk')
-rw-r--r-- | scripts/lib/ptxd_lib_dgen.awk | 42 |
1 files changed, 16 insertions, 26 deletions
diff --git a/scripts/lib/ptxd_lib_dgen.awk b/scripts/lib/ptxd_lib_dgen.awk index 37ad3d007..91bf8635d 100644 --- a/scripts/lib/ptxd_lib_dgen.awk +++ b/scripts/lib/ptxd_lib_dgen.awk @@ -127,46 +127,36 @@ $1 ~ /^PTX_MAP_DEP/ { if (n == 0) next; - found = 0; + this_PKG_DEP = "" + this_PKG_dep = "" for (i = 1; i <= n; i++) { this_DEP = this_DEP_array[i]; - if (this_DEP in PKG_to_pkg) { - if (this_DEP ~ /^BASE$/) { - base_PKG_to_pkg[this_PKG] = PKG_to_pkg[this_PKG]; + if (!(this_DEP in PKG_to_pkg)) + continue - if (!("BASE" in PKG_to_DEP)) { - PKG_to_DEP["BASE"] = this_PKG; - } else{ - PKG_to_DEP["BASE"] = PKG_to_DEP["BASE"] ":" this_PKG; - } + if (this_DEP ~ /^BASE$/) { + base_PKG_to_pkg[this_PKG] = PKG_to_pkg[this_PKG]; - continue; - } + PKG_to_DEP["BASE"] = PKG_to_DEP["BASE"] " " this_PKG; - this_dep = PKG_to_pkg[this_DEP]; - - if (found == 0) { - found = 1; - this_PKG_DEP = this_DEP; - this_PKG_dep = this_dep; - } else { - this_PKG_DEP = this_PKG_DEP ":" this_DEP; - this_PKG_dep = this_PKG_dep ":" this_dep; - } + continue; } + + this_dep = PKG_to_pkg[this_DEP]; + + this_PKG_DEP = this_PKG_DEP " " this_DEP; + this_PKG_dep = this_PKG_dep " " this_dep; } # no deps to pkgs - if (found == 0) + if (this_PKG_DEP == "") next; PKG_to_DEP[this_PKG] = this_PKG_DEP; print "PTX_MAP_DEP_" this_PKG "=" this_PKG_DEP > MAP_DEPS; print "PTX_MAP_dep_" this_PKG "=" this_PKG_dep > MAP_DEPS; - - print "PTX_MAP_dep_" this_PKG "=" gensub(/:/, " ", "g", this_PKG_dep) \ - > MAP_ALL_MAKE; + print "PTX_MAP_dep_" this_PKG "=" this_PKG_dep > MAP_ALL_MAKE; next; } @@ -313,7 +303,7 @@ END { # add dep to pkgs we depend on # this_PKG_DEPS = PKG_to_DEP[this_PKG]; - n = split(this_PKG_DEPS, this_DEP_array, ":"); + n = split(this_PKG_DEPS, this_DEP_array, " "); for (i = 1; i <= n; i++) { this_dep = PKG_to_pkg[this_DEP_array[i]] |