From 46e4155e9ff37ed8edf1f52943b946581069a34a Mon Sep 17 00:00:00 2001 From: stephan Date: Sun, 17 Nov 2024 09:51:52 +0000 Subject: [PATCH] buildtclext.tcl: add docs explaining the DESTDIR check and break out of the auto_path search loop early if the DESTDIR is not writable, rather than re-checking that repeatedly. FossilOrigin-Name: 322be94569d196a66b3671100e880f32f85777c248a662866b0579a6392a24dc --- manifest | 14 +++++++------- manifest.uuid | 2 +- tool/buildtclext.tcl | 13 ++++++++++++- 3 files changed, 20 insertions(+), 9 deletions(-) diff --git a/manifest b/manifest index 3e90e34826..1c5fdc333d 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Handle\sDESTDIR\sat\san\searlier\sphase\sin\sbuildtclext.tcl\sto\saccount\sfor\sthe\sis-writable-dir\scheck\sand\sto\sfilter\sout\s//zipfs:\sdirs\sas\s(im)possible\sinstallation\stargets. -D 2024-11-16T17:12:17.894 +C buildtclext.tcl:\sadd\sdocs\sexplaining\sthe\sDESTDIR\scheck\sand\sbreak\sout\sof\sthe\sauto_path\ssearch\sloop\searly\sif\sthe\sDESTDIR\sis\snot\swritable,\srather\sthan\sre-checking\sthat\srepeatedly. +D 2024-11-17T09:51:52.916 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 @@ -2110,7 +2110,7 @@ F tool/GetTclKit.bat d84033c6a93dfe735d247f48ba00292a1cc284dcf69963e5e672444e045 F tool/Replace.cs 02c67258801c2fb5f63231e0ac0f220b4b36ba91 F tool/build-all-msvc.bat c817b716e0edeecaf265a6775b63e5f45c34a6544f1d4114a222701ed5ac79ab x F tool/build-shell.sh 369c4b171cc877ad974fef691e4da782b4c1e99fe8f4361316c735f64d49280f -F tool/buildtclext.tcl 2b0d03bdb303bd3aeadc9fd8f785a11c8f8f863bf1e5aabe1441b60caef14ff4 +F tool/buildtclext.tcl b3d76545dac9cb44c3476910ff62475f60f29a773ebf96af4e97edef1a510c63 F tool/cg_anno.tcl c1f875f5a4c9caca3d59937b16aff716f8b1883935f1b4c9ae23124705bc8099 x F tool/checkSpacing.c 810e51703529a204fc4e1eb060e9ab663e3c06d2 F tool/cktclsh.sh 6075eef9c6b9ba4b38fef2ca2a66d25f2311bd3c610498d18a9b01f861629cca @@ -2220,9 +2220,9 @@ F vsixtest/vsixtest.tcl 6195aba1f12a5e10efc2b8c0009532167be5e301abe5b31385638080 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P 38136b33f9536b63520d3810f397a3b4b5372028b31108806f84fe44bf338425 -Q +d2e8c161a14fbbcc52c50dfd9274c9969e3c273e2cb7cbf2f865541af9f39ead -R ed752121f17fd47c6910e911691642a7 +P 2f6e5946cf34e0948e177aa12a4a768fcd6dc413909a97566e0abff51230c87c +Q +d07be336eaeb9a5d56ac6e1b63f4d8e50d3ac236f5953cc178ef34542a7cd8fa +R 5d0d59205f732e1f9f44fbc8e1e7b03d U stephan -Z f48a12bc3f78d3fb11f8f898794a2476 +Z e70703bd1e2a3673518bcf3a1e82c39f # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 64b1f9b702..08f722aac3 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -2f6e5946cf34e0948e177aa12a4a768fcd6dc413909a97566e0abff51230c87c +322be94569d196a66b3671100e880f32f85777c248a662866b0579a6392a24dc diff --git a/tool/buildtclext.tcl b/tool/buildtclext.tcl index 1908c2dcb5..05586d84fd 100644 --- a/tool/buildtclext.tcl +++ b/tool/buildtclext.tcl @@ -202,7 +202,18 @@ if {$install} { # We can't install to //zipfs: paths continue } elseif {"" ne $DESTDIR && ![file writable $DESTDIR]} { - continue + # In the common case, ${DESTDIR}${dir} will not exist when we + # get to this point of the installation, and the "is writable?" + # check just below this will fail for that case. + # + # Assumption made for simplification's sake: if ${DESTDIR} is + # not writable, no part of the remaining path will + # be. ${DESTDIR} is typically used by OS package maintainers, + # not normal installations, and it "shouldn't" ever happen that + # the DESTDIR is read-only while the target ${DESTDIR}${prefix} + # is not, as it's typical for such installations to create + # ${prefix} on-demand under ${DESTDIR}. + break } set dir ${DESTDIR}$dir if {[file writable $dir] || "" ne $DESTDIR} { -- 2.47.2