Initial commit
This commit is contained in:
commit
f9ba5a3cfd
14 changed files with 889 additions and 0 deletions
26
cache.py
Normal file
26
cache.py
Normal 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)
|
Loading…
Add table
Add a link
Reference in a new issue