Index: openacs-4/packages/acs-lang/www/admin/message-usage-include.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-lang/www/admin/message-usage-include.tcl,v diff -u -r1.8.2.1 -r1.8.2.2 --- openacs-4/packages/acs-lang/www/admin/message-usage-include.tcl 19 Dec 2019 15:41:44 -0000 1.8.2.1 +++ openacs-4/packages/acs-lang/www/admin/message-usage-include.tcl 25 Feb 2024 15:46:52 -0000 1.8.2.2 @@ -17,17 +17,42 @@ # special regexp for them if { [string match "acs-lang.localization-*" $full_key] } { - set grepfor "${full_key}|lc_get \[\"\{\]?[string range $message_key [string length "localization-"] end]\[\"\}\]?" + set grepfor "${full_key}|lc_get \[\"\{\]?[string range $message_key [string length localization-] end]\[\"\}\]?" } else { set grepfor "\\W${full_key}\\W" } multirow create message_usage file code +set egrepCmd [::util::which egrep] ad_try { - exec find $::acs::rootdir -type f -regex ".*\\.\\(info\\|adp\\|sql\\|tcl\\)" -follow \ - | xargs egrep "$grepfor" 2>/dev/null + if {[::acs::icanuse gnugrep]} { + exec -ignorestderr $egrepCmd -r \ + --include=*.tcl \ + --include=*.adp \ + --include=*.sql \ + --include=*.info \ + $grepfor $::acs::rootdir/packages + + } else { + set findCmd [::util::which find] + set xargsCmd [::util::which xargs] + exec -ignorestderr $findCmd $::acs::rootdir/packages -type f -follow \ + | $egrepCmd .(tcl|adp|sql|info) \ + | $xargsCmd $egrepCmd $grepfor + } + +} on ok {findResult} { + # + # Successful operation. Strip the leading root directory path fore + # more compact display. + # + regsub -all $::acs::rootdir/packages/ $findResult "" findResult + + multirow append message_usage \ + "Found Occurrences of this message key:" $findResult + } on error {errorMsg} { foreach line [split $errorMsg "\n"] { if { [string first "child process exited abnormally" $line] == -1 } { Index: openacs-4/packages/acs-tcl/tcl/00-icanuse-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/Attic/00-icanuse-procs.tcl,v diff -u -r1.1.2.46 -r1.1.2.47 --- openacs-4/packages/acs-tcl/tcl/00-icanuse-procs.tcl 24 Oct 2023 16:11:12 -0000 1.1.2.46 +++ openacs-4/packages/acs-tcl/tcl/00-icanuse-procs.tcl 25 Feb 2024 15:46:51 -0000 1.1.2.47 @@ -94,13 +94,14 @@ # # Register features provided by the server, available to all packages. # These features can typically not easily be provided by compatibility -# routines. +# routines. These features can be use via [::acs::icanuse FEATURENAME]. # -# Note that packages can register some optional features during bootup -# as well, but the developer has to care about the registration and -# loading order. +# Note that packages can register some optional features during boot +# up as well, but the developer has to care about the registration and +# loading order. The commands are executed very early, this means +# that, e.g., util::which is not yet available. # - +::acs::register_icanuse "gnugrep" [acs::cmd_error_contains [list exec grep -V] GNU] ::acs::register_icanuse "ns_asynclogfile" {[info commands ::ns_asynclogfile] ne ""} ::acs::register_icanuse "ns_conn contentsentlength" [acs::cmd_has_subcommand ns_conn contentsentlength] ::acs::register_icanuse "ns_conn partialtimes" [acs::cmd_has_subcommand ns_conn partialtimes] @@ -131,9 +132,9 @@ ::acs::register_icanuse "ns_deletecookie -samesite" [acs::cmd_error_contains {ns_deletecookie ""} -samesite] # -# At the time "ns_trim -prefix was introduced, a memory leak in -# nsv_dict was removed that could lead to a growing size of NaviServer -# on busy sites. +# At the time "ns_trim -prefix was introduced in NaviServer, a memory +# leak in nsv_dict was removed that could lead to a growing size of +# nsd on busy sites. # ::acs::register_icanuse "nsv_dict" [acs::cmd_error_contains {ns_trim} -prefix]