Skip to content

Commit

Permalink
Trash the distfile if the checksum doesn't match and -v wasn't provided.
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.macports.org/repository/macports/trunk/base@14601 d073be05-634f-4543-b044-5fe20cf6d1d6
  • Loading branch information
pguyot committed Oct 13, 2005
1 parent 45d12c9 commit 0ebccaa
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/port1.0/portchecksum.tcl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# et:ts=4
# portchecksum.tcl
# $Id: portchecksum.tcl,v 1.44 2005/08/27 00:07:30 pguyot Exp $
# $Id: portchecksum.tcl,v 1.45 2005/10/13 19:45:49 pguyot Exp $
#
# Copyright (c) 2002 - 2004 Apple Computer, Inc.
# Copyright (c) 2004 - 2005 Paul Guyot <pguyot@kallisys.net>
Expand Down Expand Up @@ -183,7 +183,7 @@ proc checksum_start {args} {
# Target main procedure. Verifies the checksums of all distfiles.
#
proc checksum_main {args} {
global UI_PREFIX all_dist_files checksums_array
global UI_PREFIX all_dist_files checksums_array portverbose

# If no files have been downloaded, there is nothing to checksum.
if {![info exists all_dist_files]} {
Expand Down Expand Up @@ -225,6 +225,10 @@ proc checksum_main {args} {
ui_debug "[format [msgcat::mc "Correct (%s) checksum for %s"] $type $distfile]"
} else {
ui_error "[format [msgcat::mc "Checksum (%s) mismatch for %s"] $type $distfile]"
# if -v isn't specified, trash the distfile.
if {${portverbose} == "no"} {
file delete -force ${fullpath}
}
ui_info "[format [msgcat::mc "Portfile checksum: %s %s %s"] $distfile $type $sum]"
ui_info "[format [msgcat::mc "Distfile checksum: %s %s %s"] $distfile $type $calculated_sum]"

Expand Down

0 comments on commit 0ebccaa

Please sign in to comment.