Added dependencies option für update
This commit is contained in:
13
main.py
13
main.py
@@ -139,6 +139,7 @@ For detailed help on each command, use:
|
||||
update_parser.add_argument("--system", action="store_true", help="Include system update commands")
|
||||
update_parser.add_argument("-q", "--quiet", action="store_true", help="Suppress warnings and info messages")
|
||||
update_parser.add_argument("--no-verification", action="store_true", default=False, help="Disable verification via commit/gpg")
|
||||
update_parser.add_argument("--dependencies", action="store_true", help="Also pull and update dependencies")
|
||||
|
||||
status_parser = subparsers.add_parser("status", help="Show status for repository/repositories or system")
|
||||
add_identifier_arguments(status_parser)
|
||||
@@ -241,7 +242,17 @@ For detailed help on each command, use:
|
||||
elif args.command == "delete":
|
||||
delete_repos(selected,REPOSITORIES_BASE_DIR, ALL_REPOSITORIES, preview=args.preview)
|
||||
elif args.command == "update":
|
||||
update_repos(selected,REPOSITORIES_BASE_DIR, BINARIES_DIRECTORY, ALL_REPOSITORIES, args.no_verification, system_update=args.system, preview=args.preview, quiet=args.quiet)
|
||||
update_repos(
|
||||
selected,
|
||||
REPOSITORIES_BASE_DIR,
|
||||
BINARIES_DIRECTORY,
|
||||
ALL_REPOSITORIES,
|
||||
args.no_verification,
|
||||
system_update=args.system,
|
||||
preview=args.preview,
|
||||
quiet=args.quiet,
|
||||
update_dependencies=args.dependencies
|
||||
)
|
||||
elif args.command == "status":
|
||||
status_repos(selected,REPOSITORIES_BASE_DIR, ALL_REPOSITORIES, args.extra_args, list_only=args.list, system_status=args.system, preview=args.preview)
|
||||
elif args.command == "explore":
|
||||
|
||||
@@ -10,7 +10,7 @@ from pkgmgr.run_command import run_command
|
||||
from pkgmgr.verify import verify_repository
|
||||
from pkgmgr.clone_repos import clone_repos
|
||||
|
||||
def install_repos(selected_repos, repositories_base_dir, bin_dir, all_repos, no_verification, preview=False, quiet=False, clone_mode: str = "ssh"):
|
||||
def install_repos(selected_repos, repositories_base_dir, bin_dir, all_repos, no_verification, preview=False, quiet=False, clone_mode: str = "ssh", update_dependencies: bool = True):
|
||||
"""
|
||||
Install repositories by creating symbolic links, running setup commands, and
|
||||
installing additional packages if a requirements.yml or requirements.txt file is found.
|
||||
@@ -67,6 +67,12 @@ def install_repos(selected_repos, repositories_base_dir, bin_dir, all_repos, no_
|
||||
if "pkgmgr" in requirements:
|
||||
pkgmgr_packages = requirements["pkgmgr"]
|
||||
if pkgmgr_packages:
|
||||
if update_dependencies:
|
||||
cmd_pull = "pkgmgr pull " + " ".join(pkgmgr_packages)
|
||||
try:
|
||||
run_command(cmd_pull, preview=preview)
|
||||
except SystemExit as e:
|
||||
print(f"Warning: 'pkgmgr pull' command failed (exit code {e}). Ignoring error and continuing.")
|
||||
cmd = "pkgmgr install " + " ".join(pkgmgr_packages)
|
||||
run_command(cmd, preview=preview)
|
||||
# Install pip packages if defined.
|
||||
|
||||
@@ -2,15 +2,22 @@ import sys
|
||||
from pkgmgr.pull_with_verification import pull_with_verification
|
||||
from pkgmgr.install_repos import install_repos
|
||||
|
||||
def update_repos(selected_repos, repositories_base_dir, bin_dir, all_repos, no_verification, system_update=False, preview=False, quiet=False):
|
||||
# Use pull_with_verification instead of the old git_default_exec.
|
||||
def update_repos(selected_repos, repositories_base_dir, bin_dir, all_repos, no_verification, system_update=False, preview=False, quiet=False, update_dependencies=False):
|
||||
|
||||
pull_with_verification(selected_repos, repositories_base_dir, all_repos, extra_args=[], no_verification=no_verification, preview=preview)
|
||||
|
||||
# Proceed with the installation process.
|
||||
# Note: In the install process, we remove the --no-verification flag to avoid hash checks.
|
||||
install_repos(selected_repos, repositories_base_dir, bin_dir, all_repos, no_verification=no_verification, preview=preview, quiet=quiet)
|
||||
install_repos(
|
||||
selected_repos,
|
||||
repositories_base_dir,
|
||||
bin_dir,
|
||||
all_repos,
|
||||
no_verification=no_verification,
|
||||
preview=preview,
|
||||
quiet=quiet,
|
||||
update_dependencies=update_dependencies
|
||||
)
|
||||
|
||||
if system_update:
|
||||
from pkgmgr.run_command import run_command
|
||||
run_command("yay -Syu", preview=preview)
|
||||
run_command("sudo pacman -Syyu", preview=preview)
|
||||
run_command("sudo pacman -Syyu", preview=preview)
|
||||
Reference in New Issue
Block a user