packages: init_pkgbuilds(): add lazy param and behaviour
This commit is contained in:
parent
69404a4267
commit
e4320578ef
1 changed files with 8 additions and 1 deletions
|
@ -45,11 +45,18 @@ def clone_pkbuilds(pkgbuilds_dir: str, repo_url: str, branch: str, interactive=F
|
||||||
raise Exception('failed to update pkgbuilds')
|
raise Exception('failed to update pkgbuilds')
|
||||||
|
|
||||||
|
|
||||||
def init_pkgbuilds(interactive=False):
|
_pkgbuilds_initialised: bool = False
|
||||||
|
|
||||||
|
|
||||||
|
def init_pkgbuilds(interactive=False, lazy: bool = True):
|
||||||
|
global _pkgbuilds_initialised
|
||||||
|
if lazy and _pkgbuilds_initialised:
|
||||||
|
return
|
||||||
pkgbuilds_dir = config.get_path('pkgbuilds')
|
pkgbuilds_dir = config.get_path('pkgbuilds')
|
||||||
repo_url = config.file.pkgbuilds.git_repo
|
repo_url = config.file.pkgbuilds.git_repo
|
||||||
branch = config.file.pkgbuilds.git_branch
|
branch = config.file.pkgbuilds.git_branch
|
||||||
clone_pkbuilds(pkgbuilds_dir, repo_url, branch, interactive=interactive, update=False)
|
clone_pkbuilds(pkgbuilds_dir, repo_url, branch, interactive=interactive, update=False)
|
||||||
|
_pkgbuilds_initialised = True
|
||||||
|
|
||||||
|
|
||||||
class Pkgbuild(PackageInfo):
|
class Pkgbuild(PackageInfo):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue