[141139] trunk/base/src/port1.0/portchecksum.tcl

jeremyhu at macports.org jeremyhu at macports.org
Sun Oct 11 10:34:17 PDT 2015


Revision: 141139
          https://trac.macports.org/changeset/141139
Author:   jeremyhu at macports.org
Date:     2015-10-11 10:34:17 -0700 (Sun, 11 Oct 2015)
Log Message:
-----------
Use $default_checksum_types for handy copy/paste output on checksum failure

This should help adoption of better, more robust hashing algorithms.

Modified Paths:
--------------
    trunk/base/src/port1.0/portchecksum.tcl

Modified: trunk/base/src/port1.0/portchecksum.tcl
===================================================================
--- trunk/base/src/port1.0/portchecksum.tcl	2015-10-11 17:21:58 UTC (rev 141138)
+++ trunk/base/src/port1.0/portchecksum.tcl	2015-10-11 17:34:17 UTC (rev 141139)
@@ -320,7 +320,20 @@
         } else {
             # Show the desired checksum line for easy cut-paste
             ui_info "The correct checksum line may be:"
-            ui_info [format "%-20s%s" "checksums" [join $sums [format " \\\n%-20s" ""]]]
+            #ui_info [format "%-20s%s" "checksums" [join $sums [format " \\\n%-20s" ""]]]
+
+            set default_sums {}
+            foreach distfile $all_dist_files {
+                if {[llength $all_dist_files] > 1} {
+                    lappend default_sums $distfile
+                }
+
+                foreach type $default_checksum_types {
+                    lappend default_sums [format "%-8s%s" $type [calc_$type $fullpath]]
+                }
+            }
+
+            ui_info [format "%-20s%s" "checksums" [join $default_sums [format " \\\n%-20s" ""]]]
         }
 
         return -code error "[msgcat::mc "Unable to verify file checksums"]"
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20151011/dc5fc3de/attachment.html>


More information about the macports-changes mailing list