Updated compatibility_matrix.py for zpool-features.7 (#200)

In OpenZFS 2.1 and newer, zpool-features got refactored and renamed.

Signed-off-by: Rich Ercolani <rincebrain@gmail.com>
This commit is contained in:
Rich Ercolani
2021-09-07 07:36:32 -04:00
committed by GitHub
parent d1a20453b6
commit 0bd6613d45

View File

@@ -28,13 +28,19 @@ else:
def openzfs():
sources = {'master': 'https://raw.githubusercontent.com/openzfs/zfs/'
'master/man/man5/zpool-features.5'}
'master/man/man7/zpool-features.7'}
# TODO(gmelikov): use git tags from OpenZFS repo
with urlopen('https://zfsonlinux.org') as web:
versions = findall(r'download/zfs-([0-9.]+)',
web.read().decode('utf-8', 'ignore'))
versions.append("0.6.5.11")
for ver in set(versions):
ver_split = ver.split(".")
if (int(ver_split[0]) >= 3 or
(int(ver_split[0]) == 2 and int(ver_split[1]) >= 1)):
sources[ver] = ('https://raw.githubusercontent.com/openzfs/zfs/'
'zfs-{}/man/man7/zpool-features.7'.format(ver))
else:
sources[ver] = ('https://raw.githubusercontent.com/openzfs/zfs/'
'zfs-{}/man/man5/zpool-features.5'.format(ver))
return sources
@@ -176,9 +182,19 @@ for name, sub in sources.items():
continue
found[ver] = url
for line in man.split('\n'):
if line.startswith('.feature '):
guid = ":".join(line.split()[1:3])
readonly[guid] = (line.split()[3] == 'yes')
domain, feature = guid.split(':', 1)
features[(feature, domain)].append((name, ver))
else:
if line.startswith('.It '):
line = line[4:]
if line.startswith('GUID'):
# The new-style man page hits the .feature definition here
# and errors out, so let's exclude that
if len(line) < 10:
continue
guid = line.split()[-1]
if guid == 'com.intel:allocation_classes':
# This is wrong in the documentation for Illumos and