[cygport - the Cygwin packaging tool] branch master, updated. 0.36.5-2-g3589bf83

Jon Turney jturney@sourceware.org
Sun Jul 23 15:27:59 GMT 2023




https://sourceware.org/git/gitweb.cgi?p=cygwin-apps/cygport.git;h=3589bf83ec14ce30f41fa6df96ae7f449499aa4f

commit 3589bf83ec14ce30f41fa6df96ae7f449499aa4f
Author: Jon Turney <jon.turney@dronecode.org.uk>
Date:   Sun Jul 23 15:14:17 2023 +0100

    Bump version to 0.36.6

https://sourceware.org/git/gitweb.cgi?p=cygwin-apps/cygport.git;h=0e4c4261122d3b2373734816c9620c5c44eb72a5

commit 0e4c4261122d3b2373734816c9620c5c44eb72a5
Author: Jon Turney <jon.turney@dronecode.org.uk>
Date:   Sun Jul 9 18:35:51 2023 +0100

    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.


Diff:
---
 NEWS                |  3 +++
 bin/cygport.in      | 33 ++++++++++++++++++++++++---------
 cygport.spec        |  2 +-
 data/sample.cygport |  2 +-
 meson.build         |  2 +-
 5 files changed, 30 insertions(+), 12 deletions(-)

diff --git a/NEWS b/NEWS
index 5af692d2..4b02e4f0 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,6 @@
+0.36.6:
+	* Be more efficent about trying to turn on case-sensitivity
+
 0.36.5:
 	* meson: explicitly use 'meson setup'.
 	* set the default CYGWIN_FILES for all commands.
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_
diff --git a/cygport.spec b/cygport.spec
index 64d58acf..de74320a 100644
--- a/cygport.spec
+++ b/cygport.spec
@@ -1,7 +1,7 @@
 %define debug_package %{nil}
 
 Name:           cygport
-Version:        0.36.5
+Version:        0.36.6
 Release:        1%{?dist}
 Summary:        Cygwin package building tool
 
diff --git a/data/sample.cygport b/data/sample.cygport
index f4f10e1d..6c525caa 100644
--- a/data/sample.cygport
+++ b/data/sample.cygport
@@ -1,7 +1,7 @@
 inherit meson
 
 NAME="cygport"
-VERSION=0.36.5
+VERSION=0.36.6
 RELEASE=1
 CATEGORY="Devel"
 SUMMARY="Cygwin source packaging tool"
diff --git a/meson.build b/meson.build
index 086216fd..e2cf5342 100644
--- a/meson.build
+++ b/meson.build
@@ -1,5 +1,5 @@
 project('cygport',
-        version: '0.36.5')
+        version: '0.36.6')
 
 bindir = join_paths(get_option('prefix'), get_option('bindir'))
 datadir = join_paths(get_option('prefix'), get_option('datadir'))



More information about the Cygwin-apps-cvs mailing list