From 5b9fbf2f9c112f170a30929514998f9bf85f8a9c Mon Sep 17 00:00:00 2001 From: Michael Olbrich Date: Thu, 26 Jan 2012 08:50:49 +0100 Subject: ptxd_lib_dgen: simplify deps generation Signed-off-by: Michael Olbrich --- scripts/lib/ptxd_lib_dgen.awk | 42 ++++++++++++++++-------------------------- 1 file changed, 16 insertions(+), 26 deletions(-) (limited to 'scripts/lib/ptxd_lib_dgen.awk') 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]] -- cgit v1.2.3