To maximise hackage compatibility we should produce the same urls. Here's a list of what Hackage provides (extracted from https://hackage.haskell.org/api).
/package/<pkg-id>/<pkg-id>.tar.gz
This is confusing, and indeed this note on hacakge-security starts with:
The situation with paths in cabal/hackage is a bit of a mess.
Reading that note and comparing with the code, I gather that:
The "official" hackage path is /package/<pkg-id>/<pkg-id>.tar.gz
Hackage provides a redirect from /package/<pkg-id>.tar.gz to /package/<pkg-id>/<pkg-id>.tar.gz
cabal-install still uses /package/<pkg-id>.tar.gz
We have been using package/{pkg-id}.tar.gz and everything has been working fine, I guess we need to keep it like that. Note that a static website cannot serve a redirect (at least not in a general way).
/package/{pkg-id}/{pkg-name}.cabal
This is the most recent cabal file. So far we expose this at index/{pkg-name}/{pkg-version}/{pkg-name}.cabal. Note: When first writing foliage, I used hackage-repo-tool as a blue print. hackage-repo-tool does create the /index paths, although they are not provided by Hackage, likely this is for compatibility with local indicies.
/package/{pkg-id}/revision/{rev-number}.cabal
This is for all revisions. We don't have anything like this at the moment.
To maximise hackage compatibility we should produce the same urls. Here's a list of what Hackage provides (extracted from https://hackage.haskell.org/api).
/package/<pkg-id>/<pkg-id>.tar.gz
This is confusing, and indeed this note on hacakge-security starts with:
Reading that note and comparing with the code, I gather that:
/package/<pkg-id>/<pkg-id>.tar.gz
/package/<pkg-id>.tar.gz
to/package/<pkg-id>/<pkg-id>.tar.gz
/package/<pkg-id>.tar.gz
We have been using
package/{pkg-id}.tar.gz
and everything has been working fine, I guess we need to keep it like that. Note that a static website cannot serve a redirect (at least not in a general way)./package/{pkg-id}/{pkg-name}.cabal
This is the most recent cabal file. So far we expose this at
index/{pkg-name}/{pkg-version}/{pkg-name}.cabal
. Note: When first writing foliage, I used hackage-repo-tool as a blue print. hackage-repo-tool does create the/index
paths, although they are not provided by Hackage, likely this is for compatibility with local indicies./package/{pkg-id}/revision/{rev-number}.cabal
This is for all revisions. We don't have anything like this at the moment.