-
-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
port_binary_distributable: more verbose description of failures #14
base: master
Are you sure you want to change the base?
Conversation
I've changed this to describe all reasons why a port isn't distributable, and properly capitalise license names. 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 Fixes: https://trac.macports.org/ticket/60995
@jmroot Do you have any concerns about this change? I'd like to have this more verbose output available, but I haven't analyzed the code to determine if this introduces any regressions. |
I haven't had a chance to look at it. No idea if it's correct or not at this point, sorry. |
e34a156
to
df1d5d6
Compare
FWIW I made a go at moving this to a command in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add an option to turn on this new mode of operation, which we might call something like "explain mode", and don't do all the extra work if it is not turned on.
@@ -203,6 +203,7 @@ proc remove_version {license} { | |||
|
|||
proc check_licenses {portName variantInfo} { | |||
array set portSeen {} | |||
set failures {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use [list]
so the variable is a pure list.
} | ||
} | ||
|
||
# start with deps of top-level port | ||
set portPaths [dict create [lindex $top_info 0] [list]] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this really need a dict rather than just an array? And what's the purpose of adding an entry for the whole list of dependencies?
# mark as seen and remove from the list | ||
set portSeen($aPort) 1 | ||
set portList [lreplace $portList 0 0] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moving this makes the comment above incorrect.
while {[llength $portList] > 0} { | ||
set aPort [lindex $portList 0] | ||
set portList [lreplace $portList 0 0] | ||
if {[info exists portSeen($aPort)] && $portSeen($aPort) eq 1} { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
eq
is for string comparisons and strings should always be quoted in expressions. However there's really no need to check the value at all.
This would be great to finish and merge. Dan, are you still interested in working on this, or would you prefer that someone take this over? |
Please do pick this up! |
Sounds good. And thanks again for your hard work, it'll be great to see it used! |
Please note that this only describes the first such instance of any failure, but that's better than not describing it at all, I'd say. An example:
Fixes: https://trac.macports.org/ticket/60995
UPDATED
Now describes all failures, for example: