Skip to content
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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ryandesign
Copy link
Contributor

port_binary_distributable.tcl:

  • Allow multiple ports to be queried in a single run
  • Display the queried variants, if any, in verbose output

Allow multiple ports to be queried in a single run.
Show the queried variants, if any, in verbose output mesasges.
Copy link
Member

@raimue raimue left a 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]
Copy link
Member

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?

Copy link
Contributor Author

@ryandesign ryandesign Dec 6, 2018

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.

@ryandesign
Copy link
Contributor Author

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.

Yeah, I have a bash shell function that makes it available to me as port distributable. It seems like it would make sense to have it in the port client, except that then changing the list of licenses would require a new release of MacPorts. Unless we moved the license data structures out into, say, the _resources directory of the ports tree, which might be reasonable to do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants