Skip to content

Commit

Permalink
Exherbo parser: handle missing homepage and downloads
Browse files Browse the repository at this point in the history
  • Loading branch information
AMDmi3 committed Sep 27, 2023
1 parent 7be7b95 commit ac43e64
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions repology/parsers/parsers/exherbo.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
import re
from typing import Iterable

from repology.package import LinkType
from repology.package import PackageFlags
from repology.logger import Logger
from repology.package import LinkType, PackageFlags
from repology.packagemaker import NameType, PackageFactory, PackageMaker
from repology.parsers import Parser
from repology.parsers.json import iter_json_list
Expand All @@ -37,8 +37,16 @@ def iter_parse(self, path: str, factory: PackageFactory) -> Iterable[PackageMake
pkg.add_name(packagedata['category'] + '/' + packagedata['name'], NameType.EXHERBO_FULL_NAME)
pkg.set_version(packagedata['version'], _normalize_version)
pkg.add_categories(packagedata['category'])
pkg.add_homepages(packagedata['homepage'].split())
pkg.add_downloads(packagedata['downloads'].split())

if homepage := packagedata.get('homepage'):
pkg.add_links(LinkType.UPSTREAM_HOMEPAGE, homepage.split())
elif packagedata['category'] != 'virtual':
pkg.log('homepage missing', Logger.ERROR)

if downloads := packagedata.get('downloads'):
# mostly expected, e.g. for scm packages
pkg.add_links(LinkType.UPSTREAM_DOWNLOAD, downloads.split())

pkg.set_subrepo(packagedata['repository'])
pkg.set_summary(packagedata['summary'])
pkg.add_links(LinkType.PACKAGE_RECIPE, packagedata['exheres_url'])
Expand Down

0 comments on commit ac43e64

Please sign in to comment.