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

add licensecheck target, copied from macports-infrastructure; updated work from defunct PR #211 #240

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

mascguy
Copy link
Member

@mascguy mascguy commented May 16, 2021

This PR encompasses the excellent work by @danchr, from defunct PR 211. It includes one of the key requested changes, which is to source license data from _resources.

The corresponding PR for macports-ports, encompassing both the aforementioned license data, as well as updated BASH completions, is here:

PR 11033 - macports base support: add licenses for new licensecheck target; update bash completions

}

proc portlicensecheck::licensecheck_main {args} {
# Obtain licenses from '_resources/port1.0/licenses/licenses.tcl'.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NOTE: As a starting point, I named the new resource area licenses, to be more general. With the idea being that the data might be used elsewhere at some point.

But if folks prefer that it be specific to this target, it can be renamed to licensecheck.

@jmroot
Copy link
Member

jmroot commented May 19, 2021

Moving conversation from #211.

In terms of sharing the data and logic, can the MacPorts infrastructure scripts utilize MacPorts base?

Sure. That has the (perhaps minor) drawback that it can then only be updated with a base release, of course.

(For example, simplifying distributable_lib.tcl to delegate the license check to port licensecheck.)

That sounds backwards.

That would alleviate all of your concerns, correct?

Having base ship distributable_lib.tcl (without removing features) and use it to implement the new action would go a long way.

@mascguy
Copy link
Member Author

mascguy commented May 19, 2021

In terms of sharing the data and logic, can the MacPorts infrastructure scripts utilize MacPorts base?

Sure. That has the (perhaps minor) drawback that it can then only be updated with a base release, of course.

Certainly, and we wouldn't want to be tied to a MacPorts base release. To eliminate that, could we simply migrate most of the core logic to _resources?

@jmroot
Copy link
Member

jmroot commented May 19, 2021

Certainly, and we wouldn't want to be tied to a MacPorts base release. To eliminate that, could we simply migrate most of the core logic to _resources?

The drawback then is that you can't run it without a copy of the official ports tree. (Like when running tests, or when using only a custom ports tree.)

@mascguy mascguy modified the milestones: 2.7.1, 2.7.2 May 25, 2021
@mascguy
Copy link
Member Author

mascguy commented Jun 10, 2021

After still more reflection, I've come to a key realization: License info rarely changes. So while it would be nice to source that data from the _resources area, baking it into the release isn't a big deal.

So I'm willing to integrate it all into base.

@jmr Josh, can you provide an example, relative to how you'd like to be able to use this functionality from a utility script? Basically I just need the template to test/validate. That said, you are also more than welcome to directly push changes to this branch. (My guess is that you could quickly tweak this stuff in 10 minutes or less, for your needs. And while I enjoy learning, I'd also love to get this functionality merged. So up to you!)

Is it essentially something like the following, per your "find port dependents by exact name/regex" example you sent to the mailing list?

#!/usr/bin/env port-tclsh

package require macports
mportinit

[...interaction with new licensecheck functionality...]

I might need you to elaborate a bit beyond that, but you get the gist.

@danchr
Copy link
Member

danchr commented Jun 12, 2021

After still more reflection, I've come to a key realization: License info rarely changes. So while it would be nice to source that data from the _resources area, baking it into the release isn't a big deal.

Just to back this up; AFAICT the license lists have been unmodified since 2015, when commit macports/macports-infrastructure@87d4d80 added some Creative Commons licenses.

@jmroot
Copy link
Member

jmroot commented Jun 15, 2021

@jmr Josh, can you provide an example, relative to how you'd like to be able to use this functionality from a utility script?

This is the main existing client: https://github.com/macports/mpbb/blob/master/tools/sort-with-subports.tcl

There's another one I'm planning to add to the new buildbot config, which I can show you if you need it, though it uses distributable_lib.tcl in much the same way as the first one.

@mascguy mascguy marked this pull request as draft June 22, 2021 15:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

3 participants