forked from public/mirror-checker
22 lines
559 B
Python
22 lines
559 B
Python
|
"""
|
||
|
Contains GNU class
|
||
|
"""
|
||
|
|
||
|
from distro import Distro
|
||
|
from shared import CSC_MIRROR, get_sec
|
||
|
|
||
|
class GNU(Distro):
|
||
|
"""GNU class"""
|
||
|
@staticmethod
|
||
|
def name():
|
||
|
"""Get name of GNU"""
|
||
|
return "GNU"
|
||
|
|
||
|
@staticmethod
|
||
|
def check():
|
||
|
"""Check if GNU packages are up-to-date"""
|
||
|
official_sec = get_sec("https://mirrors.kernel.org/gnu/mirror-updated-timestamp.txt")
|
||
|
csc_sec = get_sec(f"{CSC_MIRROR}gnu/mirror-updated-timestamp.txt")
|
||
|
# Out-of-sync by 1 day maximum
|
||
|
return official_sec < csc_sec + 86400
|