When files in the projectroot directory are being used in install_copy() and
install_alternative() then there are no dependencies to these files.

This is being solved by storing all dependencies of the targetinstall
stage in a seperate state/<package>.deps file.
These state/<package>.deps files are included in the top-level ptxdist makefile
and this makes ptxdist properly handle the dependencies.

Signed-off-by: Remy Bohmer <li...@bohmer.net>
Signed-off-by: Bart vdr. Meulen <bartvdrmeu...@gmail.com>
---
 rules/other/Toplevel.make            |    3 +++
 scripts/lib/ptxd_make_install.sh     |    3 ++-
 scripts/lib/ptxd_make_xpkg_common.sh |    1 +
 scripts/lib/ptxd_make_xpkg_pkg.sh    |   10 ++++++++++
 4 files changed, 16 insertions(+), 1 deletions(-)

diff --git a/rules/other/Toplevel.make b/rules/other/Toplevel.make
index 1218229..35785e0 100644
--- a/rules/other/Toplevel.make
+++ b/rules/other/Toplevel.make
@@ -86,6 +86,9 @@ PTX_PACKAGES_SELECTED := \
 # might be non existent
 include $(wildcard $(POSTRULESDIR)/*.make)
 include $(wildcard $(PROJECTPOSTRULESDIR)/*.make)
+# install_alternative and install_copy has some configuration defined
+# dependencies. include the files specifying these dependencies.
+include $(wildcard $(STATEDIR)/*.deps)
 
 # ----------------------------------------------------------------------------
 # just the "print" target
diff --git a/scripts/lib/ptxd_make_install.sh b/scripts/lib/ptxd_make_install.sh
index 539a67a..93209e9 100644
--- a/scripts/lib/ptxd_make_install.sh
+++ b/scripts/lib/ptxd_make_install.sh
@@ -45,7 +45,8 @@ ptxd_make_install_init() {
     rm -fr   -- \
        "${pkg_xpkg_tmp}" \
        "${pkg_xpkg_cmds}" \
-       "${pkg_xpkg_perms}" &&
+       "${pkg_xpkg_perms}" \
+       "${pkg_xpkg_install_deps}" &&
     mkdir -p -- "${pkg_ipkg_control_dir}" &&
     touch "${pkg_xpkg_cmds}" || return
 
diff --git a/scripts/lib/ptxd_make_xpkg_common.sh 
b/scripts/lib/ptxd_make_xpkg_common.sh
index 89cde2c..a756f20 100644
--- a/scripts/lib/ptxd_make_xpkg_common.sh
+++ b/scripts/lib/ptxd_make_xpkg_common.sh
@@ -40,6 +40,7 @@ ptxd_make_xpkg_init() {
     pkg_xpkg_license_file="${ptx_state_dir}/${pkg_xpkg}.license"
 
     # packaging stuff
+    pkg_xpkg_install_deps="${ptx_state_dir}/${pkg_xpkg}.deps"
     pkg_xpkg_perms="${ptx_state_dir}/${pkg_xpkg}.perms"
     pkg_xpkg_cmds="${ptx_state_dir}/${pkg_xpkg}.cmds"
     pkg_xpkg_tmp="${ptx_pkg_dir}/${pkg_xpkg}.tmp"
diff --git a/scripts/lib/ptxd_make_xpkg_pkg.sh 
b/scripts/lib/ptxd_make_xpkg_pkg.sh
index bdc100a..a415292 100644
--- a/scripts/lib/ptxd_make_xpkg_pkg.sh
+++ b/scripts/lib/ptxd_make_xpkg_pkg.sh
@@ -72,6 +72,16 @@ ptxd_install_setup_src() {
 
     for src in "${li...@]}"; do
        if [ -e "${src}" ]; then
+               # Since the dependency to the source files is dynamic we store
+               # the dependency information in a dependency file that can be
+               # included in the make files itself.
+               deprule="${ptx_state_dir}/${pkg_label}.targetinstall: ${src}"
+
+               # Make the deps rule robust for varying installation paths, and
+               # make the deps rules file more readable.
+               deprule=${deprule//${PTXDIST_TOPDIR}/\$(PTXDIST_TOPDIR)}
+               deprule=${deprule//${PTXDIST_WORKSPACE}/\$(PTXDIST_WORKSPACE)}
+               echo "${deprule}" >> ${pkg_xpkg_install_deps}
            return
        fi
     done
-- 
1.7.0.4


-- 
ptxdist mailing list
ptxdist@pengutronix.de

Reply via email to