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.
raimue
left a comment
There was a problem hiding this comment.
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.
| 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.
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.
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: