Changeset 17214 for trunk/base


Ignore:
Timestamp:
Mar 28, 2006, 6:01:07 PM (14 years ago)
Author:
jberry
Message:

Add an option to completely skip the checksum phase.

Setting checksum.skip=yes will skip the checksuming phase. This should never be used in a
portfile, but might be useful on the command line, especially while testing or
trying to install an old version of a port, or a version where the checksum is incorrect.
A better solution where the checksum is wrong would be to fix and report the bad checksum.

For instance, to install an outdated version of grep without hacking the portfile, do:

port install grep version=2.5 checksum.skip=yes

Instead of skipping the checksum calculation, you could also explicitly specify the checksum:

port install grep version=2.5 checksums="md5 thechecksum"

Warnings:

  • Overriding of the port version on the command line is for dire straights only. Side effects are to be expected. Patches and other portfile tweaks may not be appropriate for the specified version. Remember: you are causing a specific version of the source to be built using Portfile rules for the version in the Portfile. You will need to do a make clean following such an operation, as port doesn't know which version of the port has been built. You have been warned.
  • Any use of checksum.skip in a portfile is considered inappropriate.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/base/src/port1.0/portchecksum.tcl

    r14601 r17214  
    11# et:ts=4
    22# portchecksum.tcl
    3 # $Id: portchecksum.tcl,v 1.45 2005/10/13 19:45:49 pguyot Exp $
     3# $Id: portchecksum.tcl,v 1.46 2006/03/28 18:01:07 jberry Exp $
    44#
    55# Copyright (c) 2002 - 2004 Apple Computer, Inc.
     
    4141
    4242# Options
    43 options checksums
     43options checksums checksum.skip
    4444
    4545# Defaults
    4646default checksums ""
     47default checksum.skip false
    4748
    4849set_ui_prefix
     
    184185#
    185186proc checksum_main {args} {
    186         global UI_PREFIX all_dist_files checksums_array portverbose
     187        global UI_PREFIX all_dist_files checksums_array portverbose checksum.skip
    187188
    188189        # If no files have been downloaded, there is nothing to checksum.
    189190        if {![info exists all_dist_files]} {
     191                return 0
     192        }
     193       
     194        # Completely bypass checksumming if checksum.skip=yes
     195        # This should be considered an extreme measure
     196        if {[tbool checksum.skip]} {
     197                ui_info "$UI_PREFIX Skipping checksum phase"
    190198                return 0
    191199        }
Note: See TracChangeset for help on using the changeset viewer.