diff --git a/PKGBUILD b/PKGBUILD index 26467c0..9a1dd0b 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -5,7 +5,7 @@ pkgname=vrms-arch-git _pkgname=vrms-arch -pkgver=2.0.r0.g86a3195 +pkgver=2.0.1.r3.g79316e8 pkgrel=1 pkgdesc="Virtual Richard M. Stallman for Arch Linux (gardenapple's fork)" arch=('any') diff --git a/src/vrms_arch/disambiguation.py b/src/vrms_arch/disambiguation.py index 45dbd17..9b991d3 100644 --- a/src/vrms_arch/disambiguation.py +++ b/src/vrms_arch/disambiguation.py @@ -6,6 +6,7 @@ 'adobe-source-serif-pro-fonts': ['OFL'], 'amd-ucode': ['custom:non-free'], 'aom': ['BSD', 'custom:free'], + 'apptainer': ['BSD-3-Clause-LBNL'], 'blas': ['custom:BSD-like'], 'boost': ['Boost'], 'boost-libs': ['Boost'], @@ -17,6 +18,7 @@ 'cups-filters': ['GPL', 'GPL2', 'GPL3-only', 'GPL3'], 'db': ['custom:Sleepycat'], 'discord': ['custom:non-free'], + 'endless-sky': ['custom:GPL-2.0-or-later', 'custom:GPL-3.0-or-later', 'custom:public-domain', 'custom:CC0', 'custom:CC-BY-2.0', 'custom:CC-BY-3.0', 'custom:CC-BY-4.0', 'custom:CC-BY-SA-3.0', 'custom:CC-BY-SA-4.0'], 'expat': ['MIT'], 'file': ['BSD'], 'flashplugin': ['custom:non-free'], @@ -131,6 +133,7 @@ 'spirv-tools': ['Apache'], 'steam': ['custom:non-free'], 'sudo': ['ISC', 'BSD3', 'BSD2', 'ZLIB'], + 'svt-av1': ['BSD-3-Clause'], # additionally 'Alliance for Open Media Patent License 1.0' 'tcl': ['custom:BSD-like'], 'tk': ['custom:BSD-like'], 'ttf-bitstream-vera': ['custom:bitstream-vera'], @@ -157,6 +160,7 @@ 'xfce4-wavelan-plugin': ['BSD2'], 'xfce4-xkb-plugin': ['BSD2'], 'xkeyboard-config': ['MIT', 'custom:HPND', 'custom:X11', 'custom:MIT-style'], + 'xcalib': ['GPL-2.0'], # additionally with optional postcardware 'xorg-bdftopcf': ['custom:X11'], 'xorg-fonts-encodings': ['custom:Public Domain'], 'xorg-font-util': ['custom:UCD', 'MIT', 'BSD2'], @@ -197,6 +201,8 @@ 'zoom': ['custom:non-free'], # AUR 'zsh-abbr': ['custom:CC-BY-NC-SA-4.0', 'custom:Hippocratic'], # AUR 'zsh': ['custom:MIT-style', 'GPL'], + 'zeroc-ice': ['GPL-2.0-only'], # alternatively non-free commercial license + 'zeroc-ice-java': ['GPL-2.0-only'], # alternatively non-free commerical license } class Package(object): @@ -213,5 +219,10 @@ def __init__(self, db): self.packages.append(Package(pkg.name, AMBIGUOUS_PACKAGES[pkg.name])) elif pkg.name.startswith("lib32") and pkg.name[6:] in AMBIGUOUS_PACKAGES: self.packages.append(Package(pkg.name, AMBIGUOUS_PACKAGES[pkg.name[6:]])) + elif any([' OR ' in l for l in pkg.licenses]): + licenses = [] + for l in pkg.licenses: + licenses.extend(l.split(' OR ')) + self.packages.append(Package(pkg.name, licenses)) else: self.packages.append(Package(pkg.name, pkg.licenses)) diff --git a/src/vrms_arch/license_finder.py b/src/vrms_arch/license_finder.py index 886dafa..b209890 100644 --- a/src/vrms_arch/license_finder.py +++ b/src/vrms_arch/license_finder.py @@ -4,7 +4,8 @@ def clean_license_name(license): license = license.lower() - license = re.sub('(?:^custom:|[,\s_"-])', '', license) + license = re.sub('(?:^custom:|[,\s_"/\(\)\:-])', '', license) + license = re.sub('licence', 'license', license) return license AMBIGUOUS_LICENSES = [clean_license_name(license) for license in [ @@ -12,22 +13,23 @@ def clean_license_name(license): "other", "unknown", # CCPL (Creative Commons) should be specified with one of the - # sublicenses (one of /usr/share/licenses/common/CCPL/*) , some of + # sublicenses (one of /usr/share/licenses/common/CCPL/*), some of # which are non-free + "CC", + "CCPL", "Creative Commons", - "CCPL", # ['claws-mail-themes', '0ad', '0ad-data', 'archlinux-lxdm-theme', 'mari0', 'performous-freesongs'] - "Creative Commons" ]] FREE_LICENSES = [clean_license_name(license) for license in [ 'AFL-3.0', 'AGPL', 'AGPL3', + 'AGPL-3.0-only', + 'AGPL-3.0-or-later', 'Apache', 'Apache2', 'Apache 2.0', 'Apache 2.0 with LLVM Exception', - 'Apache 2.0 with LLVM Execption', 'Apache License (2.0)', 'Arphic Public License', 'Artistic', @@ -35,23 +37,32 @@ def clean_license_name(license): 'Beerware', 'bitstream-vera', 'Boost', + '0BSD', 'BSD', 'BSD2', - 'BSD-2-clause', + 'BSD-2-Clause', + 'BSD-2-Clause-Patent', 'BSD3', - 'BSD-3-clause', + 'BSD-3-Clause', + 'BSD-3-Clause-LBNL', 'BSD License', 'BSD-like', + 'BSDL', 'BSD-style', 'BSL', 'bzip2', 'CC0', - 'CC0 1.0', + 'CC0-1.0', + 'CC-BY', + 'CC-BY-2.5', + 'CC-BY-3.0', + 'CC-BY-4.0', 'CC-BY-SA', 'CC-BY-SA-2.5', 'CC-BY-SA-3.0', - 'CC BY-SA-4.0', + 'CC-BY-SA-4.0', 'CCPL:by', + 'CCPL:by-4.0' 'CCPL:by-sa', 'CCPL:cc-by', 'CCPL:cc-by-sa', @@ -62,8 +73,10 @@ def clean_license_name(license): 'custom:free', 'dumb', 'EDL', + 'EDL-1.0', 'EPL', - 'EPL/1.1', + 'EPL-1.1', + 'EPL-2.0', 'etpan', 'EUPL-1.1', 'EUPL-1.2', @@ -71,20 +84,39 @@ def clean_license_name(license): 'Expat', 'FDL', 'FDL1.2', + 'FDL1.3', 'FFSL', 'FIPL', 'font embedding exception', + 'Free Public License 1.0.0', + 'FSFAP', 'GD', + 'GFDL', + 'GFDL-1.1-no-invariants-or-later', + 'GFDL-1.2-only', + 'GFDL-1.2-no-invariants-only', + 'GFDL-1.3-or-later', 'GFL', 'GPL', + 'GPL-1.0-or-later', 'GPL2+', 'GPL2', 'GPL-2.0+', 'GPL-2.0', + 'GPL-2.0-only', + 'GPL-2.0-or-later', + 'GPL-2.0-or-later with GCC-exception-2.0 exception', + 'GPL2-only', + 'GPL2-or-later', + 'GPL2 or any later version', + 'GPL2 with OpenSSL exception', 'GPL3', 'GPL-3.0', + 'GPL-3.0-only', + 'GPL-3.0-or-later', 'GPL3+GPLv2', 'GPL3-only', + 'GPL3-or-later', 'GPL3 or any later version', 'GPL/BSD', 'GPL+FE', @@ -103,13 +135,25 @@ def clean_license_name(license): 'Khronos', 'LGPL', 'LGPL2', + 'LGPL-2.0-only', + 'LGPL-2.0-or-later', 'LGPL2.1+', 'LGPL2.1', + 'LGPL2_1', + 'LGPL-2.1-only', + 'LGPL-2.1-or-later', + 'LGPL2.1 with linking exception', 'LGPL3', 'LGPLv3+', + 'LGPL-3.0', + 'LGPL-3.0-only', + 'LGPL-3.0-or-later', + 'LGPL-3.0+ with WxWindows-exception-3.1', + 'LGPL-exception', 'libpng', 'libtiff', 'libxcomposite', + 'LLGPL', 'LPPL', 'lsof', 'MirOS', @@ -122,24 +166,29 @@ def clean_license_name(license): 'MPL2', 'MPLv2', 'NCSA', + 'NCSAOSL', 'neovim', 'nfsidmap', 'NoCopyright', + 'NYSL', 'OASIS', 'OFL', 'OFL-1.1', 'OPEN DATA LICENSE', 'OpenLDAP', 'OpenMPI', + 'OpenSSL Linking Exception', 'OSGPL', 'perl', 'PerlArtistic', 'PerlArtistic2', 'PHP', + 'PHP-3.01', 'pil', 'PostgreSQL', 'PSF', - 'Public Domain', + 'Public', + 'public-domain', 'Python', 'Qhull', 'QPL', @@ -148,6 +197,7 @@ def clean_license_name(license): 'Ruby', 'scite', 'scowl', + 'sdbus-c++ LGPL Exception 1.0', 'Sendmail', 'Sendmail open source license', 'SGI', @@ -161,9 +211,13 @@ def clean_license_name(license): 'tcl', 'TekHVC', 'TRADEMARKS', - 'Ubuntu Font Licence 1.0', + 'Tumbolia', + 'UBDL', + 'Ubuntu Font License 1.0', 'UCD', + 'UFL-1.0', 'Unicode-DFS', + 'University of California and Stanford University License', 'University of Illinois/NCSA Open Source License', 'Unlicense', 'usermin', @@ -179,6 +233,7 @@ def clean_license_name(license): 'X11-DEC', 'XFREE86', 'Xiph', + 'Zero-Clause BSD', 'zlib', 'zlib/libpng', 'ZPL', @@ -188,23 +243,23 @@ def clean_license_name(license): # technically not open source but deserve mention # see https://ethicalsource.dev/ ETHICAL_LICENSES = [clean_license_name(license) for license in [ - 'custom:JSON', # "shall be used for Good, not Evil" - 'custom:ACSL', - 'custom:Anti-966', - 'custom:Atmosphere', - 'custom:CNPL', - 'custom:Hippocratic', - 'custom:Hippocratic 2.1', - 'custom:NoHarm', - 'custom:NoHarm-draft', - 'custom:NPL', - 'custom:PPL', + 'JSON', # "shall be used for Good, not Evil" + 'ACSL', + 'Anti-966', + 'Atmosphere', + 'CNPL', + 'Hippocratic', + 'Hippocratic 2.1', + 'NoHarm', + 'NoHarm-draft', + 'NPL', + 'PPL', ]] class LicenseFinder(object): def __init__(self): # number of packages - self.num_pkgs = set() + self.num_pkgs = 0 # all of the seen (clean) license names with counts self.by_license = {} @@ -223,7 +278,7 @@ def __init__(self): def visit_db(self, db): pkgs = db.packages - self.num_pkgs = len(db.packages) + self.num_pkgs += len(db.packages) free_pkgs = [] @@ -295,7 +350,8 @@ def list_all_nonfree_packages(self): self.list_all_ethical_packages(sys.stderr) print("\nThere are %d ambiguously licensed packages that vrms cannot certify." % len(self.unknown_packages), file=sys.stderr) - print("Use --list-unknowns to list them (or --help for more info)") + print("Use --list-unknowns to list them (or --help for more info)", + file=sys.stderr) def list_all_ethical_packages(self, file=sys.stdout): for epackage in sorted(self.ethical_packages, key=lambda pkg: pkg.name):