[arch] feature -> AUR: new custom action to quickly reinstall a package

This commit is contained in:
Vinicius Moreira
2021-01-13 15:28:19 -03:00
parent b451d00aaf
commit 5fd161888a
15 changed files with 227 additions and 18 deletions

View File

@@ -22,6 +22,7 @@ class AsyncDiskCacheLoader(Thread, DiskCacheLoader):
self.cache_map = cache_map
self.logger = logger
self.processed = 0
self._working = False
def fill(self, pkg: SoftwarePackage, sync: bool = False):
"""
@@ -31,7 +32,7 @@ class AsyncDiskCacheLoader(Thread, DiskCacheLoader):
:return:
"""
if pkg and pkg.supports_disk_cache():
if sync:
if sync or not self._working:
self._fill_cached_data(pkg)
else:
self.pkgs.append(pkg)
@@ -40,6 +41,7 @@ class AsyncDiskCacheLoader(Thread, DiskCacheLoader):
self._work = False
def run(self):
self._working = True
last = 0
while True:
@@ -53,6 +55,8 @@ class AsyncDiskCacheLoader(Thread, DiskCacheLoader):
elif not self._work:
break
self._working = False
def _fill_cached_data(self, pkg: SoftwarePackage) -> bool:
if os.path.exists(pkg.get_disk_data_path()):
disk_path = pkg.get_disk_data_path()