diff --git a/repology/parsers/parsers/aosc.py b/repology/parsers/parsers/aosc.py index 03f6cd06..fa50e96c 100644 --- a/repology/parsers/parsers/aosc.py +++ b/repology/parsers/parsers/aosc.py @@ -19,7 +19,7 @@ from typing import Iterable from repology.logger import Logger -from repology.package import PackageFlags +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 @@ -31,6 +31,12 @@ def iter_parse(self, path: str, factory: PackageFactory) -> Iterable[PackageMake normalize_version = VersionStripper().strip_left(':') for pkgdata in iter_json_list(path, ('packages', None)): + if pkgdata['category'] == 'meta' and pkgdata['section'] == 'bases': + # skip dummy packages in meta-bases section + continue + if pkgdata['category'] == 'core' and pkgdata['section'] == 'misc': + # skip core-misc, which includes only the aosc-aaa package + continue with factory.begin() as pkg: pkg.add_name(pkgdata['name'], NameType.AOSC_NAME) pkg.add_name(pkgdata['directory'], NameType.AOSC_DIRECTORY) @@ -56,6 +62,12 @@ def iter_parse(self, path: str, factory: PackageFactory) -> Iterable[PackageMake pkg.add_categories(pkgdata['pkg_section'], pkgdata['section']) pkg.set_summary(pkgdata['description']) + srctype = pkgdata['srctype'] + if srctype == 'Git' or srctype == 'Svn' or srctype == 'Bzr': + pkg.add_links(LinkType.UPSTREAM_REPOSITORY, pkgdata['srcurl']) + elif srctype == 'Tarball': + pkg.add_links(LinkType.UPSTREAM_DOWNLOAD, pkgdata['srcurl']) + # just a committer, doesn't seem suitable #pkg.add_maintainers(extract_maintainers(pkgdata['committer'])) diff --git a/repos.d/aosc.yaml b/repos.d/aosc.yaml index 0fffb51e..04fc09c9 100644 --- a/repos.d/aosc.yaml +++ b/repos.d/aosc.yaml @@ -31,4 +31,4 @@ # url: 'https://github.com/AOSC-Dev/{tree}/blob/{branch}/{srcname}/autobuild/build' #- type: PACKAGE_RECIPE_RAW # url: 'https://raw.githubusercontent.com/AOSC-Dev/{tree}/{branch}/{srcname}/autobuild/build' - groups: [ all ] # https://packages.aosc.io returns 500 for more than a month + groups: [ all, production ]