Skip to content

Commit

Permalink
compatibility_matrix: Automatically change osx default branch
Browse files Browse the repository at this point in the history
Added code to automatically change osx current default branch.

Signed-off-by: thecoder-001 <[email protected]>
  • Loading branch information
thecoder-001 committed Dec 2, 2023
1 parent 023ba64 commit 84108a7
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions scripts/compatibility_matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,21 @@ def openzfs():


def openzfsonosx():
sources = {'main': 'https://raw.githubusercontent.com/openzfsonosx/'
'openzfs-fork/macOS/man/man7/zpool-features.7'}
with urlopen('https://api.github.com/repos/openzfsonosx/openzfs-fork/branches?per_page=100') as web:
try:
def is_date(date_str):
try:
datetime.strptime(date_str, '%Y%m%d')
return True
except ValueError:
return False
branches = dejson(web.read().decode('utf-8', 'ignore'))
branches = [x['name'].lstrip('macOS_') for x in branches if 'macOS_' in x['name']]
branches = [x for x in branches if is_date(x)]
sources = {'main':('https://raw.githubusercontent.com/openzfsonosx/openzfs-fork/'
'macOS_{}/man/man7/zpool-features.7'.format(max(branches)))}
except Exception:
sources = {}
with urlopen('https://api.github.com/repos/openzfsonosx/openzfs-fork/tags') as web:
try:
tags = dejson(web.read().decode('utf-8', 'ignore'))
Expand Down

0 comments on commit 84108a7

Please sign in to comment.