Initial commit

This commit is contained in:
jld3103 2021-08-04 18:36:37 +02:00
commit f9ba5a3cfd
14 changed files with 889 additions and 0 deletions

26
cache.py Normal file
View file

@ -0,0 +1,26 @@
import shutil
from logger import *
import click
import os
@click.group(name='cache')
def cmd_cache():
pass
@click.command(name='clean')
@verbose_option
def cmd_clean(verbose):
setup_logging(verbose)
for dir in ['/chroot', '/var/cache/pacman/pkg']:
for file in os.listdir(dir):
path = os.path.join(dir, file)
if os.path.isdir(path):
shutil.rmtree(path)
else:
os.unlink(path)
cmd_cache.add_command(cmd_clean)