System.Data.SQLite
Check-in [79c91d89e7]
Not logged in

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

Overview
Comment:Improve handling of bad hash values and non-source archives in the master release archive verification tool.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 79c91d89e7e0a2ab3b5223ecd80bd4a990639402
User & Date: mistachkin 2014-11-25 00:18:11
Context
2014-11-25
17:29
Make sure the interop files are copied before the PostBuildEvent. Fix for [f16c93a932]. Make sure the interop files are copied when publishing a project that refers to a NuGet package containing them. Fix for [e796ac82c1]. check-in: eb697cca1c user: mistachkin tags: trunk
00:18
Improve handling of bad hash values and non-source archives in the master release archive verification tool. check-in: 79c91d89e7 user: mistachkin tags: trunk
2014-11-24
23:13
Further improvements to the master release archive verification tool. check-in: 8d7c524914 user: mistachkin tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to Setup/verify.eagle.

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
...
294
295
296
297
298
299
300
301
302
303
304

305
306
307
308
309
310
311
...
326
327
328
329
330
331
332

333










334
335
336
337
338
339
340
341
342
343
344
345
346
  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([string map [list \\s " "] [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 [appendArgs \" $fileName \"]] 0 39]






}
 
set argc [llength $argv]

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

................................................................................
        #       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
        }

        #
        # NOTE: Skip anything that does not look like a file.
        #
        if {[string index $manifestFileName end] in [list / \\]} then {
................................................................................

        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 \







|
|

>
|
>










|

>
>
>
>
>
>







 







|
|

|
>







 







>
|
>
>
>
>
>
>
>
>
>
>



|
<
<







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
...
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
...
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
  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 fileName [string map [list \\s " "] [lindex $fields 1]]
        set hash [lindex $fields 2]

        if {[regexp -- {[0-9a-f]{40}} $hash]} then {
          set hashes($fileName) $hash; incr result
        }
      }
    }
  }

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

  set hash [string range [exec -success Success -nocarriagereturns \
      -trimall -- $fossil sha1sum [appendArgs \" $fileName \"]] 0 39]

  if {[regexp -- {[0-9a-f]{40}} $hash]} then {
    return $hash
  }

  return ""
}
 
set argc [llength $argv]

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

................................................................................
        #       command line.
        #
        if {!$withHashes} then {
          continue
        }

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

        #
        # NOTE: Skip anything that does not look like a file.
        #
        if {[string index $manifestFileName end] in [list / \\]} then {
................................................................................

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

              if {[string length $hash] > 0} then {
                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 \
                    "\" could not be hashed."]



                set exitCode 1
              }
            } else {
              puts stdout [appendArgs \
                  "ERROR: Archive \"" $archiveFileName \
                  "\" file \"" $manifestFileName \