-
Notifications
You must be signed in to change notification settings - Fork 212
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
convert size fields and fix issue for optional_deps without a descrip…
…tion
- Loading branch information
1 parent
6ceaa77
commit 0be6528
Showing
6 changed files
with
21 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -57,8 +57,8 @@ | |
"replaces": [ | ||
string | ||
], | ||
"download_size": string, | ||
"installed_size": string, | ||
"download_size": integer, # in bytes | ||
"installed_size": integer, # in bytes | ||
"packager": string, | ||
"build_date": string, | ||
"validated_by": [ | ||
|
@@ -108,7 +108,7 @@ | |
], | ||
"conflicts_with": [], | ||
"replaces": [], | ||
"installed_size": "1527.00 KiB", | ||
"installed_size": "1563648", | ||
"packager": "Levente Polyak <[email protected]>", | ||
"build_date": "Sat 11 May 2024 06:14:19 AM +08", | ||
"install_date": "Fri 24 May 2024 09:50:31 AM +08", | ||
|
@@ -205,6 +205,8 @@ def _process(proc_data: List[JSONDictType]) -> List[JSONDictType]: | |
|
||
name_description_fields = {'optional_deps'} | ||
|
||
size_fields = {'download_size', 'installed_size'} | ||
|
||
# initial split for field lists | ||
for item in proc_data: | ||
for key, val in item.items(): | ||
|
@@ -225,11 +227,18 @@ def _process(proc_data: List[JSONDictType]) -> List[JSONDictType]: | |
if key in name_description_fields and isinstance(val, list): | ||
new_list = [] | ||
for name_desc in val: | ||
n, d = name_desc.split(': ') | ||
n, *d = name_desc.split(': ') | ||
if d == []: | ||
d = '' | ||
else: | ||
d = d[0] | ||
new_obj = {'name': n, 'description': d} | ||
new_list.append(new_obj) | ||
item[key] = new_list | ||
|
||
if key in size_fields: | ||
item[key] = jc.utils.convert_size_to_int(val) | ||
|
||
return proc_data | ||
|
||
|
||
|
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
[{"repository":"extra","name":"graphicsmagick","version":"1.3.43-1","description":"Image processing system","architecture":"x86_64","url":"http://www.graphicsmagick.org/","licenses":["MIT"],"groups":[],"provides":["Magick.so","libGraphicsMagickWand.so=2-64","libGraphicsMagick.so=3-64","libGraphicsMagick++-Q16.so"],"depends_on":["bzip2","freetype2","lcms2","libltdl","libpng","libsm","libtiff","libwebp","libxext","xz"],"optional_deps":[{"name":"jasper","description":"jp2 module"},{"name":"libwmf","description":"wmf module"},{"name":"libxml2","description":"msl, svg, url modules"},{"name":"ghostscript","description":"pdf, ps modules"},{"name":"libheif","description":"heic module"},{"name":"libjxl","description":"jpeg-xl module"}],"conflicts_with":[],"replaces":[],"download_size":"2.58 MiB","installed_size":"13.97 MiB","packager":"Caleb Maclennan <[email protected]>","build_date":"Sat 23 Mar 2024 09:55:47 PM CET","validated_by":["MD5 Sum","SHA-256 Sum","Signature"]}] | ||
[{"repository":"extra","name":"graphicsmagick","version":"1.3.43-1","description":"Image processing system","architecture":"x86_64","url":"http://www.graphicsmagick.org/","licenses":["MIT"],"groups":[],"provides":["Magick.so","libGraphicsMagickWand.so=2-64","libGraphicsMagick.so=3-64","libGraphicsMagick++-Q16.so"],"depends_on":["bzip2","freetype2","lcms2","libltdl","libpng","libsm","libtiff","libwebp","libxext","xz"],"optional_deps":[{"name":"jasper","description":"jp2 module"},{"name":"libwmf","description":"wmf module"},{"name":"libxml2","description":"msl, svg, url modules"},{"name":"ghostscript","description":"pdf, ps modules"},{"name":"libheif","description":"heic module"},{"name":"libjxl","description":"jpeg-xl module"}],"conflicts_with":[],"replaces":[],"download_size":2705326,"installed_size":14648606,"packager":"Caleb Maclennan <[email protected]>","build_date":"Sat 23 Mar 2024 09:55:47 PM CET","validated_by":["MD5 Sum","SHA-256 Sum","Signature"]}] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters