File: check_manifest

package info (click to toggle)
memchan 2.2.1-6
  • links: PTS
  • area: main
  • in suites: lenny, squeeze
  • size: 2,984 kB
  • ctags: 625
  • sloc: ansic: 3,556; sh: 990; tcl: 725; makefile: 234
file content (30 lines) | stat: -rw-r--r-- 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"
    }
}