Fossil SCM

Add the utility script tools/find-fossil-cgis.tcl.

drh 2025-03-29 00:04 trunk
Commit f8fe5be2c3753afc650a7b4bbe08964947f28745372b142b89cc751dc9111839
--- a/tools/find-fossil-cgis.tcl
+++ b/tools/find-fossil-cgis.tcl
@@ -0,0 +1,33 @@
1
+#!/usr/bin/tclsh
2
+#
3
+# This script scans a directory hierarchy looking for Fossil CGI files -
4
+# the files that are used to launch Fossil as a CGI program. For each
5
+# such file found, in prints the name of the file and then printsed.
6
+#
7
+# tclsh find-fossil-cgis.tcl DIRECTORY
8
+#
9
+# The argument is the directory from which to begin the search.
10
+#
11
+# --print Show the content of the CGI, indented by
12
+# Process DIRECTORY arguments that are symlinks.
13
+# Normally symlinks are silently ignored.
14
+#
15
+# -v Show progress i
16
+# Find the CGIs in directory $dir. Invoke recursively to
17
+# scan subdirectories.
18
+#
19
+proc find_in_one_dir {dir} {
20
+ global HAS HASNOT PRINT V
21
+ if {$V>0} {
22
+ puts "# $dir"
23
+ }
24
+ foreach obj [lsort [glob -nocomplain -directory $dir *]] {
25
+ if {[file isdir $obj]} {
26
+ find_in_one_dir $obj
27
+ continue
28
+ }
29
+ if {![file isfile $obj]} continue
30
+
31
+#
32
+# --has REGEXP Only show the CGI if the body matches REGEXP.
33
+# May be repeated multiple times, in whichforeach dir $argv
--- a/tools/find-fossil-cgis.tcl
+++ b/tools/find-fossil-cgis.tcl
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
--- a/tools/find-fossil-cgis.tcl
+++ b/tools/find-fossil-cgis.tcl
@@ -0,0 +1,33 @@
1 #!/usr/bin/tclsh
2 #
3 # This script scans a directory hierarchy looking for Fossil CGI files -
4 # the files that are used to launch Fossil as a CGI program. For each
5 # such file found, in prints the name of the file and then printsed.
6 #
7 # tclsh find-fossil-cgis.tcl DIRECTORY
8 #
9 # The argument is the directory from which to begin the search.
10 #
11 # --print Show the content of the CGI, indented by
12 # Process DIRECTORY arguments that are symlinks.
13 # Normally symlinks are silently ignored.
14 #
15 # -v Show progress i
16 # Find the CGIs in directory $dir. Invoke recursively to
17 # scan subdirectories.
18 #
19 proc find_in_one_dir {dir} {
20 global HAS HASNOT PRINT V
21 if {$V>0} {
22 puts "# $dir"
23 }
24 foreach obj [lsort [glob -nocomplain -directory $dir *]] {
25 if {[file isdir $obj]} {
26 find_in_one_dir $obj
27 continue
28 }
29 if {![file isfile $obj]} continue
30
31 #
32 # --has REGEXP Only show the CGI if the body matches REGEXP.
33 # May be repeated multiple times, in whichforeach dir $argv

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button