[fix][aur] not pre-downloading some source files

This commit is contained in:
Vinícius Moreira
2020-01-14 19:31:24 -03:00
parent f805254a59
commit b83f9d8440
3 changed files with 13 additions and 3 deletions

View File

@@ -9,6 +9,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- AUR:
- not treating **makedepends' as a list during dependency checking ( **anbox-git** installation was crashing )
- not considering the package name itself as *provided** during dependency checking ( **anbox-git** installation was crashing )
- not pre-downloading some source files ( e.g: from **anbox-image** )
## [0.8.1] 2020-01-14
### Features:

View File

@@ -36,7 +36,8 @@ URL_SRC_INFO = 'https://aur.archlinux.org/cgit/aur.git/plain/.SRCINFO?h='
RE_SPLIT_VERSION = re.compile(r'(=|>|<)')
SOURCE_FIELDS = ('source', 'source_x86_64')
RE_PRE_DOWNLOADABLE_FILES = re.compile(r'(https?|ftp)://.+\.\w+[^gpg|git]$')
RE_PRE_DOWNLOAD_WL_PROTOCOLS = re.compile(r'^(.+::)?(https?|ftp)://.+')
RE_PRE_DOWNLOAD_BL_EXT = re.compile(r'.+\.(git|gpg)$')
SEARCH_OPTIMIZED_MAP = {
'google chrome': 'google-chrome',
@@ -424,7 +425,7 @@ class ArchManager(SoftwareManager):
continue
else:
for f in srcinfo[attr]:
if RE_PRE_DOWNLOADABLE_FILES.findall(f):
if RE_PRE_DOWNLOAD_WL_PROTOCOLS.match(f) and not RE_PRE_DOWNLOAD_BL_EXT.match(f):
pre_download_files.append(f)
if pre_download_files:

View File

@@ -1,5 +1,6 @@
import logging
import os
import re
import time
import traceback
@@ -10,6 +11,7 @@ from bauh.commons.html import bold
from bauh.commons.system import run_cmd, new_subprocess, ProcessHandler, SystemProcess, SimpleProcess
from bauh.view.util.translation import I18n
RE_HAS_EXTENSION = re.compile(r'.+\.\w+$')
class AdaptableFileDownloader(FileDownloader):
@@ -90,7 +92,13 @@ class AdaptableFileDownloader(FileDownloader):
downloader = 'wget'
file_size = self.http_client.get_content_length(file_url)
msg = bold('[{}] ').format(downloader) + self.i18n['downloading'] + ' ' + bold(file_url.split('/')[-1]) + (' ( {} )'.format(file_size) if file_size else '')
name = file_url.split('/')[-1]
if output_path and not RE_HAS_EXTENSION.match(name) and RE_HAS_EXTENSION.match(output_path):
name = output_path.split('/')[-1]
msg = bold('[{}] ').format(downloader) + self.i18n['downloading'] + ' ' + bold(name) + (' ( {} )'.format(file_size) if file_size else '')
if watcher:
watcher.change_substatus(msg)