FS#6510 - license field restriction
Attached to Project:
Pacman
Opened by Aaron Griffin (phrakture) - Thursday, 01 March 2007, 16:30 GMT
Last edited by Andrew Gregory (andrewgregory) - Thursday, 04 February 2016, 02:53 GMT
Opened by Aaron Griffin (phrakture) - Thursday, 01 March 2007, 16:30 GMT
Last edited by Andrew Gregory (andrewgregory) - Thursday, 04 February 2016, 02:53 GMT
|
Details
Adding this so I don't forget.
A pacman.conf option, named something like "RestrictLicense" would be nice in the future. Cases: #RestrictLicense commented out / nonexistent - no restriction RestrictLicense gpl bsd foo - only allow packages with these licenses installed Other options for usability: (useful or not?) RestrictLicense * - allow all licenses RestrictLicense * !bsd - allow all except bsd licenses |
This task depends upon
Closed by Andrew Gregory (andrewgregory)
Thursday, 04 February 2016, 02:53 GMT
Reason for closing: Won't implement
Additional comments about closing: Hooks can be used to prevent or warn about installation of packages with unapproved licenses. If anybody has a case not met by hooks, file a reopen request.
Thursday, 04 February 2016, 02:53 GMT
Reason for closing: Won't implement
Additional comments about closing: Hooks can be used to prevent or warn about installation of packages with unapproved licenses. If anybody has a case not met by hooks, file a reopen request.
This is a good idea though.
AllowLicenses * (all licenses, the default)
AllowLicenses gpl bsd foo bar
One question though... should we be able to "AllowLicenses custom" ?
Custom is going to be so different that it won't really make sense to blanket it.
There should propably be some predefined licence sets, e.g. "AllowLicenses opensource" might allow all OSI-approved licences and ask about any custom ones.
i found that GNU arranged licenses in categories much better than anyone else :-)
AllowLicenses=(* !some_other_license)
Are there any licenses with spaces in them? then maybe we should use AllowLicenses=(* !'QPL protected license'). This seems very complex though.
One of Arch Linux's strong points (imo) is that it doesn't really care about the licensing, making it very accessible for newbies, especially when it comes to certain media, etc...
And as for "custom" - I like the idea of replacing it with "custom-free" and "custom-nonfree" according to something like the GNU lists as arnuld suggested.
I have only been able to locate this scarce documentation: https://wiki.archlinux.org/index.php/User:Allan/Pacman_Hooks
You could use a PreTransaction hook with NeedsTargets and AbortOnFail, that looks at the list of packages on stdin and inspects their license field using expac. This would only work on packages located in a repository and installed with pacman -S though.
There is no way to get arbitrary metadata from a package via a hook.
You could also use expac to get the information from installed packages in a PostTransaction hook, but then all you can provide is a warning after the package was successfully installed.