macports-base icon indicating copy to clipboard operation
macports-base copied to clipboard

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

Open mascguy opened this issue 3 years ago • 6 comments

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

mascguy avatar May 16 '21 13:05 mascguy

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.

jmroot avatar May 19 '21 06:05 jmroot

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?

mascguy avatar May 19 '21 11:05 mascguy

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.)

jmroot avatar May 19 '21 11:05 jmroot

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.

mascguy avatar Jun 10 '21 15:06 mascguy

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 https://github.com/macports/macports-infrastructure/commit/87d4d80eff4979cbb679859c04ee6743c25506ec added some Creative Commons licenses.

danchr avatar Jun 12 '21 09:06 danchr

@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.

jmroot avatar Jun 15 '21 10:06 jmroot