From 0e4c4261122d3b2373734816c9620c5c44eb72a5 Mon Sep 17 00:00:00 2001 From: Jon Turney Date: Sun, 9 Jul 2023 18:35:51 +0100 Subject: [PATCH cygport] cygport.in: only try to turn on case-sensitivity when we create workdir Only try to turn on case-sensitivity when we create workdir: this avoids grovelling over all the files on subsequent runs. Make sure to check for case-sensitivity required on subsequent runs, though. --- bin/cygport.in | 33 ++++++++++++++++++++++++--------- 1 file changed, 24 insertions(+), 9 deletions(-) diff --git a/bin/cygport.in b/bin/cygport.in index 1791e5b3..3f89ac67 100755 --- a/bin/cygport.in +++ b/bin/cygport.in @@ -573,18 +573,34 @@ declare -ar pkg_name=(${PKG_NAMES:-${PN}}); declare -r pkg_count=${#pkg_name[*]}; # this requires workdir to be already defined -mkdir -p ${workdir} -if [ $OSTYPE = "cygwin" ] +__probe_case_sensitivity() { + mkdir -p ${workdir} + rm -f ${workdir}/.probe_case_sensitivity + touch ${workdir}/.PROBE_CASE_SENSITIVITY + local probe=$( [ -f ${workdir}/.probe_case_sensitivity ] && echo 1 || echo 0 ) + rm -f ${workdir}/.PROBE_CASE_SENSITIVITY + return $probe +} + +__enable_case_sensitivity() { + if [ $OSTYPE = "cygwin" ] + then + inform "Trying to enable case sensitivity on ${workdir}" + chattr -fR +C ${workdir} >/dev/null 2>&1 || true + fi +} + +# create workdir if it doesn't already exist, and try to enable case-sensitivity +# if it appears to be absent +if [ ! -d ${workdir} ] then - chattr -fR +C ${workdir} >/dev/null 2>&1 || true + mkdir -p ${workdir} + __probe_case_sensitivity || __enable_case_sensitivity fi -rm -f ${workdir}/.probe_case_sensitivity -touch ${workdir}/.PROBE_CASE_SENSITIVITY -probe=$( [ -f ${workdir}/.probe_case_sensitivity ] && echo "failed" || echo "" ) -rm -f ${workdir}/.PROBE_CASE_SENSITIVITY -if [ -n "$probe" ] +# in any case, probe for case sensitivity, stop if required but missing +if ! __probe_case_sensitivity then if defined _CYGPORT_RESTRICT_case_insensitive_ then @@ -593,7 +609,6 @@ then warning "Building on a case-insensitive filesystem"; fi fi -unset probe # this requires S and B to be already defined if ! defined _CYGPORT_RESTRICT_debuginfo_ -- 2.39.0