Skip to content
Permalink
Browse files

port_binary_distributable: Accept +var1+var2

port_binary_distributable currently expects all variants to be
space-separated, which does not equal to what port(1) accepts. Unify
them so that we can get accurate license info for variants in mpbb.

Note that some ports *do* change their licenses in variants. A popular
example is ffmpeg.
  • Loading branch information
neverpanic committed Mar 10, 2018
1 parent 0d1311d commit 7a0a40816d83010fe76af0769a561f45e966cb62
Showing with 12 additions and 3 deletions.
  1. +12 −3 jobs/port_binary_distributable.tcl
@@ -282,6 +282,14 @@ proc check_licenses {portName variantInfo verbose} {
return 0
}

proc split_variants {variants} {
set result {}
set l [regexp -all -inline -- {([-+])([[:alpha:]_]+[\w\.]*)} $variants]
foreach { match sign variant } $l {
lappend result $variant $sign
}
return $result
}

# Begin

@@ -328,9 +336,10 @@ set ::argv [lrange $::argv 1 end]

array set variantInfo {}
foreach variantSetting $::argv {
set flag [string index $variantSetting 0]
set variantName [string range $variantSetting 1 end]
set variantInfo($variantName) $flag
set variant [split_variants $variantSetting]
foreach {variantName flag} $variant {
set variantInfo($variantName) $flag
}
}

exit [check_licenses $portName [array get variantInfo] $verbose]

0 comments on commit 7a0a408

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