Ticket #31073: macports-31073-mayoff-patch-1

File macports-31073-mayoff-patch-1, 1.1 KB (added by macports@…, 13 years ago)
Line 
1diff --git a/portfetch.tcl b/portfetch.tcl
2index 5341028..5f58e07 100644
3--- a/portfetch.tcl
4+++ b/portfetch.tcl
5@@ -104,7 +104,7 @@ default hg.dir {${workpath}}
6 default hg.tag {tip}
7 
8 # Set distfiles
9-default distfiles {[list [portfetch::suffix $distname]]}
10+default distfiles {[portfetch::suffixlist $distname]}
11 default dist_subdir {${name}}
12 
13 # user name & password
14@@ -222,6 +222,21 @@ proc portfetch::suffix {distname} {
15 # Portfiles, but should better go somewhere else
16 namespace import portfetch::suffix
17 
18+# Given a distname, return a list containing the distname with
19+# extract.suffix appended, or the empty list if there is no suffix.
20+proc portfetch::suffixlist {distname} {
21+    global extract.suffix fetch.type
22+    switch -- "${fetch.type}" {
23+        bzr         -
24+        cvs         -
25+        svn         -
26+        git         -
27+        hg          { return {} }
28+        standard    -
29+        default     { return [list "${distname}${extract.suffix}"] }
30+    }
31+}
32+
33 # Checks patch files and their tags to assemble url lists for later fetching
34 proc portfetch::checkpatchfiles {urls} {
35     global patchfiles all_dist_files patch_sites filespath