Use a shell script to encapsulate the same search mechanism as used in the search Web script, but process the result further to extract the licenses of a given package and optionally given version from the related SPDX tag:value files at the O Github repository:
#!/bin/bash
if test -z "$1"
then
echo "Usage: $0 <package> <version>"
exit 1
fi
package="$1"
version="$2"
if test "$version"
then
package="$package/version-$version"
fi
wget -qO - https://www.osselot.org/licenses.php?$package
If the script is called "getlicenses" and invoked for the software package that was used as example on the search page as
getlicenses angular 15.2.2 | grep -v '^<'
the following list of licenses is returned:
Apache-2.0
Apache-2.0 AND 0BSD AND BSD-2-Clause AND BSD-3-Clause AND BSD-3-Clause-Salesforce AND ISC AND MIT
BSD-3-Clause
CC-BY-4.0
MIT
NOASSERTION
Public-domain
NOASSERTION
If the version number had been omitted, the licenses of all available versions would have been listed:
getlicenses angular | grep -v '^<'
angular/version-15.1.0:
Apache-2.0
Apache-2.0 AND 0BSD AND BSD-2-Clause AND BSD-3-Clause AND BSD-3-Clause-Salesforce AND ISC AND MIT
BSD-3-Clause
CC-BY-4.0
MIT
NOASSERTION
Public-domain
angular/version-15.2.2:
Apache-2.0
Apache-2.0 AND 0BSD AND BSD-2-Clause AND BSD-3-Clause AND BSD-3-Clause-Salesforce AND ISC AND MIT
BSD-3-Clause
CC-BY-4.0
MIT
NOASSERTION
Public-domain
angular/version-16.0.1:
Apache-2.0
Apache-2.0 AND 0BSD AND BSD-2-Clause AND BSD-3-Clause AND BSD-3-Clause-Salesforce AND ISC AND MIT
BSD-3-Clause
CC-BY-4.0
MIT
NOASSERTION
Public-domain
angular/version-16.1.2:
Apache-2.0
Apache-2.0 AND 0BSD AND BSD-2-Clause AND BSD-3-Clause AND BSD-3-Clause-Salesforce AND ISC AND MIT
BSD-3-Clause
CC-BY-4.0
MIT
NOASSERTION
Public-domain
Web interface to immediately search for a given package and provide a list of licenses
Look for other software packages that may have already been curated at O and provide links to display the licenses that are used by a particular version
Interface to obtain entire disclosure documents
A similar interface provides for retrieving the entire disclosure files of particular software packages and versions instead of the licenses in use.
Interface to obtain individually designed do-it-yourself disclosure documents