haiku / haikudepotserver

Haiku Depot Server
Other
17 stars 10 forks source link

Prefer haikuports version when opening short links #223

Closed diversys closed 1 year ago

diversys commented 3 years ago

https://depot.haiku-os.org/minimizeall opens minimizeall version from clasqm repo instead of haikuports. I would also expect to see comments from both haikuports and clasqm repos on the same page.

https://depot.haiku-os.org/#!/pkg/minimizeall?bcguid=bc138-IOEO

image

andponlin commented 1 year ago

This specific no longer seems to be a problem, but I can see a number of other packages where it may occur;

SELECT DISTINCT p1.name, r1.code
FROM haikudepot.pkg p1
         JOIN haikudepot.pkg_version pv1 ON pv1.pkg_id = p1.id
         JOIN haikudepot.repository_source rs1 ON rs1.id = pv1.repository_source_id
         JOIN haikudepot.repository r1 ON r1.id = rs1.repository_id
WHERE p1.active = true
  AND r1.active = true
  AND EXISTS (SELECT p2.name
              FROM haikudepot.pkg p2
                       JOIN haikudepot.pkg_version pv2 ON pv2.pkg_id = p2.id
                       JOIN haikudepot.repository_source rs2 ON rs2.id = pv2.repository_source_id
                       JOIN haikudepot.repository r2 ON r2.id = rs2.repository_id
              WHERE p2.id = p1.id
                AND r2.active = true
                AND r2.id <> r1.id)
ORDER BY p1.name;

At the time of writing it seems to impact the following with alex4 shown to exhibit the problem;