From def1fa5301790963e7e7ae214a2df1c692f97005 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Thu, 12 Jan 2023 22:27:04 +0000 Subject: bugfix : https://bugs.redcorelinux.org/show_bug.cgi?id=132 && add manual cache cleaning option --- src/frontend/cli/README.md | 16 ++++++++++++++++ src/frontend/cli/sisyphus-cli.py | 8 ++++++++ 2 files changed, 24 insertions(+) (limited to 'src/frontend/cli') diff --git a/src/frontend/cli/README.md b/src/frontend/cli/README.md index c831afc..edaf9cd 100644 --- a/src/frontend/cli/README.md +++ b/src/frontend/cli/README.md @@ -21,6 +21,7 @@ $ sisyphus [OPTIONS] COMMAND [ARGS]... **Commands**: * `autoremove`: Uninstall packages that are no longer needed. +* `autoclean` : Clean the binary package cache... * `branch`: Pull the selected branch of the Portage tree,... * `install`: Install binary and/or ebuild(source)... * `mirror`: List/Set the active binhost (binary repository) mirror. @@ -49,6 +50,21 @@ $ sisyphus autoremove [OPTIONS] * `--help`: Show this message and exit. + +## `sisyphus autoclean` + +Clean the binary package cache and the source tarball cache + +**Usage**: + +```console +$ sisyphus autoclean [OPTIONS] +``` + +**Options**: + +* `--help`: Show this message and exit. + ## `sisyphus branch` Pull the selected branch of the Portage tree, Redcore overlay and Portage configs. diff --git a/src/frontend/cli/sisyphus-cli.py b/src/frontend/cli/sisyphus-cli.py index 93963dd..ff918b8 100755 --- a/src/frontend/cli/sisyphus-cli.py +++ b/src/frontend/cli/sisyphus-cli.py @@ -174,6 +174,14 @@ def autoremove(): """ sisyphus.autoremove.start() +@app.command("autoclean") +def autoclean(): + """Clean the binary package cache and the source tarball cache""" + if sisyphus.checkenv.root(): + sisyphus.purgeenv.cache() + else: + sys.exit("\nYou need root permissions to do this, exiting!\n") + @app.command("update") def update(): """Update the Portage tree, the Redcore Overlay(s), Portage configs and Sisyphus's package database.""" -- cgit v1.2.3