From 23643688f02a166d6c5f2f5bbb41f8eae30d07fe Mon Sep 17 00:00:00 2001 From: Vingian <89702391+Vingian@users.noreply.github.com> Date: Sun, 11 Aug 2024 01:52:54 -0300 Subject: [PATCH] Personal repositories... --- bottles/backend/managers/repository.py | 32 +++++++++++--------------- 1 file changed, 14 insertions(+), 18 deletions(-) diff --git a/bottles/backend/managers/repository.py b/bottles/backend/managers/repository.py index 7a68334188..78da3401f7 100644 --- a/bottles/backend/managers/repository.py +++ b/bottles/backend/managers/repository.py @@ -55,7 +55,7 @@ def __init__(self, get_index=True): self.aborted_connections = 0 SignalManager.connect(Signals.ForceStopNetworking, self.__stop_index) - self.__check_locals() + self.__check_personals() if get_index: self.__get_index() @@ -66,32 +66,28 @@ def get_repo(self, name: str, offline: bool = False): logging.error(f"Repository {name} not found") - def __check_locals(self): - _locals = {} + def __check_personals(self): + _personals = {} - if "LOCAL_COMPONENTS" in os.environ: - _locals["components"] = os.environ["LOCAL_COMPONENTS"] + if "PERSONAL_COMPONENTS" in os.environ: + _personals["components"] = os.environ["PERSONAL_COMPONENTS"] - if "LOCAL_DEPENDENCIES" in os.environ: - _locals["dependencies"] = os.environ["LOCAL_DEPENDENCIES"] + if "PERSONAL_DEPENDENCIES" in os.environ: + _personals["dependencies"] = os.environ["PERSONAL_DEPENDENCIES"] - if "LOCAL_INSTALLERS" in os.environ: - _locals["installers"] = os.environ["LOCAL_INSTALLERS"] + if "PERSONAL_INSTALLERS" in os.environ: + _personals["installers"] = os.environ["PERSONAL_INSTALLERS"] - if not _locals: + if not _personals: return for repo in self.__repositories: - if repo not in _locals: + if repo not in _personals: continue - _path = _locals[repo] - - if os.path.exists(_path): - self.__repositories[repo]["url"] = f"file://{_path}/" - logging.info(f"Using local {repo} repository at {_path}") - else: - logging.error(f"Local {repo} path does not exist: {_path}") + _url = _personals[repo] + self.__repositories[repo]["url"] = _url + logging.info(f"Using personal {repo} repository at {_url}") def __curl_progress(self, _download_t, _download_d, _upload_t, _upload_d): if self.do_get_index: