diff options
author | Michael Olbrich <m.olbrich@pengutronix.de> | 2019-10-03 18:59:35 +0200 |
---|---|---|
committer | Michael Olbrich <m.olbrich@pengutronix.de> | 2019-10-03 18:59:35 +0200 |
commit | 2e2242356f0bc72a56bc52259d497fa143f27e0a (patch) | |
tree | a5db36149ed305f36daeaa0532f8ca010ec97abc | |
parent | 3223062eac8b7cba1c816078c174fc2bc77d2bb7 (diff) | |
download | ptxdist-2e2242356f0bc72a56bc52259d497fa143f27e0a.tar.gz ptxdist-2e2242356f0bc72a56bc52259d497fa143f27e0a.tar.xz |
ptxd_make_world_patchin: allow specifying a custom patch directory
If <PKG>_PATCHES is set, then it is used instead of $(<PKG>) to find the
patch directory. It must be a relativ directory name that can be found in
the usual search path.
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
-rw-r--r-- | rules/post/ptxd_make_world_common.make | 1 | ||||
-rw-r--r-- | scripts/lib/ptxd_lib_dgen.awk | 12 | ||||
-rw-r--r-- | scripts/lib/ptxd_make_world_patchin.sh | 3 |
3 files changed, 11 insertions, 5 deletions
diff --git a/rules/post/ptxd_make_world_common.make b/rules/post/ptxd_make_world_common.make index 9665b2ebc..a63466e21 100644 --- a/rules/post/ptxd_make_world_common.make +++ b/rules/post/ptxd_make_world_common.make @@ -78,6 +78,7 @@ world/env/impl = \ pkg_ref_config="$(call ptx/escape,$($(1)_REF_CONFIG))" \ pkg_path="$(call ptx/escape,$($(1)_PATH))" \ pkg_patch_series="$(call ptx/escape,$(call remove_quotes, $(PTXCONF_$(strip $(1))_SERIES)))"\ + pkg_patch_dir="$(call ptx/escape,$($(1)_PATCH_DIR))" \ pkg_src="$(call ptx/escape,$($(1)_SOURCE))" \ pkg_srcs="$(call ptx/escape,$($(1)_SOURCES))" \ pkg_md5s="$(call ptx/escape,$(foreach s,$($(1)_SOURCES),$($($(s))_MD5):))"\ diff --git a/scripts/lib/ptxd_lib_dgen.awk b/scripts/lib/ptxd_lib_dgen.awk index 2c6c80a69..024a3dc48 100644 --- a/scripts/lib/ptxd_lib_dgen.awk +++ b/scripts/lib/ptxd_lib_dgen.awk @@ -358,10 +358,16 @@ function write_deps_pkg_all(this_PKG, this_pkg) { function write_deps_pkg_active_cfghash(this_PKG, this_pkg) { print "ifneq ($(" this_PKG "),)" > DGEN_DEPS_POST; - print this_PKG "_PATCHES := $(call ptx/in-path,PTXDIST_PATH_PATCHES,$(" this_PKG "))" > DGEN_DEPS_POST; - print "ifneq ($(wildcard $(" this_PKG "_PATCHES)),)" > DGEN_DEPS_POST; + print "ifneq ($(" this_PKG "_PATCHES),)" > DGEN_DEPS_POST; + print this_PKG "_PATCH_DIR := $(call ptx/in-path,PTXDIST_PATH_PATCHES,$(" this_PKG "_PATCHES))" > DGEN_DEPS_POST; + print "else" > DGEN_DEPS_POST; + print this_PKG "_PATCH_DIR := $(call ptx/in-path,PTXDIST_PATH_PATCHES,$(" this_PKG "))" > DGEN_DEPS_POST; + print "endif" > DGEN_DEPS_POST; + print "ifeq ($(" this_PKG "_PATCH_DIR),)" > DGEN_DEPS_POST; + print "undefine " this_PKG "_PATCH_DIR" > DGEN_DEPS_POST; + print "else" > DGEN_DEPS_POST; print "ifeq ($(wildcard " PTXDIST_TEMPDIR "/pkghash-" this_PKG "_EXTRACT.done),)" > DGEN_DEPS_POST; - print "$(call ptx/force-sh, find '$(" this_PKG "_PATCHES)' -type f ! -name '.*' | sort | xargs cat | tee " \ + print "$(call ptx/force-sh, find '$(" this_PKG "_PATCH_DIR)' -type f ! -name '.*' | sort | xargs cat | tee " \ PTXDIST_TEMPDIR "/pkghash-" this_PKG "_EXTRACT >> " PTXDIST_TEMPDIR "/pkghash-" this_PKG \ " && touch " PTXDIST_TEMPDIR "/pkghash-" this_PKG "_EXTRACT.done )" > DGEN_DEPS_POST; print "endif" > DGEN_DEPS_POST; diff --git a/scripts/lib/ptxd_make_world_patchin.sh b/scripts/lib/ptxd_make_world_patchin.sh index e181e1cb8..1e11249e0 100644 --- a/scripts/lib/ptxd_make_world_patchin.sh +++ b/scripts/lib/ptxd_make_world_patchin.sh @@ -479,10 +479,9 @@ ptxd_make_world_patchin_init() "is no longer supported. Move patches to" \ "$(ptxd_print_path "$(dirname "${ptxd_reply}")")" fi - if ! ptxd_in_path PTXDIST_PATH_PATCHES ${pkg_pkg} ; then + if [ -z "${pkg_patch_dir}" ]; then return fi - pkg_patch_dir="${ptxd_reply}" } export -f ptxd_make_world_patchin_init |