|
From: <ge...@op...> - 2025-11-30 08:42:13
|
This is an automated email from Gerrit. "Antonio Borneo <bor...@gm...>" just uploaded a new patch set to Gerrit, which you can find at https://review.openocd.org/c/openocd/+/9278 -- gerrit commit 960b8252d8d25db8b246e8e55057f7e4532e06ab Author: Antonio Borneo <bor...@gm...> Date: Sun Nov 30 09:25:48 2025 +0100 startup.tcl: extend the file search among rename The renaming of boards and targets is often requiring the simple replacement of '_' with '-'. To avoid listing such replacements in 'tcl/file_renaming.cfg', add the automatic check in 'proc find' allowing till two replacements of '_' with '-'. Change-Id: I2623ea78d9c61d86189afcae2553c2910bda8389 Signed-off-by: Antonio Borneo <bor...@gm...> diff --git a/src/helper/startup.tcl b/src/helper/startup.tcl index 89ed71b900..be01d71b3d 100644 --- a/src/helper/startup.tcl +++ b/src/helper/startup.tcl @@ -31,23 +31,39 @@ proc find {filename} { # - path/to/a/certain/vendor_config_file # - path/to/a/certain/vendor-config_file - # replaced with + # replaced either with # - path/to/a/certain/vendor/config_file + # or + # - path/to/a/certain/vendor/config-file regsub {([/\\])([^/\\_-]*)[_-]([^/\\]*$)} $filename "\\1\\2\\1\\3" f if {[catch {_find_internal $f} t]==0} { echo "WARNING: '$filename' is deprecated, use '$f' instead" return $t } + regsub {([/\\])([^/\\_]*)_([^/\\]*$)} $f "\\1\\2-\\3" f + regsub {([/\\])([^/\\_]*)_([^/\\]*$)} $f "\\1\\2-\\3" f + if {[catch {_find_internal $f} t]==0} { + echo "WARNING: '$filename' is deprecated, use '$f' instead" + return $t + } foreach vendor {nordic ti sifive st} { # - path/to/a/certain/config_file - # replaced with + # replaced either with # - path/to/a/certain/${vendor}/config_file + # or + # - path/to/a/certain/${vendor}/config-file regsub {([/\\])([^/\\]*$)} $filename "\\1$vendor\\1\\2" f if {[catch {_find_internal $f} t]==0} { echo "WARNING: '$filename' is deprecated, use '$f' instead" return $t } + regsub {([/\\])([^/\\_]*)_([^/\\]*$)} $f "\\1\\2-\\3" f + regsub {([/\\])([^/\\_]*)_([^/\\]*$)} $f "\\1\\2-\\3" f + if {[catch {_find_internal $f} t]==0} { + echo "WARNING: '$filename' is deprecated, use '$f' instead" + return $t + } } # at last, check for explicit renaming -- |