clone_pkbuilds(): add update parameter, don't update during package build
This commit is contained in:
parent
64bcdcfb5f
commit
b623d017be
1 changed files with 9 additions and 8 deletions
17
packages.py
17
packages.py
|
@ -101,7 +101,7 @@ class Package:
|
||||||
return f'package({self.name},{repr(self.names)})'
|
return f'package({self.name},{repr(self.names)})'
|
||||||
|
|
||||||
|
|
||||||
def clone_pkbuilds(pkgbuilds_dir: str, repo_url: str, branch: str, interactive=False):
|
def clone_pkbuilds(pkgbuilds_dir: str, repo_url: str, branch: str, interactive=False, update=True):
|
||||||
git_dir = os.path.join(pkgbuilds_dir, '.git')
|
git_dir = os.path.join(pkgbuilds_dir, '.git')
|
||||||
if not os.path.exists(git_dir):
|
if not os.path.exists(git_dir):
|
||||||
logging.info('Cloning branch {branch} from {repo}')
|
logging.info('Cloning branch {branch} from {repo}')
|
||||||
|
@ -117,19 +117,20 @@ def clone_pkbuilds(pkgbuilds_dir: str, repo_url: str, branch: str, interactive=F
|
||||||
result = git(['switch', branch], dir=pkgbuilds_dir)
|
result = git(['switch', branch], dir=pkgbuilds_dir)
|
||||||
if result.returncode != 0:
|
if result.returncode != 0:
|
||||||
raise Exception('failed switching branches')
|
raise Exception('failed switching branches')
|
||||||
if interactive:
|
if update:
|
||||||
if not click.confirm('Would you like to try updating the PKGBUILDs repo?'):
|
if interactive:
|
||||||
return
|
if not click.confirm('Would you like to try updating the PKGBUILDs repo?'):
|
||||||
result = git(['pull'], pkgbuilds_dir)
|
return
|
||||||
if result.returncode != 0:
|
result = git(['pull'], pkgbuilds_dir)
|
||||||
raise Exception('failed to update pkgbuilds')
|
if result.returncode != 0:
|
||||||
|
raise Exception('failed to update pkgbuilds')
|
||||||
|
|
||||||
|
|
||||||
def init_pkgbuilds(interactive=False):
|
def init_pkgbuilds(interactive=False):
|
||||||
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)
|
clone_pkbuilds(pkgbuilds_dir, repo_url, branch, interactive=interactive, update=False)
|
||||||
|
|
||||||
|
|
||||||
def init_prebuilts(arch: Arch, dir: str = None):
|
def init_prebuilts(arch: Arch, dir: str = None):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue