Skip to content

Commit 46a5473

Browse files
committed
port_binary_distributable: output all reasons why a port isn't distributable
An example: $ ./port_binary_distributable.tcl -v mplayer +glx +faac "mplayer" is not distributable because its dependency "faac" has license "Restrictive" which is not known to be distributable: faac "mplayer" is not distributable because its license "gpl" conflicts with license "OpenSSL": mesa -> xorg-libxcb -> python38 -> openssl "mplayer" is not distributable because its license "gpl" conflicts with license "SSLeay": mesa -> xorg-libxcb -> python38 -> openssl
1 parent 7ecdcb4 commit 46a5473

File tree

2 files changed

+17
-8
lines changed

2 files changed

+17
-8
lines changed

jobs/distributable_lib.tcl

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,7 @@ proc remove_version {license} {
203203

204204
proc check_licenses {portName variantInfo} {
205205
array set portSeen {}
206+
set failures {}
206207
set top_info [infoForPort $portName $variantInfo]
207208
if {$top_info eq {}} {
208209
return 1
@@ -228,7 +229,7 @@ proc check_licenses {portName variantInfo} {
228229
}
229230
lappend top_license_names $sub_names
230231
if {!$any_good} {
231-
return [list 1 "\"$portName\" is not distributable because its license \"$lic\" is not known to be distributable"]
232+
lappend failures "\"$portName\" is not distributable because its license \"$lic\" is not known to be distributable"
232233
}
233234
}
234235

@@ -241,9 +242,12 @@ proc check_licenses {portName variantInfo} {
241242

242243
while {[llength $portList] > 0} {
243244
set aPort [lindex $portList 0]
245+
set portList [lreplace $portList 0 0]
246+
if {[info exists portSeen($aPort)] && $portSeen($aPort) eq 1} {
247+
continue
248+
}
244249
# mark as seen and remove from the list
245250
set portSeen($aPort) 1
246-
set portList [lreplace $portList 0 0]
247251
if {[info exists noconflict_ports($aPort)]} {
248252
continue
249253
}
@@ -295,10 +299,9 @@ proc check_licenses {portName variantInfo} {
295299
}
296300

297301
if {!$any_good} {
298-
return [list 1 "\"$portName\" is not distributable because its dependency \"$aPort\" has license \"$lic\" which is not known to be distributable: [join $parentPath " -> "]"]
299-
}
300-
if {!$any_compatible} {
301-
return [list 1 "\"$portName\" is not distributable because its license \"$top_lic\" conflicts with license \"$full_lic\": [join $parentPath " -> "]"]
302+
lappend failures "\"$portName\" is not distributable because its dependency \"$aPort\" has license \"$lic\" which is not known to be distributable: [join $parentPath " -> "]"
303+
} elseif {!$any_compatible} {
304+
lappend failures "\"$portName\" is not distributable because its license \"$top_lic\" conflicts with license \"$full_lic\": [join $parentPath " -> "]"
302305
}
303306
}
304307

@@ -316,7 +319,11 @@ proc check_licenses {portName variantInfo} {
316319
}
317320
}
318321

319-
return [list 0 "\"$portName\" is distributable"]
322+
if {[llength $failures] ne 0} {
323+
return [list 1 $failures]
324+
} else {
325+
return [list 0 [list "\"$portName\" is distributable"]]
326+
}
320327
}
321328

322329
# given a variant string, return an array of variations

jobs/port_binary_distributable.tcl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,8 @@ if {$dbdir ne ""} {
9393
write_license_db $dbdir
9494
}
9595
if {$verbose} {
96-
puts [lindex $results 1]
96+
foreach result [lindex $results 1] {
97+
puts $result
98+
}
9799
}
98100
exit [lindex $results 0]

0 commit comments

Comments
 (0)