Changeset 17792


Ignore:
Timestamp:
Apr 30, 2006, 5:32:52 AM (14 years ago)
Author:
pguyot (Paul Guyot)
Message:

Suffixes are supported in patchfiles specifications, but the patch command
actually didn't parse the filename and didn't even warn when the patch is not
applied because it cannot be found.

This change fixes that by:

  • moving the distname and disttag-related functions to portutil.tcl
  • fixing portfetch.tcl to actually end up with an error if a patch file cannot

be found (instead of silently ignoring it)

  • fixing portfetch.tcl to actually consider the distname part of the patch files

instead of the whole entry with the optional tag.

Location:
trunk/base/src/port1.0
Files:
3 edited

Legend:

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

    r17197 r17792  
    11# et:ts=4
    22# portfetch.tcl
    3 # $Id: portfetch.tcl,v 1.108 2006/03/27 21:32:27 jberry Exp $
     3# $Id: portfetch.tcl,v 1.109 2006/04/30 05:32:52 pguyot Exp $
    44#
    55# Copyright (c) 2002 - 2003 Apple Computer, Inc.
     
    133133        return "${site}${distfile}"
    134134    }
    135 }
    136 
    137 # Given a distribution file name, return the appended tag
    138 # Example: getdisttag distfile.tar.gz:tag1 returns "tag1"
    139 # / isn't included in the regexp, thus allowing port specification in URLs.
    140 proc getdisttag {name} {
    141     if {[regexp {.+:([0-9A-Za-z_-]+)$} $name match tag]} {
    142         return $tag
    143     } else {
    144         return ""
    145     }
    146 }
    147 
    148 # Given a distribution file name, return the name without an attached tag
    149 # Example : getdistname distfile.tar.gz:tag1 returns "distfile.tar.gz"
    150 # / isn't included in the regexp, thus allowing port specification in URLs.
    151 proc getdistname {name} {
    152     regexp {(.+):[0-9A-Za-z_-]+$} $name match name
    153     return $name
    154135}
    155136
  • trunk/base/src/port1.0/portpatch.tcl

    r13738 r17792  
    11# et:ts=4
    22# portpatch.tcl
    3 # $Id: portpatch.tcl,v 1.29 2005/08/27 00:07:30 pguyot Exp $
     3# $Id: portpatch.tcl,v 1.30 2006/04/30 05:32:52 pguyot Exp $
    44#
    55# Copyright (c) 2002 - 2003 Apple Computer, Inc.
     
    5858
    5959    foreach patch [option patchfiles] {
    60         if {[file exists [option filespath]/$patch]} {
    61             lappend patchlist [option filespath]/$patch
    62         } elseif {[file exists [option distpath]/$patch]} {
    63             lappend patchlist [option distpath]/$patch
     60    set patch_file [getdistname $patch]
     61        if {[file exists [option filespath]/$patch_file]} {
     62            lappend patchlist [option filespath]/$patch_file
     63        } elseif {[file exists [option distpath]/$patch_file]} {
     64            lappend patchlist [option distpath]/$patch_file
     65        } else {
     66                return -code error [format [msgcat::mc "Patch file %s is missing"] $patch]
    6467        }
    6568    }
  • trunk/base/src/port1.0/portutil.tcl

    r13741 r17792  
    11# et:ts=4
    22# portutil.tcl
    3 # $Id: portutil.tcl,v 1.190 2005/08/27 06:26:34 pguyot Exp $
     3# $Id: portutil.tcl,v 1.191 2006/04/30 05:32:52 pguyot Exp $
    44#
    55# Copyright (c) 2004 Robert Shaw <rshaw@opendarwin.org>
     
    401401    }
    402402}
     403
     404########### Distname utility functions ###########
     405
     406# Given a distribution file name, return the appended tag
     407# Example: getdisttag distfile.tar.gz:tag1 returns "tag1"
     408# / isn't included in the regexp, thus allowing port specification in URLs.
     409proc getdisttag {name} {
     410    if {[regexp {.+:([0-9A-Za-z_-]+)$} $name match tag]} {
     411        return $tag
     412    } else {
     413        return ""
     414    }
     415}
     416
     417# Given a distribution file name, return the name without an attached tag
     418# Example : getdistname distfile.tar.gz:tag1 returns "distfile.tar.gz"
     419# / isn't included in the regexp, thus allowing port specification in URLs.
     420proc getdistname {name} {
     421    regexp {(.+):[0-9A-Za-z_-]+$} $name match name
     422    return $name
     423}
     424
    403425
    404426########### Misc Utility Functions ###########
Note: See TracChangeset for help on using the changeset viewer.