1
0
Fork 1
mirror of https://gitlab.postmarketos.org/postmarketOS/pmbootstrap.git synced 2025-07-12 19:09:56 +03:00
pmbootstrap/pmb/commands/pull.py
Newbyte 5d1a2ebd39
pmb.commands.pull: Remove bool return type from run() (MR 2490)
This is the only command to return a bool from run rather than None, and
this return type doesn't seem to get used anywhere, so let's just remove
it.
2024-12-19 10:09:22 +00:00

37 lines
1.2 KiB
Python

# Copyright 2024 Oliver Smith
# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import annotations
from pmb import commands
import pmb.helpers.git
import pmb.config
import logging
class Pull(commands.Command):
def __init__(self) -> None:
pass
def run(self) -> None:
failed = []
for repo in pmb.config.git_repos.keys():
if pmb.helpers.git.pull(repo) < 0:
failed.append(repo)
if not failed:
return
logging.info("---")
logging.info("WARNING: failed to update: " + ", ".join(failed))
logging.info("")
logging.info("'pmbootstrap pull' will only update the repositories, if:")
logging.info("* they are on an officially supported branch (e.g. master)")
logging.info("* the history is not conflicting (fast-forward is possible)")
logging.info("* the git workdirs are clean")
logging.info("You have changed mentioned repositories, so they don't meet")
logging.info("these conditions anymore.")
logging.info("")
logging.info("Fix and try again:")
for name_repo in failed:
logging.info(f"* {pmb.helpers.git.get_path(name_repo)}")
logging.info("---")