CI: common.py: add cache (MR 1321)
Don't query the pmaports dir more than once. This cache will also be used to store the upstream branch in the next commit.
This commit is contained in:
parent
b89fc77d7c
commit
4d116177ac
1 changed files with 9 additions and 1 deletions
|
@ -9,8 +9,16 @@ import subprocess
|
|||
import sys
|
||||
|
||||
|
||||
cache = {}
|
||||
|
||||
|
||||
def get_pmaports_dir():
|
||||
return os.path.realpath(os.path.join(os.path.dirname(__file__) + "/.."))
|
||||
global cache
|
||||
if "pmaports_dir" in cache:
|
||||
return cache["pmaports_dir"]
|
||||
ret = os.path.realpath(os.path.join(os.path.dirname(__file__) + "/.."))
|
||||
cache["pmaports_dir"] = ret
|
||||
return ret
|
||||
|
||||
|
||||
def run_git(parameters, check=True, stderr=None):
|
||||
|
|
Loading…
Reference in a new issue