include iso-639-2 collective language codes in LANGUAGES

This commit is contained in:
Tom spot Callaway 2021-08-17 17:52:46 -04:00
parent 3f0db8b75d
commit 5a955c2acc
2 changed files with 532 additions and 1 deletions

View File

@ -0,0 +1,526 @@
diff -up rpmlint-2.1.0/rpmlint/__isocodes__.py.spot rpmlint-2.1.0/rpmlint/__isocodes__.py
--- rpmlint-2.1.0/rpmlint/__isocodes__.py.spot 2021-08-17 09:31:56.000000000 -0400
+++ rpmlint-2.1.0/rpmlint/__isocodes__.py 2021-08-17 17:19:43.068675456 -0400
@@ -111,6 +111,7 @@ LANGUAGES = set(
'aey',
'aez',
'af',
+ 'afa',
'afb',
'afd',
'afe',
@@ -226,6 +227,7 @@ LANGUAGES = set(
'ald',
'ale',
'alf',
+ 'alg',
'alh',
'ali',
'alj',
@@ -316,6 +318,7 @@ LANGUAGES = set(
'aou',
'aox',
'aoz',
+ 'apa',
'apb',
'apc',
'apd',
@@ -366,6 +369,7 @@ LANGUAGES = set(
'arq',
'arr',
'ars',
+ 'art',
'aru',
'arv',
'arw',
@@ -404,6 +408,7 @@ LANGUAGES = set(
'atd',
'ate',
'atg',
+ 'ath',
'ati',
'atj',
'atk',
@@ -438,6 +443,7 @@ LANGUAGES = set(
'aup',
'auq',
'aur',
+ 'aus',
'aut',
'auu',
'auw',
@@ -519,10 +525,12 @@ LANGUAGES = set(
'baa',
'bab',
'bac',
+ 'bad',
'bae',
'baf',
'bag',
'bah',
+ 'bai',
'baj',
'bal',
'ban',
@@ -530,6 +538,7 @@ LANGUAGES = set(
'bap',
'bar',
'bas',
+ 'bat',
'bau',
'bav',
'baw',
@@ -628,6 +637,7 @@ LANGUAGES = set(
'beo',
'bep',
'beq',
+ 'ber',
'bes',
'bet',
'beu',
@@ -686,6 +696,7 @@ LANGUAGES = set(
'bgx',
'bgy',
'bgz',
+ 'bh',
'bha',
'bhb',
'bhc',
@@ -853,6 +864,7 @@ LANGUAGES = set(
'bnq',
'bnr',
'bns',
+ 'bnt',
'bnu',
'bnv',
'bnw',
@@ -991,6 +1003,7 @@ LANGUAGES = set(
'bth',
'bti',
'btj',
+ 'btk',
'btm',
'btn',
'bto',
@@ -1161,6 +1174,7 @@ LANGUAGES = set(
'caf',
'cag',
'cah',
+ 'cai',
'caj',
'cak',
'cal',
@@ -1171,6 +1185,7 @@ LANGUAGES = set(
'caq',
'car',
'cas',
+ 'cau',
'cav',
'caw',
'cax',
@@ -1225,6 +1240,7 @@ LANGUAGES = set(
'ceb',
'ceg',
'cek',
+ 'cel',
'cen',
'cet',
'cfa',
@@ -1311,6 +1327,7 @@ LANGUAGES = set(
'clw',
'cly',
'cma',
+ 'cmc',
'cme',
'cmg',
'cmi',
@@ -1361,10 +1378,13 @@ LANGUAGES = set(
'cpa',
'cpb',
'cpc',
+ 'cpe',
+ 'cpf',
'cpg',
'cpi',
'cpn',
'cpo',
+ 'cpp',
'cps',
'cpu',
'cpx',
@@ -1385,6 +1405,7 @@ LANGUAGES = set(
'crm',
'crn',
'cro',
+ 'crp',
'crq',
'crr',
'crs',
@@ -1447,6 +1468,7 @@ LANGUAGES = set(
'cup',
'cuq',
'cur',
+ 'cus',
'cut',
'cuu',
'cuv',
@@ -1490,6 +1512,7 @@ LANGUAGES = set(
'dav',
'daw',
'dax',
+ 'day',
'daz',
'dba',
'dbb',
@@ -1675,6 +1698,7 @@ LANGUAGES = set(
'doy',
'doz',
'dpp',
+ 'dra',
'drb',
'drc',
'drd',
@@ -1919,6 +1943,7 @@ LANGUAGES = set(
'fip',
'fir',
'fit',
+ 'fiu',
'fiw',
'fj',
'fkk',
@@ -2068,6 +2093,7 @@ LANGUAGES = set(
'gej',
'gek',
'gel',
+ 'gem',
'geq',
'ges',
'gev',
@@ -2367,6 +2393,7 @@ LANGUAGES = set(
'hij',
'hik',
'hil',
+ 'him',
'hio',
'hir',
'hit',
@@ -2558,6 +2585,7 @@ LANGUAGES = set(
'ije',
'ijj',
'ijn',
+ 'ijo',
'ijs',
'ik',
'ike',
@@ -2593,6 +2621,8 @@ LANGUAGES = set(
'ims',
'imy',
'inb',
+ 'inc',
+ 'ine',
'ing',
'inh',
'inj',
@@ -2612,11 +2642,13 @@ LANGUAGES = set(
'ipo',
'iqu',
'iqw',
+ 'ira',
'ire',
'irh',
'iri',
'irk',
'irn',
+ 'iro',
'irr',
'iru',
'irx',
@@ -2822,6 +2854,7 @@ LANGUAGES = set(
'kao',
'kap',
'kaq',
+ 'kar',
'kav',
'kaw',
'kax',
@@ -2983,6 +3016,7 @@ LANGUAGES = set(
'khf',
'khg',
'khh',
+ 'khi',
'khj',
'khk',
'khl',
@@ -3242,6 +3276,7 @@ LANGUAGES = set(
'krl',
'krm',
'krn',
+ 'kro',
'krp',
'krr',
'krs',
@@ -3808,6 +3843,7 @@ LANGUAGES = set(
'mak',
'mam',
'man',
+ 'map',
'maq',
'mas',
'mat',
@@ -4050,6 +4086,7 @@ LANGUAGES = set(
'mke',
'mkf',
'mkg',
+ 'mkh',
'mki',
'mkj',
'mkk',
@@ -4131,6 +4168,7 @@ LANGUAGES = set(
'mnl',
'mnm',
'mnn',
+ 'mno',
'mnp',
'mnq',
'mnr',
@@ -4302,6 +4340,7 @@ LANGUAGES = set(
'muk',
'mul',
'mum',
+ 'mun',
'muo',
'mup',
'muq',
@@ -4400,6 +4439,7 @@ LANGUAGES = set(
'myk',
'myl',
'mym',
+ 'myn',
'myo',
'myp',
'myr',
@@ -4442,6 +4482,8 @@ LANGUAGES = set(
'nae',
'naf',
'nag',
+ 'nah',
+ 'nai',
'naj',
'nak',
'nal',
@@ -4608,6 +4650,7 @@ LANGUAGES = set(
'nhz',
'nia',
'nib',
+ 'nic',
'nid',
'nie',
'nif',
@@ -4838,6 +4881,7 @@ LANGUAGES = set(
'nty',
'ntz',
'nua',
+ 'nub',
'nuc',
'nud',
'nue',
@@ -5072,6 +5116,7 @@ LANGUAGES = set(
'otl',
'otm',
'otn',
+ 'oto',
'otq',
'otr',
'ots',
@@ -5094,6 +5139,7 @@ LANGUAGES = set(
'oyy',
'ozm',
'pa',
+ 'paa',
'pab',
'pac',
'pad',
@@ -5194,6 +5240,7 @@ LANGUAGES = set(
'phd',
'phg',
'phh',
+ 'phi',
'phk',
'phl',
'phm',
@@ -5343,6 +5390,7 @@ LANGUAGES = set(
'ppu',
'pqa',
'pqm',
+ 'pra',
'prb',
'prc',
'prd',
@@ -5437,6 +5485,7 @@ LANGUAGES = set(
'pyx',
'pyy',
'pzn',
+ 'qaa-qtz',
'qu',
'qua',
'qub',
@@ -5601,6 +5650,7 @@ LANGUAGES = set(
'rnr',
'rnw',
'ro',
+ 'roa',
'rob',
'roc',
'rod',
@@ -5664,8 +5714,10 @@ LANGUAGES = set(
'sae',
'saf',
'sah',
+ 'sai',
'saj',
'sak',
+ 'sal',
'sam',
'sao',
'saq',
@@ -5756,6 +5808,7 @@ LANGUAGES = set(
'sej',
'sek',
'sel',
+ 'sem',
'sen',
'seo',
'sep',
@@ -5785,6 +5838,7 @@ LANGUAGES = set(
'sgj',
'sgk',
'sgm',
+ 'sgn',
'sgp',
'sgr',
'sgs',
@@ -5833,10 +5887,12 @@ LANGUAGES = set(
'sik',
'sil',
'sim',
+ 'sio',
'sip',
'siq',
'sir',
'sis',
+ 'sit',
'siu',
'siv',
'siw',
@@ -5886,6 +5942,7 @@ LANGUAGES = set(
'sky',
'skz',
'sl',
+ 'sla',
'slc',
'sld',
'sle',
@@ -5915,6 +5972,7 @@ LANGUAGES = set(
'smf',
'smg',
'smh',
+ 'smi',
'smj',
'smk',
'sml',
@@ -5967,6 +6025,7 @@ LANGUAGES = set(
'soj',
'sok',
'sol',
+ 'son',
'soo',
'sop',
'soq',
@@ -6035,6 +6094,7 @@ LANGUAGES = set(
'sry',
'srz',
'ss',
+ 'ssa',
'ssb',
'ssc',
'ssd',
@@ -6179,6 +6239,7 @@ LANGUAGES = set(
'tae',
'taf',
'tag',
+ 'tai',
'taj',
'tak',
'tal',
@@ -6607,8 +6668,10 @@ LANGUAGES = set(
'tum',
'tun',
'tuo',
+ 'tup',
'tuq',
'tus',
+ 'tut',
'tuu',
'tuv',
'tux',
@@ -6919,6 +6982,7 @@ LANGUAGES = set(
'wah',
'wai',
'waj',
+ 'wak',
'wal',
'wam',
'wan',
@@ -6965,6 +7029,7 @@ LANGUAGES = set(
'weh',
'wei',
'wem',
+ 'wen',
'weo',
'wep',
'wer',
@@ -7594,6 +7659,7 @@ LANGUAGES = set(
'ypb',
'ypg',
'yph',
+ 'ypk',
'ypm',
'ypn',
'ypo',
@@ -7772,6 +7838,7 @@ LANGUAGES = set(
'zmy',
'zmz',
'zna',
+ 'znd',
'zne',
'zng',
'znk',
diff -up rpmlint-2.1.0/tools/generate-isocodes.py.spot rpmlint-2.1.0/tools/generate-isocodes.py
--- rpmlint-2.1.0/tools/generate-isocodes.py.spot 2021-08-17 17:06:21.635053616 -0400
+++ rpmlint-2.1.0/tools/generate-isocodes.py 2021-08-17 17:16:44.650646524 -0400
@@ -11,8 +11,9 @@ import sys
from urllib.request import urlopen
-iso_3166_1_url = os.environ.get('ISO_3166_1_URL', 'https://salsa.debian.org/iso-codes-team/iso-codes/raw/master/data/iso_3166-1.json')
-iso_639_3_url = os.environ.get('ISO_639_3_URL', 'https://salsa.debian.org/iso-codes-team/iso-codes/raw/master/data/iso_639-3.json')
+iso_3166_1_url = os.environ.get('ISO_3166_1_URL', 'https://salsa.debian.org/iso-codes-team/iso-codes/raw/main/data/iso_3166-1.json')
+iso_639_3_url = os.environ.get('ISO_639_3_URL', 'https://salsa.debian.org/iso-codes-team/iso-codes/raw/main/data/iso_639-3.json')
+iso_639_2_url = os.environ.get('ISO_639_2_URL', 'https://salsa.debian.org/iso-codes-team/iso-codes/raw/main/data/iso_639-2.json')
langs = set()
countries = set()
@@ -28,6 +29,13 @@ with urlopen(iso_639_3_url) as f:
data = json.load(codecs.getreader('utf-8')(f))
for entry in data['639-3']:
langs.add(entry.get('alpha_2') or entry['alpha_3'])
+# Need to check iso-639-2 for collective language codes not in iso-639-3
+with urlopen(iso_639_2_url) as f:
+ data = json.load(codecs.getreader('utf-8')(f))
+ for entry in data['639-2']:
+ entry_code = entry.get('alpha_2') or entry['alpha_3']
+ if entry_code not in langs:
+ langs.add(entry_code)
# Note that we are not pprint()ing the set directly because with
# Python 3 it results in curly brace set initializers that are not

View File

@ -2,7 +2,7 @@
Name: rpmlint
Version: 2.1.0
Release: 1%{?dist}
Release: 2%{?dist}
Summary: Tool for checking common errors in RPM packages
License: GPLv2
URL: https://github.com/rpm-software-management/rpmlint
@ -13,6 +13,7 @@ Source2: licenses.toml
Source3: scoring.toml
Source4: users-groups.toml
Source5: warn-on-functions.toml
Patch0: rpmlint-2.1.0-include-iso-639-2-collective-language-codes.patch
BuildArch: noarch
BuildRequires: python3-devel
BuildRequires: %{py3_dist setuptools}
@ -39,6 +40,7 @@ and source packages as well as spec files can be checked.
%prep
%setup -q -n %{name}-%{version}
%patch0 -p1 -b .iso-639-2
# Don't lint the code or measure coverage in %%check
sed -i -e 's/ --cov=rpmlint//' -e 's/ --flake8//' setup.cfg
@ -66,6 +68,9 @@ cp -a %{SOURCE1} %{SOURCE2} %{SOURCE3} %{SOURCE4} %{SOURCE5} %{buildroot}%{_sysc
%{python3_sitelib}/rpmlint*
%changelog
* Tue Aug 17 2021 Tom Callaway <spot@fedoraproject.org> - 2.1.0-2
- include iso-639-2 collective language codes in LANGUAGES
* Tue Aug 17 2021 Tom Callaway <spot@fedoraproject.org> - 2.1.0-1
- update to 2.1.0