File: check_manifest

package info (click to toggle)
tcltrf 2.1.4-dfsg3-1
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 9,628 kB
  • sloc: ansic: 73,134; sh: 3,155; tcl: 1,343; makefile: 176; exp: 22
file content (30 lines) | stat: -rwxr-xr-x 605 bytes parent folder | download | duplicates (18)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/usr/local/bin/tclsh
# -*- tcl -*-
# check the manifest against the current contents of the directory

set manifest [lindex $argv 0]

rename file ori_file
proc   file {name} {
    global files
    set    files($name) 1
    if {! [ori_file exists $name]} {
	puts stdout "missing: $name"
    }
}

# read manifest and check existence of all listed files
source $manifest


# now backwards: find all files and check
# for files not listed in the manifest

set list [exec find . -print]
regsub -all "\n" $list { } list

foreach f $list {
    if {[catch {set files($f)}]} {
	puts stdout "new:     $f"
    }
}