mirror of
https://gitlab.postmarketos.org/postmarketOS/pmbootstrap.git
synced 2025-07-13 11:29:46 +03:00
Hello, there!
This commit is contained in:
parent
bfde354b22
commit
ae950fb9f7
64 changed files with 3923 additions and 0 deletions
35
pmb/helpers/git.py
Normal file
35
pmb/helpers/git.py
Normal file
|
@ -0,0 +1,35 @@
|
|||
"""
|
||||
Copyright 2017 Oliver Smith
|
||||
|
||||
This file is part of pmbootstrap.
|
||||
|
||||
pmbootstrap is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
pmbootstrap is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with pmbootstrap. If not, see <http://www.gnu.org/licenses/>.
|
||||
"""
|
||||
import logging
|
||||
import os
|
||||
|
||||
import pmb.build
|
||||
import pmb.chroot.apk
|
||||
import pmb.config
|
||||
|
||||
|
||||
def clone(args, repo_name):
|
||||
if repo_name not in pmb.config.git_repos:
|
||||
raise ValueError("No git repository configured for " + repo_name)
|
||||
|
||||
if not os.path.exists(args.work + "/cache_git/" + repo_name):
|
||||
pmb.chroot.apk.install(args, ["git"])
|
||||
logging.info("(native) git clone " + pmb.config.git_repos[repo_name])
|
||||
pmb.chroot.user(args, ["git", "clone", "--depth=1",
|
||||
pmb.config.git_repos[repo_name], repo_name], working_dir="/home/user/git/")
|
Loading…
Add table
Add a link
Reference in a new issue