diff --git src/port1.0/portutil.tcl src/port1.0/portutil.tcl
index 362b3ea..4122b9f 100644
|
|
proc variant_desc {porturl variant} { |
767 | 773 | # Portfile level procedure to provide support for declaring platform-specifics |
768 | 774 | # Basically, just a fancy 'if', so that Portfiles' platform declarations can |
769 | 775 | # be more readable, and support arch and version specifics |
770 | | proc platform {args} { |
| 776 | proc platform {os args} { |
771 | 777 | global os.platform os.subplatform os.arch os.major |
772 | 778 | |
773 | 779 | set len [llength $args] |
774 | | if {$len < 2} { |
| 780 | if {$len < 1} { |
775 | 781 | return -code error "Malformed platform specification" |
776 | 782 | } |
777 | | set code [lindex $args end] |
778 | | set os [lindex $args 0] |
779 | | set args [lrange $args 1 [expr {$len - 2}]] |
| 783 | if {[lindex $args end-1] eq "else"} { |
| 784 | set code [lindex $args end-2] |
| 785 | set altcode [lindex $args end] |
| 786 | set consumed 3 |
| 787 | } else { |
| 788 | set code [lindex $args end] |
| 789 | set altcode "" |
| 790 | set consumed 1 |
| 791 | } |
780 | 792 | |
781 | | foreach arg $args { |
| 793 | foreach arg [lrange $args 0 end-$consumed] { |
782 | 794 | if {[regexp {(^[0-9]+$)} $arg match result]} { |
783 | 795 | set release $result |
784 | 796 | } elseif {[regexp {([a-zA-Z0-9]*)} $arg match result]} { |
… |
… |
proc platform {args} { |
799 | 811 | # Execute the code if this platform matches the platform we're on |
800 | 812 | if {$match} { |
801 | 813 | uplevel 1 $code |
| 814 | } elseif {${altcode} ne ""} { |
| 815 | uplevel 1 $altcode |
802 | 816 | } |
803 | 817 | } |
804 | 818 | |