Opened 17 years ago

Closed 17 years ago

Last modified 4 years ago

#788 closed defect (fixed)

extract.sufx not set if you use both distfiles and use_bzip2

Reported by: gwright@… Owned by: fkr@…
Priority: Normal Milestone:
Component: base Version: 1.0
Keywords: Cc:
Port:

Description

If you have to specify the distfile along with use_bzip2, the extract suffix is not set.

An example:

The port name is ghc The version is 6.0.1 The file to be fetched is ghc-6.0.1-src.tar.bz2

using

use_bzip2 distfiles ${name}-${version}-src${extract.sufx}

results in an attempt to fetch ghc-6.0.1-src.tar.gz. use_zip similarly fails in this case.

Attachments (2)

patch-portfetch.tcl (1.4 KB) - added by tp62@… 17 years ago.
Patch for portfetch.tcl
patch-portfetch.2.tcl (1.5 KB) - added by tp62@… 17 years ago.
Correct patch for portfetch.tcl

Download all attachments as: .zip

Change History (6)

comment:1 Changed 17 years ago by fkr@…

Owner: changed from darwinports-bugs@… to fkr@…

comment:2 Changed 17 years ago by tp62@…

Pretty self-explanatory - I define fix_extract_suffix as the handling procedure for use_bzip2 and use_zip. When they are 'set', I check and set extract.suffix as needed. Also, removed code from suffix procedure, which is now unnecessary. Diff:

--- portfetch.tcl-orig  Wed Dec 10 16:58:22 2003
+++ portfetch.tcl       Wed Dec 10 16:59:44 2003
@@ -70,18 +70,17 @@
 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 {name action} {
+    global extract.suffix use_bzip2 use_zip
+    if {[string equal ${action} "set"]} {
+        if {[tbool use_bzip2]} {
+            set extract.suffix .tar.bz2
+        } elseif {[tbool use_zip]} {
+            set extract.suffix .zip
+        }
     }
 }
 
@@ -93,17 +92,11 @@
 
 # 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
Last edited 4 years ago by ryandesign (Ryan Schmidt) (previous) (diff)

Changed 17 years ago by tp62@…

Attachment: patch-portfetch.tcl added

Patch for portfetch.tcl

Changed 17 years ago by tp62@…

Attachment: patch-portfetch.2.tcl added

Correct patch for portfetch.tcl

comment:3 Changed 17 years ago by tp62@…

attachments.isobsolete: 01

comment:4 Changed 17 years ago by jkh@…

Resolution: fixed
Status: newclosed

Committed 2nd version of fix, looks good. Thanks!

Note: See TracTickets for help on using tickets.