mirror-checker/openbsd.py

22 lines
554 B
Python

"""
Contains OpenBSD class
"""
from distro import Distro
from shared import CSC_MIRROR, get_sec
class OpenBSD(Distro):
"""OpenBSD class"""
@staticmethod
def name():
"""Get name of OpenBSD"""
return "OpenBSD"
@staticmethod
def check():
"""Check if OpenBSD packages are up-to-date"""
official_sec = get_sec("https://ftp.openbsd.org/pub/OpenBSD/timestamp")
csc_sec = get_sec(f"{CSC_MIRROR}OpenBSD/timestamp")
# Out-of-sync by 1 day maximum
return official_sec < csc_sec + 86400