summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorMichael Olbrich <m.olbrich@pengutronix.de>2019-05-31 10:53:42 +0200
committerMichael Olbrich <m.olbrich@pengutronix.de>2019-06-04 21:09:59 +0200
commitc98e2ba9594cd07257fa6dc648b3ab8e5b4df1cb (patch)
treea78a6bc7c9a5d361e182a08c8c0fd87920515d41 /scripts
parentf5aee262159f9b4b1eb3f8f9bf4f457afaab30be (diff)
downloadptxdist-c98e2ba9594cd07257fa6dc648b3ab8e5b4df1cb.tar.gz
ptxdist-c98e2ba9594cd07257fa6dc648b3ab8e5b4df1cb.tar.xz
detect patch changes and reextract when needed
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/lib/ptxd_lib_dgen.awk15
-rw-r--r--scripts/lib/ptxd_make_clean.sh12
-rw-r--r--scripts/lib/ptxd_make_world_prepare.sh2
3 files changed, 28 insertions, 1 deletions
diff --git a/scripts/lib/ptxd_lib_dgen.awk b/scripts/lib/ptxd_lib_dgen.awk
index 645064f83..2c10aca6f 100644
--- a/scripts/lib/ptxd_lib_dgen.awk
+++ b/scripts/lib/ptxd_lib_dgen.awk
@@ -342,6 +342,15 @@ 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 "ifeq ($(wildcard " PTXDIST_TEMPDIR "/pkghash-" this_PKG ".done),)" > DGEN_DEPS_POST;
+ print "$(call ptx/force-sh, find '$(" this_PKG "_PATCHES)' -type f ! -name '.*' | sort | xargs cat | tee " \
+ PTXDIST_TEMPDIR "/pkghash-" this_PKG "_EXTRACT >> " PTXDIST_TEMPDIR "/pkghash-" this_PKG ")" > DGEN_DEPS_POST;
+ print "endif" > DGEN_DEPS_POST;
+ print "endif" > DGEN_DEPS_POST;
+ print "endif" > DGEN_DEPS_POST;
print "ifneq ($(filter /%,$(" this_PKG "_CONFIG)),)" > DGEN_DEPS_POST;
print "ifneq ($(wildcard $(" this_PKG "_CONFIG)),)" > DGEN_DEPS_POST;
print "ifeq ($(wildcard " PTXDIST_TEMPDIR "/pkghash-" this_PKG ".done),)" > DGEN_DEPS_POST;
@@ -372,6 +381,12 @@ function write_deps_pkg_active(this_PKG, this_pkg, prefix) {
print "endif" > DGEN_DEPS_POST;
print "$(foreach src,$(" this_PKG "_SOURCES)," \
"$(eval $(STATEDIR)/" this_pkg ".get:" "$(STATEDIR)/" this_pkg ".$(notdir $(src)).stamp))" > DGEN_DEPS_POST;
+ if (DIRTY != "true") {
+ print "ifneq ($(" this_PKG "_EXTRACT_CFGHASH),)" > DGEN_DEPS_POST;
+ print "$(STATEDIR)/" this_pkg ".extract: " \
+ "$(STATEDIR)/" this_pkg ".$(" this_PKG "_EXTRACT_CFGHASH).srchash" > DGEN_DEPS_POST;
+ print "endif" > DGEN_DEPS_POST;
+ }
print "$(STATEDIR)/" this_pkg ".extract: " "$(STATEDIR)/" this_pkg ".get" > DGEN_DEPS_POST;
print "$(STATEDIR)/" this_pkg ".extract.post: " "$(STATEDIR)/" this_pkg ".extract" > DGEN_DEPS_POST;
print "$(STATEDIR)/" this_pkg ".prepare: " "$(STATEDIR)/" this_pkg ".extract.post" > DGEN_DEPS_POST;
diff --git a/scripts/lib/ptxd_make_clean.sh b/scripts/lib/ptxd_make_clean.sh
index 18e332571..c75503352 100644
--- a/scripts/lib/ptxd_make_clean.sh
+++ b/scripts/lib/ptxd_make_clean.sh
@@ -12,10 +12,20 @@ ptxd_make_clean() {
local directory="${1}"
if [ -e "${directory}" ]; then
- if [ -h "${directory}" ! -d "${directory}" ]; then
+ if [ -h "${directory}" -o ! -d "${directory}" ]; then
rm -f "${directory}"
elif [ -n "${PTXDIST_FORCE}" ]; then
: # always delete with --force
+ elif [[ -e "${ptx_make_target}" && "${ptx_make_target}" =~ .extract$ ]]; then
+ if [ -z "${PTXCONF_SETUP_AUTO_EXTRACT}" ]; then
+ ptxd_bailout "Refusing to delete existing source" \
+ "$(ptxd_print_path "${directory}")" \
+ "Delete anyways with --force or skip extract with --dirty."
+ elif [ -z "${PTXDIST_FORCE}" -a -d "${directory}/.git" ]; then
+ ptxd_bailout "Refusing to delete existing source with git" \
+ "$(ptxd_print_path "${directory}")" \
+ "Delete anyways with --force or skip extract with --dirty."
+ fi
elif [ -d "${directory}/.git" ]; then
ptxd_bailout "Refusing to delete git repository" \
"$(ptxd_print_path "${directory}")" \
diff --git a/scripts/lib/ptxd_make_world_prepare.sh b/scripts/lib/ptxd_make_world_prepare.sh
index ed3bd3d5b..e9393cbfb 100644
--- a/scripts/lib/ptxd_make_world_prepare.sh
+++ b/scripts/lib/ptxd_make_world_prepare.sh
@@ -31,6 +31,8 @@ ptxd_make_world_hash()
if [ "${h}" != "${hash}" ]; then
if [ "${target}" = "pkghash" ]; then
echo -e "Configuration changed! Reconfiguring...\n"
+ else
+ echo -e "Patches changed! Reextracting...\n"
fi
fi
rm "${h}" || break