Skip to content
Permalink
Browse files

Fix conflict between extract_suffix and use_bzip2 by making both use

the same work procedure.
Bug:            https://trac.macports.org/ticket/788
Submitted by:   Toby Peterson <tp62@cornell.edu>

git-svn-id: https://svn.macports.org/repository/macports/trunk/base@4481 d073be05-634f-4543-b044-5fe20cf6d1d6
  • Loading branch information
Jordan K. Hubbard
Jordan K. Hubbard committed Jan 6, 2004
1 parent d1c702c commit a4c68a385b9385d24eac3220806bb8d59ba76826
Showing with 15 additions and 19 deletions.
  1. +15 −19 src/port1.0/portfetch.tcl
@@ -70,18 +70,20 @@ default mirror_sites.listpath {"${portresourcepath}/fetch/"}
default distfiles {[suffix $distname]}

# Option-executed procedures
namespace eval options { }
proc options::use_bzip2 {args} {
global use_bzip2 extract.suffix
if {[tbool use_bzip2]} {
set extract.suffix .tar.bz2
}
}
option_proc use_bzip2 fix_extract_suffix
option_proc use_zip fix_extract_suffix

proc options::use_zip {args} {
global use_zip extract.suffix
if {[tbool use_zip]} {
set extract.suffix .zip
proc fix_extract_suffix {option action args} {
global extract.suffix
if {[string equal ${action} "set"] && [tbool args]} {
switch $option {
use_bzip2 {
set extract.suffix .tar.bz2
}
use_zip {
set extract.suffix .zip
}
}
}
}

@@ -93,17 +95,11 @@ set UI_PREFIX "---> "

# Given a distname, return a suffix based on the use_zip / use_bzip2 / extract.suffix options
proc suffix {distname} {
global extract.suffix use_bzip2 use_zip fetch.type
global extract.suffix fetch.type
if {"${fetch.type}" == "cvs"} {
return ""
}
if {[tbool use_bzip2]} {
return ${distname}.tar.bz2
} elseif {[tbool use_zip]} {
return ${distname}.zip
} else {
return ${distname}${extract.suffix}
}
return ${distname}${extract.suffix}
}

# Given a site url and the name of the distfile, assemble url and

0 comments on commit a4c68a3

Please sign in to comment.
You can’t perform that action at this time.