forked from Mirror/pmbootstrap
parent
6877532f5d
commit
1358424703
1 changed files with 22 additions and 1 deletions
|
@ -1,14 +1,16 @@
|
|||
# Copyright 2020 Oliver Smith
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
import os
|
||||
import logging
|
||||
|
||||
import pmb.config
|
||||
import pmb.config.workdir
|
||||
import pmb.helpers.git
|
||||
|
||||
|
||||
def print_config(args):
|
||||
""" Print an overview of what was set in "pmbootstrap init". """
|
||||
logging.info("*** CONFIG ***")
|
||||
|
||||
info = args.deviceinfo
|
||||
logging.info("Device: {} ({}, \"{}\")"
|
||||
.format(args.device, info["arch"], info["name"]))
|
||||
|
@ -22,6 +24,23 @@ def print_config(args):
|
|||
logging.info("User Interface: {}".format(args.ui))
|
||||
|
||||
|
||||
def print_git_repos(args):
|
||||
logging.info("*** GIT REPOS ***")
|
||||
logging.info("Path: {}/cache_git".format(args.work))
|
||||
for repo in pmb.config.git_repos.keys():
|
||||
path = pmb.helpers.git.get_path(args, repo)
|
||||
if not os.path.exists(path):
|
||||
continue
|
||||
|
||||
# Get branch name (if on branch) or current commit
|
||||
ref = pmb.helpers.git.rev_parse(args, path,
|
||||
extra_args=["--abbrev-ref"])
|
||||
if ref == "HEAD":
|
||||
ref = pmb.helpers.git.rev_parse(args, path)[0:8]
|
||||
|
||||
logging.info("- {} ({})".format(repo, ref))
|
||||
|
||||
|
||||
def print_checks_chroots_outdated(args, details):
|
||||
""" Check if chroots were zapped recently.
|
||||
:param details: if True, print each passing check instead of a summary
|
||||
|
@ -62,6 +81,8 @@ def print_status(args, details=False):
|
|||
:returns: True if all checks passed, False otherwise """
|
||||
print_config(args)
|
||||
logging.info("")
|
||||
print_git_repos(args)
|
||||
logging.info("")
|
||||
ret = print_checks(args, details)
|
||||
|
||||
return ret
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue