singing needs to go into to correct path
This commit is contained in:
13
master.py
13
master.py
@@ -27,6 +27,7 @@ regex_pkg_repo = re.compile(r"^(.*)-.*-.*-(?:x86_64|any)\.pkg\.tar\.zst(?:\.sig)
|
|||||||
fp = None
|
fp = None
|
||||||
update_last = time.time()
|
update_last = time.time()
|
||||||
copy_l = Lock()
|
copy_l = Lock()
|
||||||
|
repos = []
|
||||||
|
|
||||||
|
|
||||||
def build(pkgbuild: str, repo: str) -> None:
|
def build(pkgbuild: str, repo: str) -> None:
|
||||||
@@ -110,7 +111,7 @@ def run_worker() -> None:
|
|||||||
|
|
||||||
|
|
||||||
def do_repo_work() -> None:
|
def do_repo_work() -> None:
|
||||||
for repo in config["repos"]:
|
for repo in repos:
|
||||||
args = ["repo-add", "-s", "-v", "-p", "-n",
|
args = ["repo-add", "-s", "-v", "-p", "-n",
|
||||||
os.path.join(config["basedir"]["repo"], repo, "os", config["arch"], repo + ".db.tar.xz"), "*.zst"]
|
os.path.join(config["basedir"]["repo"], repo, "os", config["arch"], repo + ".db.tar.xz"), "*.zst"]
|
||||||
r_res = subprocess.run(args, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
|
r_res = subprocess.run(args, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
|
||||||
@@ -284,12 +285,12 @@ def parse_repo(name, repo) -> LegacyVersion:
|
|||||||
|
|
||||||
|
|
||||||
def sync_marchs_with_config() -> None:
|
def sync_marchs_with_config() -> None:
|
||||||
repos = []
|
existing_repos = []
|
||||||
with os.scandir(config["basedir"]["repo"]) as it:
|
with os.scandir(config["basedir"]["repo"]) as it:
|
||||||
entry: os.DirEntry
|
entry: os.DirEntry
|
||||||
for entry in it:
|
for entry in it:
|
||||||
if not entry.name.startswith('logs') and entry.is_dir():
|
if not entry.name.startswith('logs') and entry.is_dir():
|
||||||
repos.append(entry.name)
|
existing_repos.append(entry.name)
|
||||||
|
|
||||||
repo_quota = []
|
repo_quota = []
|
||||||
|
|
||||||
@@ -297,8 +298,10 @@ def sync_marchs_with_config() -> None:
|
|||||||
repo_quota.append("{}-{}".format(r, a))
|
repo_quota.append("{}-{}".format(r, a))
|
||||||
|
|
||||||
logging.info("Repos: %s", repo_quota)
|
logging.info("Repos: %s", repo_quota)
|
||||||
repos_create = list(set(repo_quota) - set(repos))
|
global repos
|
||||||
repos_delete = list(set(repos) - set(repo_quota))
|
repos = repo_quota
|
||||||
|
repos_create = list(set(repo_quota) - set(existing_repos))
|
||||||
|
repos_delete = list(set(existing_repos) - set(repo_quota))
|
||||||
|
|
||||||
for repo in repos_create:
|
for repo in repos_create:
|
||||||
logging.debug("Create repo %s: %s", repo, os.path.join(config["basedir"]["repo"], repo, "os/x86_64"))
|
logging.debug("Create repo %s: %s", repo, os.path.join(config["basedir"]["repo"], repo, "os/x86_64"))
|
||||||
|
Reference in New Issue
Block a user