[improvement][aur] synchronizing the package databases once a day

This commit is contained in:
Vinícius Moreira
2020-01-30 11:17:55 -03:00
parent 822e11b8d0
commit 9df3effce3
11 changed files with 129 additions and 35 deletions

View File

@@ -2,7 +2,7 @@ import re
from threading import Thread
from typing import List, Set, Tuple
from bauh.commons.system import run_cmd, new_subprocess, new_root_subprocess, SystemProcess
from bauh.commons.system import run_cmd, new_subprocess, new_root_subprocess, SystemProcess, SimpleProcess
from bauh.gems.arch.exceptions import PackageNotFoundException
RE_DEPS = re.compile(r'[\w\-_]+:[\s\w_\-\.]+\s+\[\w+\]')
@@ -354,3 +354,8 @@ def read_dependencies(name: str) -> Set[str]:
depends_on.update([d for d in line.split(' ') if d and d.lower() != 'none'])
return depends_on
def sync_databases(root_password: str, force: bool = False) -> SimpleProcess:
return SimpleProcess(cmd=['pacman', '-Sy{}'.format('y' if force else '')],
root_password=root_password)