<pre style='margin:0'>
Joshua Root (jmroot) pushed a commit to branch master
in repository macports-base.
</pre>
<p><a href="https://github.com/macports/macports-base/commit/d191115c1e2aec6c9c9487dc67b1cc0477ff3f12">https://github.com/macports/macports-base/commit/d191115c1e2aec6c9c9487dc67b1cc0477ff3f12</a></p>
<pre style="white-space: pre; background: #F8F8F8">The following commit(s) were added to refs/heads/master by this push:
<span style='display:block; white-space:pre;color:#404040;'> new d191115c1 Avoid unneeded lsearch -regexp
</span>d191115c1 is described below
<span style='display:block; white-space:pre;color:#808000;'>commit d191115c1e2aec6c9c9487dc67b1cc0477ff3f12
</span>Author: Joshua Root <jmr@macports.org>
AuthorDate: Fri Jun 21 07:51:36 2024 +1000
<span style='display:block; white-space:pre;color:#404040;'> Avoid unneeded lsearch -regexp
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> A case-insensitive regex was used to work around the lack of a -nocase
</span><span style='display:block; white-space:pre;color:#404040;'> option for lsearch in Tcl 8.4, which is no longer an issue since we now
</span><span style='display:block; white-space:pre;color:#404040;'> always have Tcl 8.6.
</span>---
src/port1.0/tests/portlint.test | 2 +-
src/registry2.0/portimage.tcl | 10 +++++-----
2 files changed, 6 insertions(+), 6 deletions(-)
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/src/port1.0/tests/portlint.test b/src/port1.0/tests/portlint.test
</span><span style='display:block; white-space:pre;color:#808080;'>index ae10ead4a..0f8eca46f 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/src/port1.0/tests/portlint.test
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/src/port1.0/tests/portlint.test
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -40,7 +40,7 @@ test test_lint_checksum_type_list_missing_recommended {
</span> return "FAIL: unexpected results: no results returned"
}
<span style='display:block; white-space:pre;background:#ffe0e0;'>- if {[lsearch -regexp $results {size}] == -1} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {"size" ni $results} {
</span> return "FAIL: no mention of the missing size field"
}
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/src/registry2.0/portimage.tcl b/src/registry2.0/portimage.tcl
</span><span style='display:block; white-space:pre;color:#808080;'>index c1ab6e0d4..92750c79e 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/src/registry2.0/portimage.tcl
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/src/registry2.0/portimage.tcl
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -573,12 +573,12 @@ proc _activate_contents {port {rename_list {}}} {
</span>
set files [list]
set baksuffix .mp_[clock seconds]
<span style='display:block; white-space:pre;background:#e0ffe0;'>+ set portname [$port name]
</span> set location [$port location]
set imagefiles [$port imagefiles]
set num_imagefiles [llength $imagefiles]
set progress_total_steps [expr {$num_imagefiles * 3}]
set extracted_dir [extract_archive_to_tmpdir $location]
<span style='display:block; white-space:pre;background:#ffe0e0;'>- set replaced_by_re "(?i)^[$port name]\$"
</span>
set backups [list]
# This is big and hairy and probably could be done better.
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -602,7 +602,7 @@ proc _activate_contents {port {rename_list {}}} {
</span> # figure out if the source file exists (file exists will return
# false for symlinks on files that do not exist)
if { [catch {::file lstat $srcfile dummystatvar}] } {
<span style='display:block; white-space:pre;background:#ffe0e0;'>- throw registry::image-error "Image error: Source file $srcfile does not appear to exist (cannot lstat it). Unable to activate port [$port name]."
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ throw registry::image-error "Image error: Source file $srcfile does not appear to exist (cannot lstat it). Unable to activate port ${portname}."
</span> }
set owner [registry::entry owner $file]
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -611,7 +611,7 @@ proc _activate_contents {port {rename_list {}}} {
</span> # deactivate conflicting port if it is replaced_by this one
set result [mportlookup [$owner name]]
set portinfo [lindex $result 1]
<span style='display:block; white-space:pre;background:#ffe0e0;'>- if {[dict exists $portinfo replaced_by] && [lsearch -regexp [dict get $portinfo replaced_by] $replaced_by_re] != -1} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {[dict exists $portinfo replaced_by] && [lsearch -exact -nocase [dict get $portinfo replaced_by] $portname] != -1} {
</span> # we'll deactivate the owner later, but before activating our files
lappend todeactivate $owner
set owner "replaced"
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -639,11 +639,11 @@ proc _activate_contents {port {rename_list {}}} {
</span> # we find any files that already exist, or have entries in
# the registry
if { $owner ne {} && $owner ne $port } {
<span style='display:block; white-space:pre;background:#ffe0e0;'>- set msg "Image error: $file is being used by the active [$owner name] port. Please deactivate this port first, or use 'port -f activate [$port name]' to force the activation."
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set msg "Image error: $file is being used by the active [$owner name] port. Please deactivate this port first, or use 'port -f activate $portname' to force the activation."
</span> #registry::entry close $owner
throw registry::image-error $msg
} elseif { $owner eq {} && ![catch {::file type $file}] } {
<span style='display:block; white-space:pre;background:#ffe0e0;'>- set msg "Image error: $file already exists and does not belong to a registered port. Unable to activate port [$port name]. Use 'port -f activate [$port name]' to force the activation."
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set msg "Image error: $file already exists and does not belong to a registered port. Unable to activate port ${portname}. Use 'port -f activate $portname' to force the activation."
</span> throw registry::image-error $msg
}
}
</pre><pre style='margin:0'>
</pre>