New feature: the fields in the metajson with type URL (that is, "eula", "homepage", "bugtracker" and "screenshots") can now contain $LANG. This will be substituted by the two letter language code in which the package is going to be installed. That is the user locale's language code if the description is translated in that language, otherwise the first descriptions' language code.
Example
Code: Select all
{
"id": "myproject",
"description": [
{ "en", "My Project", "English description" }
{ "de", "Meine Projekt", "Deutche Beschreibung" },
{ "es", "Mi Proyecto", "Español descripción" }
],
"version": "1.0.1",
"release": "1.0-beta-rc",
"url": "https://github.com/myuser/myproject/archive/$VERSION-$ARCH.zip",
"category": "tools",
"license": "MIT",
"eula": "https://github.com/myuser/myproject/raw/master/LICENSE.$LANG.txt"
}
In this example if the user using syspkg has the locale "de" for example, then eula will be "https://github.com/myuser/myproject/raw/master/LICENSE.de.txt". On the other hand, if he's using "fr", then (since there's no French translation for the package) it's going to be "https://github.com/myuser/myproject/raw/master/LICENSE.en.txt" (because the first translation is "en").
Messing around with language code like this is necessary, because if there's no French translation for the package, then it is very likely that there's no French EULA either, therefore "LICENSE.fr.txt" would be a dead link, resulting in a HTTP 404. By only allowing values that are listed and defaulting to the first translation makes sure of it that eula URL will point to an existing license file.
FYI: EULAs are shown by package configurator hooks to the user before the package's payload gets downloaded. This is an entirely optional feature, and OS creator might decide to support it or not (by implementing the hook or not), and if so then the package maintainers can decide whether to actually use it for a particular package or not (by adding "eula" keys to the metajsons or not).
The provided syspkg demo command line tool's hook for example displays it like this (the contents of the license are downloaded from the "eula" URL):
Code: Select all
Copyright (C) 2021 bzt (bztsrc@gitlab)
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use, copy,
modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
Accept terms of use (Enter = yes, anything else or ^C = no)?
For a GUI, one possible way how to do it is similar to how MacOS .mpkg displays licenses, for example:
However syspkg mandates that the link must point to a plain text file with the actual terms and a clear "Accept terms of use?" question must be asked with a clear "Yes" and "No" answer options (this is a lawyer's thing to comply with both USA and EU law, there must be a question and the answer options must be straightforward and clear. Using buttons like "Continue" above or "I comply" are not good; and I have absolutely no idea why Python is showing its history instead of its license).
Cheers,
bzt