-
-
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.tcl: Allow multiple ports to be queried in a single run #9
base: master
Are you sure you want to change the base?
port_binary_distributable.tcl: Allow multiple ports to be queried in a single run #9
Conversation
Allow multiple ports to be queried in a single run.
Show the queried variants, if any, in verbose output mesasges.
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.
Overall, I think this functionality should really be moved to the port client to also benefit from the usual port list parsing instead of re-implementing something similar here.
@@ -284,7 +283,7 @@ proc check_licenses {portName variantInfo verbose} { | |||
|
|||
proc split_variants {variants} { | |||
set result {} | |||
set l [regexp -all -inline -- {([-+])([[:alpha:]_]+[\w\.]*)} $variants] | |||
set l [regexp -all -inline -- {(?:[[:space:]]|^)([-+])([[:alpha:]_]+[\w\.]*)(?:[[:space:]]|$)} $variants] |
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.
Not sure whether I understand this change. Why would it be necessary to match the spaces explicitly now, but was not before?
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.
Passing in a port name like youtube-dl
was incorrectly being processed as a variant -dl
. This change ensures that we are matching a +
or -
at the beginning of the entry only, not somewhere in the middle.
Before, this was guaranteed to be the case, because we were only calling split_variants
on a list of strings that definitely began with a +
or -
. (Well, we were relying on the user to supply the variants in that format.) But now I am calling it with entries that could be a variant or could be a port, and I'm using the return value to determine which it was.
Yeah, I have a bash shell function that makes it available to me as |
port_binary_distributable.tcl: