Skip to content

Commit

Permalink
add upstream download page
Browse files Browse the repository at this point in the history
  • Loading branch information
jopejoe1 committed May 16, 2024
1 parent d23dc2f commit e5a339c
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 2 deletions.
3 changes: 3 additions & 0 deletions repology/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ class LinkType:
PACKAGE_STATISTICS: ClassVar[int] = 25
PACKAGE_BUILD_STATUS: ClassVar[int] = 26
PACKAGE_BUILD_LOGS: ClassVar[int] = 27
UPSTREAM_DOWNLOAD_PAGE: ClassVar[int] = 28
OTHER: ClassVar[int] = 99

@staticmethod
Expand Down Expand Up @@ -197,6 +198,7 @@ def as_string(val: int) -> str:
LinkType.PACKAGE_STATISTICS: 'PACKAGE_STATISTICS',
LinkType.PACKAGE_BUILD_STATUS: 'PACKAGE_BUILD_STATUS',
LinkType.PACKAGE_BUILD_LOGS: 'PACKAGE_BUILD_LOGS',
LinkType.UPSTREAM_DOWNLOAD_PAGE: 'UPSTREAM_DOWNLOAD_PAGE',
LinkType.OTHER: 'OTHER',
}[val]

Expand Down Expand Up @@ -230,6 +232,7 @@ def from_string(val: str) -> int:
'PACKAGE_STATISTICS': LinkType.PACKAGE_STATISTICS,
'PACKAGE_BUILD_STATUS': LinkType.PACKAGE_BUILD_STATUS,
'PACKAGE_BUILD_LOGS': LinkType.PACKAGE_BUILD_LOGS,
'UPSTREAM_DOWNLOAD_PAGE': LinkType.UPSTREAM_DOWNLOAD_PAGE,
'OTHER': LinkType.OTHER,
}[val]

Expand Down
1 change: 1 addition & 0 deletions repology/parsers/parsers/nix.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ def iter_parse(self, path: str, factory: PackageFactory) -> Iterable[PackageMake

pkg.add_links(LinkType.UPSTREAM_HOMEPAGE, meta.get('homepage', None))
pkg.add_links(LinkType.UPSTREAM_CHANGELOG, meta.get('changelog', None))
pkg.add_links(LinkType.UPSTREAM_DOWNLOAD_PAGE, meta.get('downloadPage', None))

for arch, platform in [('x86_64', 'linux'), ('aarch64', 'linux'), ('x86_64', 'darwin'), ('aarch64', 'darwin')]:
if nix_has_logs(meta, f'{arch}-{platform}') and (
Expand Down
2 changes: 1 addition & 1 deletion sql.d/update/update_problems.sql
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ WITH packages_links_expanded AS (
coalesce(ipv6_permanent_redirect_target, ipv4_permanent_redirect_target) as permanent_redirect_target,
link_type
FROM packages_links_maintainers_expanded INNER JOIN links ON(links.id = link_id)
WHERE link_type IN (0, 1) -- UPSTREAM_HOMEPAGE, UPSTREAM_DOWNLOAD
WHERE link_type IN (0, 1, 28) -- UPSTREAM_HOMEPAGE, UPSTREAM_DOWNLOAD, UPSTREAM_DOWNLOAD_PAGE
), homepage_problems AS (
SELECT id, repo, visiblename, effname, maintainer,
'homepage_dead'::problem_type AS problem_type,
Expand Down
3 changes: 2 additions & 1 deletion sql.d/update/update_url_relations_all.sql
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ WITH homepages AS (
4, -- PROJECT_HOMEPAGE
16, -- UPSTREAM_DOCUMENTATION
20, -- UPSTREAM_DISCUSSION
23 -- UPSTREAM_WIKI
23, -- UPSTREAM_WIKI
28 -- UPSTREAM_DOWNLOAD_PAGE
)
GROUP BY effname, urlhash
)
Expand Down

0 comments on commit e5a339c

Please sign in to comment.