From dce388a62ead6e6cf07c85f55d32e8765c47cc24 Mon Sep 17 00:00:00 2001 From: George Melikov Date: Wed, 7 Oct 2020 22:21:57 +0300 Subject: [PATCH] compatibility_matrix.py: make it work with OpenZFS - Use OpenZFS project instead of ZoL - Remove parsing from FreeBSD master, it's OpenZFS now - Update footer Signed-off-by: George Melikov --- scripts/compatibility_matrix.py | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/scripts/compatibility_matrix.py b/scripts/compatibility_matrix.py index 2592fdd..6c8fc43 100755 --- a/scripts/compatibility_matrix.py +++ b/scripts/compatibility_matrix.py @@ -40,9 +40,10 @@ else: path = sys.argv[1] -def zfsonlinux(): +def openzfs(): sources = {'master': 'https://raw.githubusercontent.com/openzfs/zfs/' 'master/man/man5/zpool-features.5'} + # 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')) @@ -74,9 +75,9 @@ def openzfsonosx(): return sources -def freebsd(): - sources = {'head': 'https://svnweb.freebsd.org/base/head/cddl/contrib/' - 'opensolaris/cmd/zpool/zpool-features.7?view=co'} +def freebsd_pre_openzfs(): + # TODO(gmelikov): add FreeBSD HEAD (OpenZFS version)? + sources = {} with urlopen('https://www.freebsd.org/releases/') as web: versions = findall(r'/releases/([0-9.]+?)R', web.read().decode('utf-8', 'ignore')) @@ -141,10 +142,10 @@ def netbsd(): sources[ver] = url.format(tag) return sources - +openzfs_key = 'OpenZFS
(Linux, FreeBSD 13+)' sources = { - 'OpenZFS on Linux': zfsonlinux(), - 'FreeBSD': freebsd(), + openzfs_key: openzfs(), + 'FreeBSD pre OpenZFS': freebsd_pre_openzfs(), 'OpenZFS on OS X': openzfsonosx(), 'OmniOS CE': omniosce(), 'Joyent': joyent(), @@ -186,12 +187,15 @@ for name, sub in sources.items(): elif line.startswith('READ\\-ONLY COMPATIBLE'): readonly[guid] = (line.split()[-1] == 'yes') -header = list(sorted(sources.keys())) +os_sources = sources.copy() +os_sources.pop(openzfs_key) +header = list(sorted(os_sources.keys())) +header.insert(0, openzfs_key) header = list(zip(header, (sorted(sources[name], key=lambda x: regex(r'[^0-9]', '', x) or x) for name in header))) -header.append(('Sortix', ('current',))) +# TODO(gmelikov): add Sortix? -html = open(path + '/zfs.html', 'w') +html = open(path + '/zfs_feature_matrix.html', 'w') f_len, d_len = zip(*features.keys()) f_len, d_len = max(map(len, f_len)), max(map(len, d_len)) + 1 @@ -242,6 +246,6 @@ for (feature, domain), names in sorted(features.items()): html.write('\n') now = datetime.now().isoformat() + 'Z' -html.write('

This works by parsing manpages for feature flags, and is entirely dependent on good, accurate documentation.
Last updated on ' + now + ' using zfs.py.

\n') +html.write('

Table generates by parsing manpages for feature flags, and is entirely dependent on good, accurate documentation.
Last updated on ' + now + ' using compatibility_matrix.py.

\n') html.close()