diff options
author | Michael Olbrich <m.olbrich@pengutronix.de> | 2012-02-08 08:41:03 +0100 |
---|---|---|
committer | Michael Olbrich <m.olbrich@pengutronix.de> | 2012-02-14 08:58:04 +0100 |
commit | 6d6fa3122fb8948f88bb7121c2ee2c0363eabb83 (patch) | |
tree | 2b28740bc270c41f8a90e7291e860029962d94ef | |
parent | dae5e9c2b04b0a7f95b4a291130b9518839b91f0 (diff) | |
download | ptxdist-6d6fa3122fb8948f88bb7121c2ee2c0363eabb83.tar.gz ptxdist-6d6fa3122fb8948f88bb7121c2ee2c0363eabb83.tar.xz |
ptxd_install_setup_src: improve targetinstall dependencies
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
-rw-r--r-- | scripts/lib/ptxd_make_xpkg_pkg.sh | 38 |
1 files changed, 22 insertions, 16 deletions
diff --git a/scripts/lib/ptxd_make_xpkg_pkg.sh b/scripts/lib/ptxd_make_xpkg_pkg.sh index d57817b08..93552f65c 100644 --- a/scripts/lib/ptxd_make_xpkg_pkg.sh +++ b/scripts/lib/ptxd_make_xpkg_pkg.sh @@ -80,25 +80,31 @@ ptxd_install_setup_src() { "${src}" \ ) fi - + # 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. + # We depend on the first available file, which is the one that will + # be used. If one with a higher priority is created, the dependency + # will cause the package to be recreated. + local deprule="" for src in "${list[@]}"; do - if [ -e "${src}" ]; then - # don't provide dependencies for files in PTXDIST_PLATFORMDIR. - if [ "${src}" = "${src#${PTXDIST_PLATFORMDIR}}" ]; 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_stamp}: \$(wildcard ${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} - fi - return + # don't provide dependencies for files in PTXDIST_PLATFORMDIR. + if [ "${src}" != "${src#${PTXDIST_PLATFORMDIR}}" -o -z "${src}" ]; then + deprule="${deprule} ${src}" fi done + if [ -n "${deprule}" ]; then + deprule="${ptx_state_dir}/${pkg_stamp}: \$(firstword \$(wildcard ${deprule}))" + # 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} + fi + if ptxd_get_path "${list[@]}"; then + src="${ptxd_reply}" + return + fi echo -e "\nNo suitable file '${dst}' could be found in any of these locations:" local orig_IFS="${IFS}" |