Changeset 4481 for trunk/base


Ignore:
Timestamp:
Jan 6, 2004, 9:47:33 AM (20 years ago)
Author:
jkh
Message:

Fix conflict between extract_suffix and use_bzip2 by making both use
the same work procedure.
Bug: 788
Submitted by: Toby Peterson <tp62@…>

File:
1 edited

Legend:

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

    r4470 r4481  
    7171
    7272# Option-executed procedures
    73 namespace eval options { }
    74 proc options::use_bzip2 {args} {
    75     global use_bzip2 extract.suffix
    76     if {[tbool use_bzip2]} {
    77         set extract.suffix .tar.bz2
    78     }
    79 }
    80 
    81 proc options::use_zip {args} {
    82     global use_zip extract.suffix
    83     if {[tbool use_zip]} {
    84         set extract.suffix .zip
     73option_proc use_bzip2 fix_extract_suffix
     74option_proc use_zip fix_extract_suffix
     75
     76proc fix_extract_suffix {option action args} {
     77    global extract.suffix
     78    if {[string equal ${action} "set"] && [tbool args]} {
     79        switch $option {
     80            use_bzip2 {
     81                set extract.suffix .tar.bz2
     82            }
     83            use_zip {
     84                set extract.suffix .zip
     85            }
     86        }
    8587    }
    8688}
     
    9496# Given a distname, return a suffix based on the use_zip / use_bzip2 / extract.suffix options
    9597proc suffix {distname} {
    96     global extract.suffix use_bzip2 use_zip fetch.type
     98    global extract.suffix fetch.type
    9799    if {"${fetch.type}" == "cvs"} {
    98100        return ""
    99101    }
    100     if {[tbool use_bzip2]} {
    101         return ${distname}.tar.bz2
    102     } elseif {[tbool use_zip]} {
    103         return ${distname}.zip
    104     } else {
    105         return ${distname}${extract.suffix}
    106     }
     102    return ${distname}${extract.suffix}
    107103}
    108104
Note: See TracChangeset for help on using the changeset viewer.