|
|
|
@ -5,6 +5,7 @@ This mirror status checker determines whether CSC mirror is up-to-date with upst |
|
|
|
|
""" |
|
|
|
|
|
|
|
|
|
import time |
|
|
|
|
import os |
|
|
|
|
import requests |
|
|
|
|
from arch import Arch |
|
|
|
|
from ceph import Ceph |
|
|
|
@ -48,6 +49,27 @@ def checker(directory_URL, file_name): |
|
|
|
|
else: |
|
|
|
|
return('No dates found') |
|
|
|
|
|
|
|
|
|
def gentoo_portage_checker(data_json, distro_name): |
|
|
|
|
"""GentooPortage checker""" |
|
|
|
|
rsync_command = "rsync -q {}{} {}" |
|
|
|
|
os.system(rsync_command.format(data_json[distro_name]["csc"], |
|
|
|
|
data_json[distro_name]["file"], |
|
|
|
|
"csc_manifest")) |
|
|
|
|
os.system(rsync_command.format(data_json[distro_name]["upstream1"], |
|
|
|
|
data_json[distro_name]["file"], |
|
|
|
|
"upstream_manifest1")) |
|
|
|
|
os.system(rsync_command.format(data_json[distro_name]["upstream2"], |
|
|
|
|
data_json[distro_name]["file"], |
|
|
|
|
"upstream_manifest2")) |
|
|
|
|
stream1 = os.popen("diff csc_manifest upstream_manifest1") |
|
|
|
|
output1 = stream1.read() |
|
|
|
|
stream2 = os.popen("diff csc_manifest upstream_manifest2") |
|
|
|
|
output2 = stream2.read() |
|
|
|
|
os.system("rm csc_manifest") |
|
|
|
|
os.system("rm upstream_manifest1") |
|
|
|
|
os.system("rm upstream_manifest2") |
|
|
|
|
return 0 in [len(output1), len(output2)] |
|
|
|
|
|
|
|
|
|
def gnome_checker(data_json, distro_name): |
|
|
|
|
"""GNOME checker""" |
|
|
|
|
csc_url = CSC_MIRROR + data_json[distro_name]["file"] |
|
|
|
@ -98,7 +120,9 @@ if __name__ == "__main__": |
|
|
|
|
print(f"Success: {distro} up-to-date") |
|
|
|
|
break |
|
|
|
|
continue |
|
|
|
|
if distro == "GNOME": |
|
|
|
|
if distro == "GentooPortage": |
|
|
|
|
checker_result = gentoo_portage_checker(data, distro) |
|
|
|
|
elif distro == "GNOME": |
|
|
|
|
gnome_text = requests.get("https://download.gnome.org/core/").text |
|
|
|
|
line_count = len(gnome_text.split('\n')) |
|
|
|
|
# Latest version is currently 41, which has line count of 49 |
|
|
|
|