From 5ab4c14d56369b04fee1ae375ce0c6435be5c70b Mon Sep 17 00:00:00 2001 From: Jon Ringle Date: Thu, 26 May 2011 14:29:37 -0400 Subject: lndir: add support for lndir:// URL Use lndir for local external projects referenced by lndir:// URL lndir will create a shadow directory tree of the source tree populated with symlinks of all the files contained in the source tree. Building from the lndir created shadow tree will result in all files created by the build to be created in the shadow tree and leaving the source tree prestine. This is useful when building for multiple archs. Signed-off-by: Jon Ringle Signed-off-by: Michael Olbrich --- scripts/lib/ptxd_lib_dgen.awk | 7 ++++++- scripts/lib/ptxd_make_world_extract.sh | 14 ++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/scripts/lib/ptxd_lib_dgen.awk b/scripts/lib/ptxd_lib_dgen.awk index 27b6ce265..e9e6f79a0 100644 --- a/scripts/lib/ptxd_lib_dgen.awk +++ b/scripts/lib/ptxd_lib_dgen.awk @@ -322,12 +322,17 @@ END { } # - # conditional dependency on autogen script + # conditional dependencies # print "ifneq ($(" this_PKG "),)" > DGEN_DEPS_POST; + # on autogen script print "ifneq ($(call autogen_dep,$(" this_PKG ")),)" > DGEN_DEPS_POST; print "$(STATEDIR)/" this_pkg ".extract: $(STATEDIR)/autogen-tools" > DGEN_DEPS_POST; print "endif" > DGEN_DEPS_POST; + # on lndir + print "ifneq ($(findstring lndir://,$(" this_PKG "_URL)),)" > DGEN_DEPS_POST; + print "$(STATEDIR)/" this_pkg ".extract: $(STATEDIR)/host-lndir.install.post" > DGEN_DEPS_POST; + print "endif" > DGEN_DEPS_POST; print "endif" > DGEN_DEPS_POST; # diff --git a/scripts/lib/ptxd_make_world_extract.sh b/scripts/lib/ptxd_make_world_extract.sh index d3e401e09..1eb260af9 100644 --- a/scripts/lib/ptxd_make_world_extract.sh +++ b/scripts/lib/ptxd_make_world_extract.sh @@ -21,6 +21,20 @@ ptxd_make_world_extract() { pkg_extract_dir="${pkg_deprecated_extract_dir:-${pkg_extract_dir}}" case "${pkg_url}" in + lndir://*) + local url="${pkg_url//lndir:\/\//}" + if [ -n "${pkg_src}" ]; then + ptxd_bailout "_SOURCE must not be defined when using a lndir:// URL!" + fi + if [ -d "${url}" ]; then + echo "local directory using lndir" + mkdir -p "${pkg_dir}" + lndir "$(ptxd_abspath "${url}")" "${pkg_dir}" + return + else + ptxd_bailout "the URL '${pkg_url}' points to non existing directory." + fi + ;; file://*) local url="${pkg_url//file:\/\//}" if [ -n "${pkg_src}" ]; then -- cgit v1.2.3