add recursive package search
This commit is contained in:
@@ -28,7 +28,7 @@ logger = logging.getLogger('jpacrepo.uploader')
|
|||||||
package_file_pattern = re.compile('.*\.pkg\.tar\.(xz|zst|gz)$')
|
package_file_pattern = re.compile('.*\.pkg\.tar\.(xz|zst|gz)$')
|
||||||
|
|
||||||
_size_uoms = ('B', 'KiB', 'MiB', 'GiB', 'KiB')
|
_size_uoms = ('B', 'KiB', 'MiB', 'GiB', 'KiB')
|
||||||
|
_supported_compression_formats = ('xz', 'zst', 'gz')
|
||||||
|
|
||||||
def format_filesize(size: int) -> str:
|
def format_filesize(size: int) -> str:
|
||||||
counter = 0
|
counter = 0
|
||||||
@@ -195,8 +195,8 @@ class JpacrepoClient:
|
|||||||
raise RuntimeError(f'Received HTTP error code: {response.code}')
|
raise RuntimeError(f'Received HTTP error code: {response.code}')
|
||||||
|
|
||||||
def packages_to_upload(self) -> tuple[Path, ...]:
|
def packages_to_upload(self) -> tuple[Path, ...]:
|
||||||
package_files: dict[str, Path] = {file.name: file for package_cache in self.config.repo_folders
|
package_files: dict[str, Path] = {file.name: file for ext in _supported_compression_formats for package_cache in self.config.repo_folders
|
||||||
for file in package_cache.iterdir()
|
for file in package_cache.glob(f'**/*.pkg.tar.{ext}')
|
||||||
if file.is_file() and package_file_pattern.match(file.name)}
|
if file.is_file() and package_file_pattern.match(file.name)}
|
||||||
headers = {
|
headers = {
|
||||||
'Accept': 'application/json',
|
'Accept': 'application/json',
|
||||||
|
Reference in New Issue
Block a user