diff --git a/bauh/gems/arch/pacman.py b/bauh/gems/arch/pacman.py index f7382f4a..e9a35a0c 100644 --- a/bauh/gems/arch/pacman.py +++ b/bauh/gems/arch/pacman.py @@ -508,7 +508,7 @@ def map_update_sizes(pkgs: List[str]) -> Dict[str, int]: # bytes: output = run_cmd('pacman -Si {}'.format(' '.join(pkgs))) if output: - return {pkgs[idx]: size_to_byte(float(size[0]), size[1]) for idx, size in enumerate(RE_INSTALLED_SIZE.findall(output))} + return {pkgs[idx]: size_to_byte(float(size[0].replace(',', '.')), size[1]) for idx, size in enumerate(RE_INSTALLED_SIZE.findall(output))} return {} @@ -517,7 +517,7 @@ def map_download_sizes(pkgs: List[str]) -> Dict[str, int]: # bytes: output = run_cmd('pacman -Si {}'.format(' '.join(pkgs))) if output: - return {pkgs[idx]: size_to_byte(float(size[0]), size[1]) for idx, size in enumerate(RE_DOWNLOAD_SIZE.findall(output))} + return {pkgs[idx]: size_to_byte(float(size[0].replace(',', '.')), size[1]) for idx, size in enumerate(RE_DOWNLOAD_SIZE.findall(output))} return {} @@ -526,7 +526,7 @@ def get_installed_size(pkgs: List[str]) -> Dict[str, int]: # bytes output = run_cmd('pacman -Qi {}'.format(' '.join(pkgs))) if output: - return {pkgs[idx]: size_to_byte(float(size[0]), size[1]) for idx, size in enumerate(RE_INSTALLED_SIZE.findall(output))} + return {pkgs[idx]: size_to_byte(float(size[0].replace(',', '.')), size[1]) for idx, size in enumerate(RE_INSTALLED_SIZE.findall(output))} return {} @@ -688,11 +688,11 @@ def map_updates_data(pkgs: Iterable[str], files: bool = False) -> dict: latest_field = 'c' elif field == 'Download Size': size = val.split(' ') - data['ds'] = size_to_byte(float(size[0]), size[1]) + data['ds'] = size_to_byte(float(size[0].replace(',', '.')), size[1]) latest_field = 'ds' elif field == 'Installed Size': size = val.split(' ') - data['s'] = size_to_byte(float(size[0]), size[1]) + data['s'] = size_to_byte(float(size[0].replace(',', '.')), size[1]) latest_field = 's' elif latest_name and latest_field == 's': res[latest_name] = data