Ticket #788: patch-portfetch.tcl

File patch-portfetch.tcl, 1.4 KB (added by tp62@…, 21 years ago)

Patch for portfetch.tcl

Line 
1--- portfetch.tcl.old   Tue Jan  6 03:53:17 2004
2+++ portfetch.tcl       Tue Jan  6 03:56:04 2004
3@@ -70,18 +70,17 @@
4 default distfiles {[suffix $distname]}
5 
6 # Option-executed procedures
7-namespace eval options { }
8-proc options::use_bzip2 {args} {
9-    global use_bzip2 extract.suffix
10-    if {[tbool use_bzip2]} {
11-        set extract.suffix .tar.bz2
12-    }
13-}
14+option_proc use_bzip2 fix_extract_suffix
15+option_proc use_zip fix_extract_suffix
16 
17-proc options::use_zip {args} {
18-    global use_zip extract.suffix
19-    if {[tbool use_zip]} {
20-        set extract.suffix .zip
21+proc fix_extract_suffix {name action} {
22+    global extract.suffix use_bzip2 use_zip
23+    if {[string equal ${action} "set"]} {
24+        if {[tbool use_bzip2]} {
25+            set extract.suffix .tar.bz2
26+        } elseif {[tbool use_zip]} {
27+            set extract.suffix .zip
28+        }
29     }
30 }
31 
32@@ -93,17 +92,11 @@
33 
34 # Given a distname, return a suffix based on the use_zip / use_bzip2 / extract.suffix options
35 proc suffix {distname} {
36-    global extract.suffix use_bzip2 use_zip fetch.type
37+    global extract.suffix fetch.type
38     if {"${fetch.type}" == "cvs"} {
39         return ""
40     }
41-    if {[tbool use_bzip2]} {
42-       return ${distname}.tar.bz2
43-    } elseif {[tbool use_zip]} {
44-       return ${distname}.zip
45-    } else {
46-       return ${distname}${extract.suffix}
47-    }
48+    return ${distname}${extract.suffix}
49 }
50 
51 # Given a site url and the name of the distfile, assemble url and