Documentation Source Text

Check-in [b6c54837b9]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Enhance the requirements matrix generator to report duplicate text requirements.
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: b6c54837b982b985d449f9c8ede921214e4061bd
User & Date: drh 2009-12-10 20:28:38
Context
2009-12-11
14:20
Comment out the line in althttpd that disallows the msnbot. We are going to give Bing a second chance.... check-in: 101a84e46c user: drh tags: trunk
2009-12-10
20:28
Enhance the requirements matrix generator to report duplicate text requirements. check-in: b6c54837b9 user: drh tags: trunk
2009-12-08
02:04
Further updates to the SQL function documentation. check-in: e265a59cf0 user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to matrix.tcl.

45
46
47
48
49
50
51

52
53
54
55
56
57





58
59
60
61
62
63




64
65
66
67
68
69
70
..
81
82
83
84
85
86
87







88
89
90
91
92
93
94
  set orig_x $x
  set origlen [string length $x]
  regsub {^doc/} $file {} srcfile
  set seqno 0
  while {[string length $x]>0 && [regsub {^.*?\^} $x {} nx]} {
    set c [string index $nx 0]
    set seqno [expr {$origlen - [string length $nx]}]

    if {$c=="("} {
      regexp {^\((([^<]|<.+?>)*?)\)\^} $nx all req
      regsub {^\((([^<]|<.+?>)*?)\)\^} $nx {} nx
    } else {
      regexp {^([^<]|<.+?>)*?\.} $nx req
      regsub {^([^<]|<.+?>)*?\.} $nx {} nx





    }
    set orig [string trim $req]
    regsub -all {<.+?>} $orig {} req
    regsub -all {\s+} [string trim $req] { } req
    set req [string trim $req]
    set reqno R-[md5-10x8 $req]




    db eval {
      INSERT OR IGNORE INTO requirement
              (reqno, reqtext, origtext, reqimage,srcfile,srcseq)
        VALUES($reqno,$req,    $orig,    0,      $srcfile,$seqno);
    }
    set x $nx
  }
................................................................................
      set req $name
      set orig "<img src=\"$image\">"
      if {![file exists doc/$image]} {
        puts stderr "No such image: doc/$image"
        continue
      }
      set reqno R-[md5file-10x8 doc/$image]







      db eval {
        INSERT OR IGNORE INTO requirement
                (reqno, reqtext, origtext, reqimage,srcfile,srcseq)
          VALUES($reqno,$req,    $orig,    1,      $srcfile,$seqno);
      }
    }
  }







>






>
>
>
>
>






>
>
>
>







 







>
>
>
>
>
>
>







45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
..
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
  set orig_x $x
  set origlen [string length $x]
  regsub {^doc/} $file {} srcfile
  set seqno 0
  while {[string length $x]>0 && [regsub {^.*?\^} $x {} nx]} {
    set c [string index $nx 0]
    set seqno [expr {$origlen - [string length $nx]}]
    set req {}
    if {$c=="("} {
      regexp {^\((([^<]|<.+?>)*?)\)\^} $nx all req
      regsub {^\((([^<]|<.+?>)*?)\)\^} $nx {} nx
    } else {
      regexp {^([^<]|<.+?>)*?\.} $nx req
      regsub {^([^<]|<.+?>)*?\.} $nx {} nx
    }
    if {$req==""} {
      puts "$srcfile: bad requirement: [string range $nx 0 40]..."
      set x $nx
      continue
    }
    set orig [string trim $req]
    regsub -all {<.+?>} $orig {} req
    regsub -all {\s+} [string trim $req] { } req
    set req [string trim $req]
    set reqno R-[md5-10x8 $req]
    db eval {SELECT srcfile AS s2, reqtext as r2
             FROM requirement WHERE reqno=$reqno} {
      puts "$srcfile: duplicate [string range $reqno 0 12] in $s2: \[$r2\]"
    }
    db eval {
      INSERT OR IGNORE INTO requirement
              (reqno, reqtext, origtext, reqimage,srcfile,srcseq)
        VALUES($reqno,$req,    $orig,    0,      $srcfile,$seqno);
    }
    set x $nx
  }
................................................................................
      set req $name
      set orig "<img src=\"$image\">"
      if {![file exists doc/$image]} {
        puts stderr "No such image: doc/$image"
        continue
      }
      set reqno R-[md5file-10x8 doc/$image]

      # We dont really care about duplicate image file references
      #db eval {SELECT srcfile AS s2, reqtext as r2
      #         FROM requirement WHERE reqno=$reqno} {
      #  puts "$srcfile: duplicate image [file tail $image]\
      #        [string range $reqno 0 12] in $s2"
      #}
      db eval {
        INSERT OR IGNORE INTO requirement
                (reqno, reqtext, origtext, reqimage,srcfile,srcseq)
          VALUES($reqno,$req,    $orig,    1,      $srcfile,$seqno);
      }
    }
  }