System.Data.SQLite

Check-in [e100045f84]
Login

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

Overview
Comment:Improvements to the master release archive verification tool.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: e100045f84e37bdb97d8dbf41051bf3e856c7016
User & Date: mistachkin 2014-11-24 21:34:14.537
Context
2014-11-24
22:03
Check for missing Fossil tool in the master release archive verification tool. check-in: 59d9761e66 user: mistachkin tags: trunk
21:34
Improvements to the master release archive verification tool. check-in: e100045f84 user: mistachkin tags: trunk
2014-11-19
23:09
Update SQLite core library to the 3.8.7.2 release. check-in: 919cb869dc user: mistachkin tags: trunk
Changes
Side-by-Side Diff Ignore Whitespace Patch
Changes to Setup/verify.eagle.
10
11
12
13
14
15
16
17

18
19
20
21
22
23
24
































25
26
27

28
29
30
31




















32
33
34
35













36
37
38
39
40




41
42
43
44
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
81


82
83
84
85
86
87
88






89
90
91


92
93
94
95
96
97
98






99
100
101
102
103
104
105
106
107
108
109










110
111
112
113
114
115





116
117
118


119
120

121
122
123
124
125




126
127
128
129



130
131
132
133
134




135
136
137


138



139
140
141
142




143
144
145
146
147
148
149
150
151
152
153
154
155


















156
157
158





159
160
161
162
163
164
165
166







167
168
169
170
171
172
173
174
175
176
177
178
179
180













181
182
183
184
185
186
187
188
189
190
191
192











193
194
195
196































































197
198
199
200
201
202
203
204
205
206
207
208











209
210
211
212
213
214
215
216







217
218
219
220



221
222

223
224
225
226
227
228
10
11
12
13
14
15
16

17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
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
81
82



83
84
85
86
87
88
89
90
91
92
93
94
95
96




97
98
99
100
101




102
103
104
105
106




107
108
109
110
111




112
113
114
115
116




117
118
119
120
121




122
123
124
125
126

127
128



129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147

148
149




150
151
152
153
154


155
156
157






158
159
160
161
162
163
164


165
166
167






168
169
170
171
172
173
174










175
176
177
178
179
180
181
182
183
184
185





186
187
188
189
190
191


192
193
194

195
196




197
198
199
200
201



202
203
204
205




206
207
208
209
210


211
212
213
214
215
216




217
218
219
220
221












222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240


241
242
243
244
245
246







247
248
249
250
251
252
253
254













255
256
257
258
259
260
261
262
263
264
265
266
267
268











269
270
271
272
273
274
275
276
277
278
279
280



281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344











345
346
347
348
349
350
351
352
353
354
355
356







357
358
359
360
361
362
363
364



365
366
367
368

369



370
371
372







-
+







+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+


-
+


-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+

-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+

-
-
-
-
+
+
+
+

-
-
-
-
+
+
+
+

-
-
-
-
+
+
+
+

-
-
-
-
+
+
+
+

-
-
-
-
+
+
+
+

-
-
-
-
+
+
+
+

-
+

-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+

-
+

-
-
-
-
+
+
+
+

-
-
+
+

-
-
-
-
-
-
+
+
+
+
+
+

-
-
+
+

-
-
-
-
-
-
+
+
+
+
+
+

-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+

-
-
-
-
-
+
+
+
+
+

-
-
+
+

-
+

-
-
-
-
+
+
+
+

-
-
-
+
+
+

-
-
-
-
+
+
+
+

-
-
+
+

+
+
+
-
-
-
-
+
+
+
+

-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+

-
-
+
+
+
+
+

-
-
-
-
-
-
-
+
+
+
+
+
+
+

-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+

-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+

-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+

-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+

-
-
-
-
-
-
-
+
+
+
+
+
+
+

-
-
-
+
+
+

-
+
-
-
-



package require Eagle

proc usage { error } {
  if {[string length $error] > 0} then {puts stdout $error}

  puts stdout "usage:\
[file tail [info nameofexecutable]]\
[file tail [info script]] <directory>"
[file tail [info script]] <directory> <withHashes>"

  #
  # NOTE: Indicate to the caller, if any, that we have failed.
  #
  exit 1
}

proc getSha1Hashes { varName } {
  variable fossil

  upvar 1 $varName hashes

  set data [exec -success Success -nocarriagereturns -- \
      $fossil artifact current]

  set result 0
  set lines [split $data \n]

  foreach line $lines {
    if {[string range $line 0 1] eq "F "} then {
      set fields [split $line " "]

      if {[llength $fields] >= 3} then {
        set hashes([lindex $fields 1]) [lindex $fields 2]
        incr result
      }
    }
  }

  return $result
}

proc getSha1Sum { fileName } {
  variable fossil

  return [string range [exec -success Success -nocarriagereturns \
      -trimall -- $fossil sha1sum $fileName] 0 39]
}

set argc [llength $argv]

if {$argc == 1} then {
if {$argc == 2} then {
  set directory [lindex $argv 0]

  if {[string length $directory] > 0} then {
    set exitCode 0
  if {[string length $directory] == 0} then {
    usage "invalid directory specified"
  }

  if {![file isdirectory $directory]} then {
    usage [appendArgs \
        "directory \"" $directory "\" does not exist"]
  }

  set withHashes [lindex $argv 1]

  if {[string length $withHashes] == 0} then {
    usage "invalid \"withHashes\" flag specified"
  }

  if {![string is boolean -strict $withHashes]} then {
    usage "bad \"withHashes\" flag, not a boolean"
  }

  set exitCode 0

    set script [info script]
    set path [file dirname $script]
    set rootName [file rootname [file tail $script]]
  set script [info script]
  set path [file dirname $script]
  set rootName [file rootname [file tail $script]]

  if {![info exists fossil]} then {
    if {[info exists env(FossilTool)]} then {
      set fossil $env(FossilTool)
    }

    if {![info exists fossil] || ![file exists $fossil]} then {
      set fossil [file join $path fossil.exe]
    }
  }

    if {![info exists innounp]} then {
      if {[info exists env(InnoUnpackTool)]} then {
        set innounp $env(InnoUnpackTool)
      }
  if {![info exists innounp]} then {
    if {[info exists env(InnoUnpackTool)]} then {
      set innounp $env(InnoUnpackTool)
    }

      if {![info exists innounp] || ![file exists $innounp]} then {
        set innounp [file join $path innounp.exe]
      }
    }
    if {![info exists innounp] || ![file exists $innounp]} then {
      set innounp [file join $path innounp.exe]
    }
  }

    if {![info exists rar]} then {
      if {[info exists env(UnRARTool)]} then {
        set rar $env(UnRARTool)
      }
  if {![info exists rar]} then {
    if {[info exists env(UnRARTool)]} then {
      set rar $env(UnRARTool)
    }

      if {![info exists rar] || ![file exists $rar]} then {
        set rar [file join $path UnRAR.exe]
      }
    }
    if {![info exists rar] || ![file exists $rar]} then {
      set rar [file join $path UnRAR.exe]
    }
  }

    if {![info exists zip]} then {
      if {[info exists env(UnZipTool)]} then {
        set zip $env(UnZipTool)
      }
  if {![info exists zip]} then {
    if {[info exists env(UnZipTool)]} then {
      set zip $env(UnZipTool)
    }

      if {![info exists zip] || ![file exists $zip]} then {
        set zip [file join $path UnZip.exe]
      }
    }
    if {![info exists zip] || ![file exists $zip]} then {
      set zip [file join $path UnZip.exe]
    }
  }

    source [file join $path data [appendArgs $rootName .lst]]
  source [file join $path data [appendArgs $rootName .lst]]

    if {![array exists manifests]} then {
      usage "master archive manifest is missing"
    }
  if {![array exists manifests]} then {
    usage "master archive manifest is missing"
  }

  package require Eagle.Test; set extractDirectory [getTemporaryPath]

  if {[string length $extractDirectory] == 0} then {
    usage "no extract directory is available"
  }

  if {![file isdirectory $extractDirectory]} then {
    usage [appendArgs \
        "extract directory \"" $extractDirectory "\" does not exist"]
  }

  if {[getSha1Hashes hashes] == 0} then {
    usage "no repository hashes are available"
  }

    set archiveFileNames [list]
  set archiveFileNames [list]

    foreach extension [list exe rar zip] {
      eval lappend archiveFileNames [findFilesRecursive \
          [file join $directory [appendArgs *. $extension]]]
    }
  foreach extension [list exe rar zip] {
    eval lappend archiveFileNames [findFilesRecursive \
        [file join $directory [appendArgs *. $extension]]]
  }

    foreach archiveFileName $archiveFileNames {
      set manifest [file tail $archiveFileName]
  foreach archiveFileName $archiveFileNames {
    set manifest [file tail $archiveFileName]

      #
      # NOTE: Attempt to extract the version and/or date/time
      #       information from the manifest file name.
      #
      regexp -- {(\d+)\.(\d+)\.(\d+)\.(\d+)} $manifest dummy \
          major minor build revision
    #
    # NOTE: Attempt to extract the version and/or date/time
    #       information from the manifest file name.
    #
    regexp -- {(\d+)\.(\d+)\.(\d+)\.(\d+)} $manifest dummy \
        major minor build revision

      regexp -- {(\d{4})-(\d{2})-(\d{2})-(\d{2})} $manifest \
          dummy year month day sequence
    regexp -- {(\d{4})-(\d{2})-(\d{2})-(\d{2})} $manifest \
        dummy year month day sequence

      #
      # HACK: Attempt to match and remove sub-strings from the
      #       manifest file name that look like the name of a
      #       build configuration (e.g. "debug" or "release").
      #
      regsub -- {-debug-|-release-} $manifest {-} manifest
    #
    # HACK: Attempt to match and remove sub-strings from the
    #       manifest file name that look like the name of a
    #       build configuration (e.g. "debug" or "release").
    #
    regsub -- {-debug-|-release-} $manifest {-} manifest

      #
      # HACK: Attempt to match and remove sub-strings from the
      #       manifest file name that look like a version number
      #       in the format "<major>.<minor>.<build>.<revision>"
      #       and/or a date/time string matching the format
      #       "YYYY-MM-DD-NN" (where the NN portion is a generic
      #       incrementing sequence number).
      #
      regsub -- {\d+\.\d+\.\d+\.\d+} $manifest {} manifest
      regsub -- {\d{4}-\d{2}-\d{2}-\d{2}} $manifest {} manifest
    #
    # HACK: Attempt to match and remove sub-strings from the
    #       manifest file name that look like a version number
    #       in the format "<major>.<minor>.<build>.<revision>"
    #       and/or a date/time string matching the format
    #       "YYYY-MM-DD-NN" (where the NN portion is a generic
    #       incrementing sequence number).
    #
    regsub -- {\d+\.\d+\.\d+\.\d+} $manifest {} manifest
    regsub -- {\d{4}-\d{2}-\d{2}-\d{2}} $manifest {} manifest

      if {![info exists manifests($manifest)]} then {
        puts stdout [appendArgs \
            "WARNING: Cannot find master manifest \"" \
            $manifest "\" for archive \"" $archiveFileName \
            "\", skipped."]
    if {![info exists manifests($manifest)]} then {
      puts stdout [appendArgs \
          "WARNING: Cannot find master manifest \"" \
          $manifest "\" for archive \"" $archiveFileName \
          "\", skipped."]

        continue
      }
      continue
    }

      set manifestFileNames [list]
    set manifestFileNames [list]

      foreach list [lrange $manifests($manifest) 1 end] {
        set rawManifestFileNames [set [appendArgs \
            [appendArgs [lindex $manifests($manifest) 0] \
            _manifests] ( $list )]]
    foreach list [lrange $manifests($manifest) 1 end] {
      set rawManifestFileNames [set [appendArgs \
          [appendArgs [lindex $manifests($manifest) 0] \
          _manifests] ( $list )]]

        if {[info exists manifests($manifest,subst)]} then {
          set rawManifestFileNames [subst $rawManifestFileNames]
        }
      if {[info exists manifests($manifest,subst)]} then {
        set rawManifestFileNames [subst $rawManifestFileNames]
      }

        foreach manifestFileName $rawManifestFileNames {
          lappend manifestFileNames $manifestFileName
        }
      }
      foreach manifestFileName $rawManifestFileNames {
        lappend manifestFileNames $manifestFileName
      }
    }

      set listCommand [list]
      lappend listCommand exec -success Success -nocarriagereturns --
    set listCommand [list]
    lappend listCommand exec -success Success -nocarriagereturns --

    set extractCommand [list]
    lappend extractCommand exec -success Success -nocarriagereturns --

      if {[file extension $archiveFileName] eq ".zip"} then {
        if {![file exists $zip]} then {
          usage [appendArgs "tool \"" $zip "\" is missing"]
        }
    if {[file extension $archiveFileName] eq ".zip"} then {
      if {![file exists $zip]} then {
        usage [appendArgs "tool \"" $zip "\" is missing"]
      }

        lappend listCommand $zip -Z -1 $archiveFileName
      } elseif {[file extension $archiveFileName] eq ".exe" && \
          [string match -nocase *Setup*.exe $manifest]} then {
        #
        # HACK: Assume this is an Inno Setup package and process
        #       it using the necessary external tool.
        #
        lappend listCommand $innounp -v $archiveFileName
      } else {
        if {![file exists $rar]} then {
          usage [appendArgs "tool \"" $rar "\" is missing"]
        }
      lappend listCommand $zip -Z -1 $archiveFileName

      lappend extractCommand $zip -j -o $archiveFileName \
          \"%fileName%\" -d \"%directory%\"
    } elseif {[file extension $archiveFileName] eq ".exe" && \
        [string match -nocase *Setup*.exe $manifest]} then {
      #
      # HACK: Assume this is an Inno Setup package and process
      #       it using the necessary external tool.
      #
      lappend listCommand $innounp -v $archiveFileName

      lappend extractCommand $innounp -x -e -y \"-d%directory%\" \
          $archiveFileName \"%fileName%\"
    } else {
      if {![file exists $rar]} then {
        usage [appendArgs "tool \"" $rar "\" is missing"]
      }

        lappend listCommand $rar vb -- $archiveFileName
      }
      lappend listCommand $rar vb -- $archiveFileName

      lappend extractCommand $rar x -ep -y -- $archiveFileName \
          \"%fileName%\" \"%directory%\"
    }

      if {[catch {eval $listCommand} result] == 0} then {
        #
        # HACK: The Inno Setup unpacking tool requires some extra
        #       parsing logic to handle the output.
        #
        if {[string first [file tail $innounp] $listCommand] != -1} then {
          set containedFileNames [list]
    if {[catch {eval $listCommand} result] == 0} then {
      #
      # HACK: The Inno Setup unpacking tool requires some extra
      #       parsing logic to handle the output.
      #
      if {[string first [file tail $innounp] $listCommand] != -1} then {
        set containedFileNames [list]

          foreach {dummy matchFileName} [regexp -line -all -inline -- \
              {^[ 0-9]{10}  \d{4}\.\d{2}\.\d{2} \d{2}:\d{2}  (.*)$} $result] {
            #
            # NOTE: Add the file name extracted from the output
            #       line to the list of file names contained in
            #       this archive.
            #
            lappend containedFileNames $matchFileName
          }
        } else {
          set containedFileNames [split [string map [list \\ /] \
              [string trim $result]] \n]
        }
        foreach {dummy matchFileName} [regexp -line -all -inline -- \
            {^[ 0-9]{10}  \d{4}\.\d{2}\.\d{2} \d{2}:\d{2}  (.*)$} $result] {
          #
          # NOTE: Add the file name extracted from the output
          #       line to the list of file names contained in
          #       this archive.
          #
          lappend containedFileNames $matchFileName
        }
      } else {
        set containedFileNames [split [string map [list \\ /] \
            [string trim $result]] \n]
      }

        foreach manifestFileName $manifestFileNames {
          #
          # TODO: Should we use -nocase here because Windows
          #       is the primary release platform?
          #
          if {[lsearch -exact -- $containedFileNames \
              $manifestFileName] == -1} then {
            puts stdout [appendArgs \
                "ERROR: Archive \"" $archiveFileName \
                "\" missing file \"" $manifestFileName \
                "\" from manifest \"" $manifest "\"."]
      foreach manifestFileName $manifestFileNames {
        #
        # TODO: Should we use -nocase here because Windows
        #       is the primary release platform?
        #
        if {[lsearch -exact -- $containedFileNames \
            $manifestFileName] == -1} then {
          puts stdout [appendArgs \
              "ERROR: Archive \"" $archiveFileName \
              "\" missing file \"" $manifestFileName \
              "\" from manifest \"" $manifest "\"."]

            set exitCode 1
          }
        }
          set exitCode 1
        }

        #
        # NOTE: Skip checking SHA1 hashes if it was not requested on the
        #       command line.
        #
        if {!$withHashes} then {
          continue
        }

        #
        # HACK: For now, only verify SHA1 hashes for those files present
        #       in the repository.
        #
        if {![string match -nocase -- *Source* $archiveFileName]} then {
          continue
        }

        set extractCommandMap [list \
            %fileName% [file nativename $manifestFileName] \
            %directory% [file nativename $extractDirectory]]

        set extractFileName [file join \
            $extractDirectory [file tail $manifestFileName]]

        catch {
          file attributes $extractFileName -readonly false
          file delete $extractFileName
        }

        try {
          if {[catch {eval [string map \
              $extractCommandMap $extractCommand]} result] == 0} then {
            if {[info exists hashes($manifestFileName)]} then {
              set hash [getSha1Sum $extractFileName]

              if {$hash ne $hashes($manifestFileName)} then {
                puts stdout [appendArgs \
                    "ERROR: Archive \"" $archiveFileName \
                    "\" file \"" $manifestFileName \
                    "\" repository hash mismatch, have \"" \
                    $hash "\", want \"" $hashes($manifestFileName) \
                    "\"."]

                set exitCode 1
              }
            } else {
              puts stdout [appendArgs \
                  "ERROR: Archive \"" $archiveFileName \
                  "\" file \"" $manifestFileName \
                  "\" has no repository hash."]

              set exitCode 1
            }
          }
        } finally {
          catch {
            file attributes $extractFileName -readonly false
            file delete $extractFileName
          }
        }
      }

        foreach containedFileName $containedFileNames {
          #
          # TODO: Should we use -nocase here because Windows
          #       is the primary release platform?
          #
          if {[lsearch -exact -- $manifestFileNames \
              $containedFileName] == -1} then {
            puts stdout [appendArgs \
                "ERROR: Archive \"" $archiveFileName \
                "\" contains file \"" $containedFileName \
                "\" not in manifest \"" $manifest "\"."]
      foreach containedFileName $containedFileNames {
        #
        # TODO: Should we use -nocase here because Windows
        #       is the primary release platform?
        #
        if {[lsearch -exact -- $manifestFileNames \
            $containedFileName] == -1} then {
          puts stdout [appendArgs \
              "ERROR: Archive \"" $archiveFileName \
              "\" contains file \"" $containedFileName \
              "\" not in manifest \"" $manifest "\"."]

            set exitCode 1
          }
        }
      } else {
        puts stdout [appendArgs \
            "ERROR: Failed to get list of files in archive \"" \
            $archiveFileName "\", error: " $result]
          set exitCode 1
        }
      }
    } else {
      puts stdout [appendArgs \
          "ERROR: Failed to get list of files in archive \"" \
          $archiveFileName "\", error: " $result]

        set exitCode 1
      }
    }
      set exitCode 1
    }
  }

    exit $exitCode
  exit $exitCode
  } else {
    usage "invalid directory"
  }
} else {
  usage ""
}
Changes to www/release.wiki.
318
319
320
321
322
323
324
325

326
327
328
329
330
331
332
318
319
320
321
322
323
324

325
326
327
328
329
330
331
332







-
+








  <li>Change the current directory to &quot;&lt;root&gt;\Setup&quot;.</li>

  <li>
    Enter the following command to build all the source release packages:
    <br />
    <br />
    <b>..\Externals\Eagle\bin\EagleShell.exe -file verify.eagle Output</b>
    <b>..\Externals\Eagle\bin\EagleShell.exe -file verify.eagle Output true</b>
    <br />
    <br />
    <i>If errors are generated, the file
    &quot;&lt;root&gt;\Setup\data\verify.lst&quot; may need to be updated to
    account for the files that have been added and/or removed from the release
    archives since the previous release.</i>
  </li>