-
Notifications
You must be signed in to change notification settings - Fork 198
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unique filenames for $revision.cabal
.
#1261
Comments
I think that something like that should be basically enough diff --git a/datafiles/templates/Html/revisions.html.st b/datafiles/templates/Html/revisions.html.st
index 69cf2b75..f499d0ea 100644
--- a/datafiles/templates/Html/revisions.html.st
+++ b/datafiles/templates/Html/revisions.html.st
@@ -25,7 +25,7 @@ stored separately.
</tr>
$revisions:{revision|
<tr>
- <td valign="top"><a href="/package/$pkgid$/revision/$revision.number$.cabal">-r$revision.number$</a></td>
+ <td valign="top"><a href="/package/$pkgid$/revision/$revision.number$.cabal">-r$revision.number$</a>(<a href="/package/$pkgid$/revision/$pkgid$-$revision.number$.cabal">$pkgid$-r$revision.number$</a>)</td>
<td valign="top">$revision.htmltime$</td>
<td valign="top"><a href="/user/$revision.user$">$revision.user$</td>
<td valign="top">$revision.sha256$</th>
diff --git a/src/Distribution/Server/Features/Core.hs b/src/Distribution/Server/Features/Core.hs
index 6aec793a..2247e771 100644
--- a/src/Distribution/Server/Features/Core.hs
+++ b/src/Distribution/Server/Features/Core.hs
@@ -225,6 +225,7 @@ data CoreResource = CoreResource {
corePackageTarball :: Resource,
-- | A Cabal file metatada revision.
coreCabalFileRev :: Resource,
+ coreCabalFileRevName :: Resource,
-- Rendering resources.
-- | URI for `corePackagesPage`, given a format (blank for none).
@@ -403,6 +404,7 @@ coreFeature ServerEnv{serverBlobStore = store} UserFeature{..}
, coreCabalFile
, coreCabalFileRevs
, coreCabalFileRev
+ , coreCabalFileRevName
, coreUserDeauth
, coreAdminDeauth
, corePackUserDeauth
@@ -456,6 +458,11 @@ coreFeature ServerEnv{serverBlobStore = store} UserFeature{..}
resourceDesc = [(GET, "Get package .cabal file revision")]
, resourceGet = [("cabal", serveCabalFileRevision)]
}
+ coreCabalFileRevName = (resourceAt "/package/:package/revision/:package-:revision.:format") {
+ resourceDesc = [(GET, "Get package .cabal file revision with name")]
+ , resourceGet = [("cabal", serveCabalFileRevision)]
+ }
+
coreUserDeauth = (resourceAt "/packages/deauth") {
resourceDesc = [(GET, "Deauth Package user")] but I am not sure, I have never seen haskell before. |
@lockywolf Just out of curiosity, would you mind describing what leads you to download many cabal files for different packages by their revision number? Thanks |
Yes. I am following the Cabal Manual section 3.1.3.2 https://cabal.readthedocs.io/en/3.6/installing-packages.html#local-no-index-repositories My goal is to create a fully offline "vendored" build of a Haskell binary executable. I am doing "cabal fetch", as well as download the fixed-revision cabal files (so that they can be verified against an md5sum) into a "downloads" directory. With this issue resolved, I can just feed the list of downloads into any download tool, like wget, and get a redistributable directory. Then, on a disconnected machine, I am doing a local "noindex" repo, and run cabal install. The "noindex" repo requires the cabal files to be named as The script can be found here: The tentative pull-request which resolves this issue can be found here: |
I also find |
@lockywolf in that case you only need one cabal file per package right? Wouldn't be enough to grab that latest one from In both cases you would still have to rename the file (a local repository expects |
No, because with each update the md5 changes. |
Thank you, I do understand the use-case better now but AFAIU you would still need to rename the file. FWIW I put together a script for your use case (adapted from something similar I already had). https://gist.github.com/andreabedini/79f20cf37a19fb78bbab8d0071999b23 |
Dear Haskell developers,
At the moment, versioned
.cabal
files are shipped under the name of$revision.cabal
, e.g.,1.cabal
. This makes it impossible to download many cabal files into a directory, because of the name clash.Please, consider adding an url for the file with the name
package-$revision.cabal
.Example:
In addition to having
https://hackage.haskell.org/package/network-uri-2.6.4.2/revision/1.cabal
, also addhttps://hackage.haskell.org/package/network-uri-2.6.4.2/revision/network-uri-2.6.4.2-1.cabal
.The text was updated successfully, but these errors were encountered: