Check whether our mirror packages are up to date.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
mirror-checker/projects/gentooportage.py

32 lines
1.0 KiB

"""
Contains GentooPortage class
"""
import os
from project import Project
class GentooPortage(Project):
"""GentooPortage class"""
@staticmethod
def check(data, project):
rsync_command = "rsync -q {}{} {}"
os.system(rsync_command.format(data[project]["csc"],
data[project]["file"],
"csc_manifest"))
os.system(rsync_command.format(data[project]["upstream1"],
data[project]["file"],
"upstream_manifest1"))
os.system(rsync_command.format(data[project]["upstream2"],
data[project]["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)]