| 1 |
#!/usr/local/bin/tclsh |
| 2 |
# -*- tcl -*- |
| 3 |
# check the manifest against the current contents of the directory |
| 4 |
|
| 5 |
set manifest [lindex $argv 0] |
| 6 |
|
| 7 |
rename file ori_file |
| 8 |
proc file {name} { |
| 9 |
global files |
| 10 |
set files($name) 1 |
| 11 |
if {! [ori_file exists $name]} { |
| 12 |
puts stdout "missing: $name" |
| 13 |
} |
| 14 |
} |
| 15 |
|
| 16 |
# read manifest and check existence of all listed files |
| 17 |
source $manifest |
| 18 |
|
| 19 |
|
| 20 |
# now backwards: find all files and check |
| 21 |
# for files not listed in the manifest |
| 22 |
|
| 23 |
set list [exec find . -print] |
| 24 |
regsub -all "\n" $list { } list |
| 25 |
|
| 26 |
foreach f $list { |
| 27 |
if {[catch {set files($f)}]} { |
| 28 |
puts stdout "new: $f" |
| 29 |
} |
| 30 |
} |