summaryrefslogtreecommitdiffstats
path: root/scripts/lib
diff options
context:
space:
mode:
authorMichael Olbrich <m.olbrich@pengutronix.de>2016-04-29 17:35:12 +0200
committerMichael Olbrich <m.olbrich@pengutronix.de>2016-05-01 09:12:26 +0200
commitc6a03d478479f1dda8c4c9cefcde72dd531ae390 (patch)
tree4284cc9beb89036b8313f5afdc8f72dbd2947540 /scripts/lib
parent4585d41f5ec80ee704ec474d824ee196af423df2 (diff)
downloadptxdist-c6a03d478479f1dda8c4c9cefcde72dd531ae390.tar.gz
ptxdist-c6a03d478479f1dda8c4c9cefcde72dd531ae390.tar.xz
ptxd_lib_dgen: handle dependencies from ptxconfig and platformconfig for the same package
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Diffstat (limited to 'scripts/lib')
-rw-r--r--scripts/lib/ptxd_lib_dgen.awk40
1 files changed, 31 insertions, 9 deletions
diff --git a/scripts/lib/ptxd_lib_dgen.awk b/scripts/lib/ptxd_lib_dgen.awk
index 4b9c065fa..f0af04278 100644
--- a/scripts/lib/ptxd_lib_dgen.awk
+++ b/scripts/lib/ptxd_lib_dgen.awk
@@ -132,7 +132,6 @@ $1 ~ /^PTX_MAP_._DEP/ {
next;
this_PKG_DEP = ""
- this_PKG_dep = ""
for (i = 1; i <= n; i++) {
this_DEP = this_DEP_array[i];
@@ -150,10 +149,7 @@ $1 ~ /^PTX_MAP_._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
@@ -161,12 +157,9 @@ $1 ~ /^PTX_MAP_._DEP/ {
next;
if (dep_type == "R")
- PKG_to_R_DEP[this_PKG] = this_PKG_DEP;
+ PKG_to_R_DEP[this_PKG] = PKG_to_R_DEP[this_PKG] this_PKG_DEP;
else
- PKG_to_B_DEP[this_PKG] = this_PKG_DEP;
- print "PTX_MAP_" dep_type "_DEP_" this_PKG "=" this_PKG_DEP > MAP_DEPS;
- print "PTX_MAP_" dep_type "_dep_" this_PKG "=" this_PKG_dep > MAP_DEPS;
- print "PTX_MAP_" dep_type "_dep_" this_PKG "=" this_PKG_dep > MAP_ALL_MAKE;
+ PKG_to_B_DEP[this_PKG] = PKG_to_B_DEP[this_PKG] this_PKG_DEP;
next;
}
@@ -206,6 +199,33 @@ function write_include(this_PKG) {
print "include " PKG_to_filename[this_PKG] > DGEN_RULESFILES_MAKE;
}
+function write_maps(this_PKG, dep_type) {
+ if (dep_type == "R")
+ this_PKG_DEP = PKG_to_R_DEP[this_PKG];
+ else
+ this_PKG_DEP = PKG_to_B_DEP[this_PKG];
+
+ if (this_PKG_DEP == "")
+ return;
+
+ n = split(this_PKG_DEP, this_DEP_array, " ");
+ asort(this_DEP_array, this_DEP_array);
+ this_PKG_dep = ""
+ this_PKG_DEP = ""
+ last = ""
+ for (i = 1; i <= n; i++) {
+ if (last == this_DEP_array[i])
+ continue
+ this_PKG_DEP = this_PKG_DEP " " this_DEP_array[i];
+ this_PKG_dep = this_PKG_dep " " PKG_to_pkg[this_DEP_array[i]];
+ last = this_DEP_array[i]
+ }
+
+ print "PTX_MAP_" dep_type "_DEP_" this_PKG "=" this_PKG_DEP > MAP_DEPS;
+ print "PTX_MAP_" dep_type "_dep_" this_PKG "=" this_PKG_dep > MAP_DEPS;
+ print "PTX_MAP_" dep_type "_dep_" this_PKG "=" this_PKG_dep > MAP_ALL_MAKE;
+}
+
function write_vars_pkg_all(this_PKG, this_pkg, prefix) {
#
# post install hooks
@@ -389,6 +409,8 @@ END {
this_pkg_prefix = gensub(/^(host-|cross-|image-|).*/, "\\1", 1, this_pkg)
write_include(this_PKG)
+ write_maps(this_PKG, "R")
+ write_maps(this_PKG, "B")
if (this_pkg_prefix != "image-") {
write_deps_pkg_all(this_PKG, this_pkg)
write_vars_pkg_all(this_PKG, this_pkg, this_pkg_prefix)