11 |
# it under the terms of the GNU General Public License as published by |
# it under the terms of the GNU General Public License as published by |
12 |
# the Free Software Foundation; either version 2 of the License, or |
# the Free Software Foundation; either version 2 of the License, or |
13 |
# (at your option) any later version. |
# (at your option) any later version. |
14 |
# |
# |
15 |
# This program is distributed in the hope that it will be useful, |
# This program is distributed in the hope that it will be useful, |
16 |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
17 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
18 |
# GNU General Public License for more details. |
# GNU General Public License for more details. |
19 |
# |
# |
20 |
# You should have received a copy of the GNU General Public License |
# You should have received a copy of the GNU General Public License |
21 |
# along with this program; if not, write to the Free Software |
# along with this program; if not, write to the Free Software |
22 |
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
67 |
set level [lindex $args [expr $i+1]] |
set level [lindex $args [expr $i+1]] |
68 |
} |
} |
69 |
set message [lindex $args $i] |
set message [lindex $args $i] |
70 |
|
|
71 |
if { $verbose >= $level } { |
if { $verbose >= $level } { |
72 |
# There is no need for the "--" argument here, but play it safe. |
# There is no need for the "--" argument here, but play it safe. |
73 |
# We assume send_user also sends the text to the log file (which |
# We assume send_user also sends the text to the log file (which |
115 |
# get a list of all the files in this directory |
# get a list of all the files in this directory |
116 |
set allfiles [glob -nocomplain "$directory/*"] |
set allfiles [glob -nocomplain "$directory/*"] |
117 |
regsub -all "$directory/" $allfiles "" allfiles |
regsub -all "$directory/" $allfiles "" allfiles |
118 |
|
|
119 |
# open the .clean file, which has the list of stuff we |
# open the .clean file, which has the list of stuff we |
120 |
# want to save |
# want to save |
121 |
catch "set cleanfile [open "$directory/.clean" r]" |
catch "set cleanfile [open "$directory/.clean" r]" |
143 |
if { [string index $cur_line 0] == "\#" } { |
if { [string index $cur_line 0] == "\#" } { |
144 |
verbose "Ignoring comment" 2 |
verbose "Ignoring comment" 2 |
145 |
continue |
continue |
146 |
} |
} |
147 |
# ignore blank lines |
# ignore blank lines |
148 |
if { [string length $cur_line]<=0 } { |
if { [string length $cur_line]<=0 } { |
149 |
verbose "Ignoring blank line" 2 |
verbose "Ignoring blank line" 2 |
150 |
continue |
continue |
151 |
} |
} |
152 |
regsub -all "\[\+\]" $cur_line "\\+" cur_line |
regsub -all "\[\+\]" $cur_line "\\+" cur_line |
153 |
# remove the filename from the list |
# remove the filename from the list |
154 |
regsub -all " $cur_line " $allfiles " " allfiles |
regsub -all " $cur_line " $allfiles " " allfiles |
158 |
regsub -all "^$cur_line" $allfiles " " allfiles |
regsub -all "^$cur_line" $allfiles " " allfiles |
159 |
} |
} |
160 |
} |
} |
161 |
|
|
162 |
# remove the leading and trailing blank spaces for cleanliness sake |
# remove the leading and trailing blank spaces for cleanliness sake |
163 |
set allfiles [string trimleft $allfiles] |
set allfiles [string trimleft $allfiles] |
164 |
set allfiles [string trimright $allfiles] |
set allfiles [string trimright $allfiles] |