-
Notifications
You must be signed in to change notification settings - Fork 27
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
Improve scripts/add-revions.sh #332
base: main
Are you sure you want to change the base?
Conversation
a9bb17b
to
859deb5
Compare
If we need to pass in a different
|
usage | ||
exit 1 | ||
fi | ||
|
||
BUILT_REPO=$(mktemp -d) | ||
mkdir -p $BUILT_REPO/index | ||
curl -L https://input-output-hk.github.io/cardano-haskell-packages/01-index.tar.gz | tar -C $BUILT_REPO/index -xz |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One can do
curl -L https://input-output-hk.github.io/cardano-haskell-packages/01-index.tar.gz | tar xvz cardano-cli/8.0.0/cardano-cli.cabal
``` to get the latest revision for `cardano-cli-8.0.0`.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or even
curl -L https://input-output-hk.github.io/cardano-haskell-packages/package/cardano-cli-8.0.0/cardano-cli.cabal
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this even correct? This downloads only the index. I guess that probably works in this case but I'm not sure. I think it would be safer to get the entire latest repository using one of the methods in https://github.com/input-output-hk/cardano-haskell-packages/pull/323
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This won't work now if you need to add a revision to something that's not in the remote, or if you're doing multiple revisions to something. That's uncommon, but kind of important when you need it. We could wrap this in something that fetches the repository, it would be nice to keep the bare one also. |
The need to pass a `BUILT_REPO` arg is very confusing and it is small enough to just DL the latest to a temp dir. This change also only uses the `BUILT_REPO` if there is no existing revision. If there is a revision it copies the `.cabal` file from there (in case it is not in the BUILT_REPO yet). Also uses `date -u` instead of `date --utc` so that we don't have to install `gdate` on macOS to make it work.
859deb5
to
6483506
Compare
The need to pass a
BUILT_REPO
arg is very confusing and it is small enough to just DL the latest to a temp dir.This change also only uses the
BUILT_REPO
if there is no existing revision. If there is a revision it copies the.cabal
file from there (in case it is not in the BUILT_REPO yet).Also uses
date -u
instead ofdate --utc
so that we don't have to installgdate
on macOS to make it work.