]> git.saurik.com Git - apple/security.git/blob - Security/libsecurity_codesigning/antlr2/scripts/make_change_log.tcl
Security-57031.1.35.tar.gz
[apple/security.git] / Security / libsecurity_codesigning / antlr2 / scripts / make_change_log.tcl
1 #!/bin/sh
2 # the next line restarts using tclsh \
3 exec tclsh8.3 $0 $*
4
5 #
6 # Sort the (C++) changes recorded in the repository by change number and
7 # print them to stdout
8 #
9 set depots {//depot/code/org.antlr/dev/klaren.dev //depot/code/org.antlr/main/main }
10 set files { /lib/cpp/... /antlr/... }
11 set filespec ""
12 foreach depot $depots {
13 foreach file $files {
14 append filespec "$depot$file "
15 }
16 }
17
18 puts stderr "Gettting changes from: $filespec"
19
20 catch {set file [open "|p4 changes -l $filespec" r]}
21
22 set cnt 0
23 set changes {}
24 set text ""
25 set change_nr -1
26
27 while {![eof $file]} {
28 set line [gets $file]
29
30 if { [regexp -- {^Change ([0-9]+).*$} $line dummy tmp] } {
31 # append the number to the list of found changes
32 lappend changes $tmp
33
34 if { $change_nr != -1 } {
35 # were already working on change..
36 # so we have text to store..
37 set description($change_nr) $text
38 }
39
40 # remember number...
41 set change_nr $tmp
42 # reinit text
43 set text "[string trim $line]\n"
44 } else {
45 append text " [string trim $line]\n"
46 }
47 }
48
49 set description($change_nr) $text
50
51 catch {close $file}
52
53 set sorted_changes [lsort -unique -integer -decreasing $changes]
54
55 foreach change $sorted_changes {
56 puts $description($change)
57 }