Compare commits
1 Commits
v0.1.5-p1
...
v0.1.5-alp
| Author | SHA1 | Date | |
|---|---|---|---|
| bc0cd22433 |
2
.gitignore
vendored
2
.gitignore
vendored
@@ -1,4 +1,2 @@
|
||||
dist-newstyle/
|
||||
cabal.project.local
|
||||
.stack-work/
|
||||
bin/
|
||||
|
||||
@@ -161,7 +161,7 @@ release:linux:32bit:
|
||||
before_script:
|
||||
- ./.gitlab/before_script/linux/alpine/install_deps.sh
|
||||
variables:
|
||||
ARTIFACT: "i386-linux-ghcup"
|
||||
ARTIFACT: "x86_64-linux-ghcup"
|
||||
GHC_VERSION: "8.8.3"
|
||||
CABAL_VERSION: "3.2.0.0"
|
||||
|
||||
|
||||
@@ -4,8 +4,6 @@ set -eux
|
||||
|
||||
. "$( cd "$(dirname "$0")" ; pwd -P )/../../ghcup_env"
|
||||
|
||||
mkdir -p "${TMPDIR}"
|
||||
|
||||
curl -sSfL https://downloads.haskell.org/~ghcup/x86_64-apple-darwin-ghcup > ./ghcup-bin
|
||||
chmod +x ghcup-bin
|
||||
|
||||
|
||||
@@ -6,8 +6,6 @@ set -eux
|
||||
|
||||
. "$( cd "$(dirname "$0")" ; pwd -P )/../../ghcup_env"
|
||||
|
||||
mkdir -p "${TMPDIR}"
|
||||
|
||||
curl -sSfL https://downloads.haskell.org/~ghcup/x86_64-portbld-freebsd-ghcup > ./ghcup-bin
|
||||
chmod +x ghcup-bin
|
||||
|
||||
|
||||
@@ -4,8 +4,6 @@ set -eux
|
||||
|
||||
. "$( cd "$(dirname "$0")" ; pwd -P )/../../../ghcup_env"
|
||||
|
||||
mkdir -p "${TMPDIR}"
|
||||
|
||||
apk add --no-cache \
|
||||
curl \
|
||||
gcc \
|
||||
@@ -44,8 +42,7 @@ chmod +x "${GHCUP_INSTALL_BASE_PREFIX}/.ghcup/bin/cabal"
|
||||
|
||||
# utils
|
||||
apk add --no-cache \
|
||||
bash \
|
||||
git
|
||||
bash
|
||||
|
||||
## Package specific
|
||||
apk add --no-cache \
|
||||
|
||||
@@ -2,12 +2,10 @@
|
||||
|
||||
set -eux
|
||||
|
||||
. "$( cd "$(dirname "$0")" ; pwd -P )/../../ghcup_env"
|
||||
|
||||
mkdir -p "${TMPDIR}"
|
||||
|
||||
sudo apt-get update -y
|
||||
sudo apt-get install -y libnuma-dev zlib1g-dev libgmp-dev libgmp10 libssl-dev liblzma-dev git wget
|
||||
sudo apt-get install -y libnuma-dev zlib1g-dev libgmp-dev libgmp10 libssl-dev liblzma-dev
|
||||
|
||||
. "$( cd "$(dirname "$0")" ; pwd -P )/../../ghcup_env"
|
||||
|
||||
curl -sSfL https://downloads.haskell.org/~ghcup/x86_64-linux-ghcup > ./ghcup-bin
|
||||
chmod +x ghcup-bin
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
export GHCUP_INSTALL_BASE_PREFIX="$CI_PROJECT_DIR"
|
||||
export PATH="$CI_PROJECT_DIR/.ghcup/bin:$CI_PROJECT_DIR/.local/bin:$PATH"
|
||||
export TMPDIR="$CI_PROJECT_DIR/tmp"
|
||||
|
||||
|
||||
@@ -10,17 +10,13 @@ ecabal() {
|
||||
cabal --store-dir="$(pwd)"/.store "$@"
|
||||
}
|
||||
|
||||
git describe
|
||||
|
||||
# build
|
||||
ecabal update
|
||||
|
||||
if [ "${OS}" = "LINUX" ] ; then
|
||||
ecabal build -w ghc-${GHC_VERSION} --ghc-options='-split-sections -optl-static'
|
||||
elif [ "${OS}" = "FREEBSD" ] ; then
|
||||
ecabal build -w ghc-${GHC_VERSION} --ghc-options='-split-sections'
|
||||
ecabal build -w ghc-${GHC_VERSION} -fcurl --ghc-options='-split-sections -optl-static'
|
||||
else
|
||||
ecabal build -w ghc-${GHC_VERSION}
|
||||
ecabal build -w ghc-${GHC_VERSION} -fcurl
|
||||
fi
|
||||
|
||||
mkdir out
|
||||
|
||||
@@ -14,16 +14,15 @@ eghcup() {
|
||||
ghcup -v -c -s file://$(pwd)/ghcup-${JSON_VERSION}.json "$@"
|
||||
}
|
||||
|
||||
git describe --always
|
||||
|
||||
### build
|
||||
|
||||
ecabal update
|
||||
|
||||
if [ "${OS}" = "DARWIN" ] ; then
|
||||
ecabal build -w ghc-${GHC_VERSION}
|
||||
ecabal build -w ghc-${GHC_VERSION} -fcurl
|
||||
else
|
||||
ecabal build -w ghc-${GHC_VERSION} -finternal-downloader
|
||||
ecabal build -w ghc-${GHC_VERSION}
|
||||
fi
|
||||
|
||||
cp "$(ecabal new-exec --enable-tests --verbose=0 --offline sh -- -c 'command -v ghcup')" .
|
||||
@@ -71,11 +70,7 @@ ghci-$(ghc --numeric-version) --version
|
||||
|
||||
# test installing new ghc doesn't mess with currently set GHC
|
||||
# https://gitlab.haskell.org/haskell/ghcup-hs/issues/7
|
||||
if [ "${OS}" = "LINUX" ] ; then
|
||||
eghcup --downloader=wget install 8.4.4
|
||||
else # test wget a bit
|
||||
eghcup install 8.4.4
|
||||
fi
|
||||
eghcup install 8.4.4
|
||||
[ "$(ghc --numeric-version)" = "${ghc_ver}" ]
|
||||
eghcup set 8.4.4
|
||||
eghcup set 8.4.4
|
||||
|
||||
@@ -18,5 +18,5 @@ ghcup set 8.8.3
|
||||
## install ghcup
|
||||
|
||||
cabal update
|
||||
cabal build
|
||||
cabal build -fcurl
|
||||
cp "$(cabal new-exec --verbose=0 --offline sh -- -c 'command -v ghcup')" "./${ARTIFACT}"
|
||||
|
||||
16
CHANGELOG.md
16
CHANGELOG.md
@@ -1,21 +1,5 @@
|
||||
# Revision history for ghcup
|
||||
|
||||
## 0.1.5 -- 2020-04-30
|
||||
|
||||
* Fix errors when PATH variable contains path components that are actually files
|
||||
* Add `--version` and `--numeric-version` options
|
||||
* Add `changelog` command
|
||||
* Also check for available GHC and Cabal updates on start
|
||||
* Add base versions as tags for every GHC version (these are "installable" tags and the latest GHC version matching the tag will be picked)
|
||||
* Added `--format-raw` to list subcommand
|
||||
* Allow to install X.Y versions (e.g.: ghcup install 8.8)
|
||||
* Implement `--keep=<always|errors|never>` to control temporary build directories cleanup
|
||||
* Add proper shell completions to the repo
|
||||
* Fix building of documentation
|
||||
* Allow to work in offline mode and use cached files if possible
|
||||
* Allow to set the downloader via `--downloader=<curl|wget>`
|
||||
* Support for compiling and installing a cross GHC (see README). This is experimental.
|
||||
|
||||
## 0.1.4 -- 2020-04-16
|
||||
|
||||
* build on all platforms with curl (as a binary), wrt https://gitlab.haskell.org/haskell/ghcup-hs/issues/6
|
||||
|
||||
42
Dockerfile
Normal file
42
Dockerfile
Normal file
@@ -0,0 +1,42 @@
|
||||
FROM alpine:edge
|
||||
|
||||
# ghc and cabal
|
||||
RUN apk add --no-cache \
|
||||
curl \
|
||||
gcc \
|
||||
g++ \
|
||||
gmp-dev \
|
||||
ncurses-dev \
|
||||
libffi-dev \
|
||||
make \
|
||||
xz \
|
||||
tar \
|
||||
perl \
|
||||
\
|
||||
cabal \
|
||||
ghc
|
||||
|
||||
# utils
|
||||
RUN apk add --no-cache \
|
||||
bash
|
||||
|
||||
## Package specific
|
||||
RUN apk add --no-cache \
|
||||
zlib \
|
||||
zlib-dev \
|
||||
zlib-static \
|
||||
gmp \
|
||||
gmp-dev \
|
||||
openssl-dev \
|
||||
openssl-libs-static \
|
||||
xz \
|
||||
xz-dev
|
||||
|
||||
RUN cabal v2-update
|
||||
|
||||
COPY . /app
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
RUN chmod +x /app/docker/build.sh
|
||||
|
||||
19
HACKING.md
19
HACKING.md
@@ -43,22 +43,3 @@ Kazu Yamamoto [explained it in his PR](https://github.com/yesodweb/wai/pull/752#
|
||||
1. Brittany
|
||||
2. mtl-style preferred
|
||||
3. no overly pointfree style
|
||||
|
||||
## Code structure
|
||||
|
||||
Main functionality is in `GHCup` module. Utility functions are
|
||||
organised tree-ish in `GHCup.Utils` and `GHCup.Utils.*`.
|
||||
|
||||
Anything dealing with ghcup specific directories is in
|
||||
`GHCup.Utils.Dirs`.
|
||||
|
||||
Download information on where to fetch bindists from is in
|
||||
`GHCup.Data.GHCupDownloads`.
|
||||
|
||||
## Major refactors
|
||||
|
||||
1. First major refactor included adding cross support. This added
|
||||
`GHCTargetVersion`, which includes the target in addition to the version.
|
||||
Most of the `Version` parameters to functions had to be replaced with
|
||||
that and ensured the logic is consistent for cross and non-cross
|
||||
installs.
|
||||
|
||||
24
README.md
24
README.md
@@ -11,8 +11,6 @@ Similar in scope to [rustup](https://github.com/rust-lang-nursery/rustup.rs), [p
|
||||
* [Installation](#installation)
|
||||
* [Usage](#usage)
|
||||
* [Manpages](#manpages)
|
||||
* [Shell-completion](#shell-completion)
|
||||
* [Cross support](#cross-support)
|
||||
* [Design goals](#design-goals)
|
||||
* [How](#how)
|
||||
* [Known users](#known-users)
|
||||
@@ -70,25 +68,11 @@ handles your haskell packages and can demand that [a specific version](https://c
|
||||
For man pages to work you need [man-db](http://man-db.nongnu.org/) as your `man` provider, then issue `man ghc`. Manpages only work for the currently set ghc.
|
||||
`MANPATH` may be required to be unset.
|
||||
|
||||
### Shell-completion
|
||||
### Bash-completion
|
||||
|
||||
Shell completions are in `shell-completions`.
|
||||
|
||||
For bash: install `shell-completions/bash`
|
||||
as e.g. `/etc/bash_completion.d/ghcup` (depending on distro)
|
||||
and make sure your bashrc sources the startup script
|
||||
(`/usr/share/bash-completion/bash_completion` on some distros).
|
||||
|
||||
### Cross support
|
||||
|
||||
ghcup can compile and install a cross GHC for any target. However, this
|
||||
requires that the build host has a complete cross toolchain and various
|
||||
libraries installed for the target platform.
|
||||
|
||||
Consult the GHC documentation on the [prerequisites](https://gitlab.haskell.org/ghc/ghc/-/wikis/building/cross-compiling#tools-to-install).
|
||||
For distributions with non-standard locations of cross toolchain and
|
||||
libraries, this may need some tweaking of `build.mk` or configure args.
|
||||
See `ghcup compile ghc --help` for further information.
|
||||
Depending on your distro and setup, install `.bash-completion` from this repo
|
||||
as e.g. `/etc/bash_completion.d/ghcup` and make sure your bashrc sources the
|
||||
startup script (`/usr/share/bash-completion/bash_completion` on some distros).
|
||||
|
||||
## Design goals
|
||||
|
||||
|
||||
16
RELEASING.md
16
RELEASING.md
@@ -2,18 +2,10 @@
|
||||
|
||||
1. update `GHCup.Version` module. `ghcupURL` must only be updated if we change the `_toolRequirements` type or the JSON representation of it. The version of the json represents the change increments. `ghcUpVer` is the current application version.
|
||||
|
||||
2. Update version in ghcup.cabal
|
||||
2. Add/fix downloads to `GHCupDownloads` module, then run `ghcup-gen gen` to generate the new json and validate it via `ghcup-gen check`.
|
||||
|
||||
3. Add ChangeLog entry
|
||||
3. Commit and git push with tag. Wait for tests to succeed.
|
||||
|
||||
4. Add/fix downloads to `GHCupDownloads` module, then run `ghcup-gen gen` to generate the new json and validate it via `ghcup-gen check`.
|
||||
4. Upload the new `ghcup-<ver>.json` to `webhost.haskell.org/ghcup/data/`.
|
||||
|
||||
5. Commit and git push with tag. Wait for tests to succeed and release artifacts to build.
|
||||
|
||||
6. Download release artifacts and upload them `downloads.haskell.org/ghcup`
|
||||
|
||||
7. Add release artifacts to GHCupDownloads (see point 4.)
|
||||
|
||||
8. Upload the final `ghcup-<ver>.json` to `webhost.haskell.org/ghcup/data/`.
|
||||
|
||||
9. Update bootstrap-haskell and symlinks on `downloads.haskell.org/ghcup`
|
||||
5. Build ghcup releases for Linux (fully static), mac (with `-fcurl`) and FreeBSD (with `-fcurl`). Upload to `webhost.haskell.org/ghcup/bin/` and update symlinks.
|
||||
|
||||
19
TODO.md
19
TODO.md
@@ -2,19 +2,20 @@
|
||||
|
||||
## Now
|
||||
|
||||
* ghcup init?
|
||||
* merge two download files
|
||||
* fetch/unpack functionality
|
||||
* try to run exe before upgrade (backup to ~/.ghcup/bin/ghcup.old)
|
||||
* allow to build 8.8
|
||||
* curl DL does not cache json
|
||||
* explain environment variables
|
||||
* add --keep=<always|error> option
|
||||
|
||||
* allow to switch to curl/wget at runtime
|
||||
|
||||
* cross support
|
||||
* installing multiple versions of the same
|
||||
* post-install
|
||||
|
||||
* proper test suite
|
||||
* add more logging
|
||||
|
||||
* !! update of 0.1.5 must go in ghcup-0.0.1.json !!
|
||||
|
||||
* try to run exe before upgrade (backup to ~/.ghcup/bin/ghcup.old)
|
||||
* stdout flushing?
|
||||
* resume support (for make-install only)
|
||||
|
||||
## Maybe
|
||||
|
||||
|
||||
@@ -179,7 +179,7 @@ validateTarballs dls = do
|
||||
|
||||
where
|
||||
downloadAll dli = do
|
||||
let settings = Settings True False Never Curl
|
||||
let settings = Settings True False Never
|
||||
let runLogger = myLoggerT LoggerConfig { lcPrintDebug = True
|
||||
, colorOutter = B.hPut stderr
|
||||
, rawOutter = (\_ -> pure ())
|
||||
|
||||
@@ -76,7 +76,6 @@ data Options = Options
|
||||
, optUrlSource :: Maybe URI
|
||||
, optNoVerify :: Bool
|
||||
, optKeepDirs :: KeepDirs
|
||||
, optsDownloader :: Downloader
|
||||
-- commands
|
||||
, optCommand :: Command
|
||||
}
|
||||
@@ -182,25 +181,8 @@ opts =
|
||||
( long "keep"
|
||||
<> metavar "<always|errors|never>"
|
||||
<> help
|
||||
"Keep build directories? (default: never)"
|
||||
"Keep build directories?"
|
||||
<> value Never
|
||||
<> hidden
|
||||
)
|
||||
<*> option
|
||||
(eitherReader downloaderParser)
|
||||
( long "downloader"
|
||||
#if defined(INTERNAL_DOWNLOADER)
|
||||
<> metavar "<internal|curl|wget>"
|
||||
<> help
|
||||
"Downloader to use (default: internal)"
|
||||
<> value Internal
|
||||
#else
|
||||
<> metavar "<curl|wget>"
|
||||
<> help
|
||||
"Downloader to use (default: curl)"
|
||||
<> value Curl
|
||||
#endif
|
||||
<> hidden
|
||||
)
|
||||
<*> com
|
||||
where
|
||||
@@ -576,16 +558,6 @@ keepOnParser s' | t == T.pack "always" = Right Always
|
||||
where t = T.toLower (T.pack s')
|
||||
|
||||
|
||||
downloaderParser :: String -> Either String Downloader
|
||||
downloaderParser s' | t == T.pack "curl" = Right Curl
|
||||
| t == T.pack "wget" = Right Wget
|
||||
#if defined(INTERNAL_DOWNLOADER)
|
||||
| t == T.pack "internal" = Right Internal
|
||||
#endif
|
||||
| otherwise = Left ("Unknown downloader value: " <> s')
|
||||
where t = T.toLower (T.pack s')
|
||||
|
||||
|
||||
platformParser :: String -> Either String PlatformRequest
|
||||
platformParser s' = case MP.parse (platformP <* MP.eof) "" (T.pack s') of
|
||||
Right r -> pure r
|
||||
@@ -650,10 +622,9 @@ platformParser s' = case MP.parse (platformP <* MP.eof) "" (T.pack s') of
|
||||
|
||||
toSettings :: Options -> Settings
|
||||
toSettings Options {..} =
|
||||
let cache = optCache
|
||||
noVerify = optNoVerify
|
||||
keepDirs = optKeepDirs
|
||||
downloader = optsDownloader
|
||||
let cache = optCache
|
||||
noVerify = optNoVerify
|
||||
keepDirs = optKeepDirs
|
||||
in Settings { .. }
|
||||
|
||||
|
||||
@@ -841,9 +812,9 @@ Report bugs at <https://gitlab.haskell.org/haskell/ghcup-hs/issues>|]
|
||||
(GHCupInfo treq dls) <-
|
||||
( runLogger
|
||||
. flip runReaderT settings
|
||||
. runE @'[JSONError , DownloadFailed, FileDoesNotExistError]
|
||||
. runE @'[JSONError , DownloadFailed]
|
||||
$ liftE
|
||||
$ getDownloadsF (maybe GHCupURL OwnSource optUrlSource)
|
||||
$ getDownloads (maybe GHCupURL OwnSource optUrlSource)
|
||||
)
|
||||
>>= \case
|
||||
VRight r -> pure r
|
||||
|
||||
@@ -26,16 +26,15 @@ eghcup() {
|
||||
download_ghcup() {
|
||||
_plat="$(uname -s)"
|
||||
_arch=$(uname -m)
|
||||
_ghver="0.1.5"
|
||||
|
||||
case "${_plat}" in
|
||||
"linux"|"Linux")
|
||||
case "${_arch}" in
|
||||
x86_64|amd64)
|
||||
_url=https://downloads.haskell.org/~ghcup/${_ghver}/x86_64-linux-ghcup-${_ghver}
|
||||
_url=https://downloads.haskell.org/~ghcup/0.1.4/x86_64-linux-ghcup-0.1.4
|
||||
;;
|
||||
i*86)
|
||||
_url=https://downloads.haskell.org/~ghcup/${_ghver}/i386-linux-ghcup-${_ghver}
|
||||
_url=https://downloads.haskell.org/~ghcup/0.1.4/i386-linux-ghcup-0.1.4
|
||||
;;
|
||||
*) die "Unknown architecture: ${_arch}"
|
||||
;;
|
||||
@@ -51,7 +50,7 @@ download_ghcup() {
|
||||
*) die "Unknown architecture: ${_arch}"
|
||||
;;
|
||||
esac
|
||||
_url=https://downloads.haskell.org/~ghcup/${_ghver}/x86_64-portbld-freebsd-ghcup-${_ghver}
|
||||
_url=https://downloads.haskell.org/~ghcup/0.1.4/x86_64-portbld-freebsd-ghcup-0.1.4
|
||||
;;
|
||||
"Darwin"|"darwin")
|
||||
case "${_arch}" in
|
||||
@@ -63,31 +62,30 @@ download_ghcup() {
|
||||
*) die "Unknown architecture: ${_arch}"
|
||||
;;
|
||||
esac
|
||||
_url=https://downloads.haskell.org/~ghcup/${_ghver}/x86_64-apple-darwin-ghcup-${_ghver} ;;
|
||||
_url=https://downloads.haskell.org/~ghcup/0.1.4/x86_64-apple-darwin-ghcup-0.1.4 ;;
|
||||
*) die "Unknown platform: ${_plat}"
|
||||
;;
|
||||
esac
|
||||
|
||||
edo curl -Lf "${_url}" > "${GHCUP_INSTALL_BASE_PREFIX}"/.ghcup/bin/ghcup
|
||||
|
||||
unset _plat _arch _url _ghver
|
||||
unset _plat _arch _url
|
||||
}
|
||||
|
||||
|
||||
echo
|
||||
echo "Welcome to Haskell!"
|
||||
echo
|
||||
echo "This script will download and install the following binaries:"
|
||||
echo " * ghcup - The Haskell toolchain installer (for managing GHC/cabal versions)"
|
||||
echo " * ghc - The Glasgow Haskell Compiler"
|
||||
echo " * cabal - The Cabal build tool"
|
||||
echo "This will download and install the Glasgow Haskell Compiler (GHC)"
|
||||
echo "and the Cabal build tool."
|
||||
echo
|
||||
echo "ghcup installs only into the following directory, which can be removed anytime:"
|
||||
echo " $GHCUP_INSTALL_BASE_PREFIX/.ghcup"
|
||||
echo
|
||||
|
||||
if [ -z "${BOOTSTRAP_HASKELL_NONINTERACTIVE}" ] ; then
|
||||
printf "\\033[0;35m%s\\033[0m\\n" "Press ENTER to proceed or ctrl-c to abort."
|
||||
printf "\\033[0;35m%s\\033[0m\\n" "Press ENTER to proceed"
|
||||
printf "\\033[0;35m%s\\033[0m\\n" "or ctrl-c to abort."
|
||||
printf "\\033[0;35m%s\\033[0m\\n" "Note that this script can be re-run at any given time."
|
||||
echo
|
||||
# Wait for user input to continue.
|
||||
@@ -118,7 +116,8 @@ echo "$(ghcup tool-requirements)"
|
||||
echo
|
||||
|
||||
if [ -z "${BOOTSTRAP_HASKELL_NONINTERACTIVE}" ] ; then
|
||||
printf "\\033[0;35m%s\\033[0m\\n" "Press ENTER to proceed or ctrl-c to abort."
|
||||
printf "\\033[0;35m%s\\033[0m\\n" "Press ENTER to proceed"
|
||||
printf "\\033[0;35m%s\\033[0m\\n" "or ctrl-c to abort."
|
||||
printf "\\033[0;35m%s\\033[0m\\n" "Installation may take a while."
|
||||
echo
|
||||
|
||||
@@ -148,11 +147,21 @@ if [ -z "${BOOTSTRAP_HASKELL_NONINTERACTIVE}" ] ; then
|
||||
GHCUP_PROFILE_FILE="$HOME/.zshrc"
|
||||
MY_SHELL="zsh" ;;
|
||||
*/bash) # login shell is bash
|
||||
GHCUP_PROFILE_FILE="$HOME/.bashrc"
|
||||
if [ -f "$HOME/.bashrc" ] ; then # bashrc is not sourced by default, so assume it isn't if file does not exist
|
||||
GHCUP_PROFILE_FILE="$HOME/.bashrc"
|
||||
else
|
||||
GHCUP_PROFILE_FILE="$HOME/.bash_profile"
|
||||
fi
|
||||
|
||||
MY_SHELL="bash" ;;
|
||||
*/sh) # login shell is sh, but might be a symlink to bash or zsh
|
||||
if [ -n "${BASH}" ] ; then
|
||||
GHCUP_PROFILE_FILE="$HOME/.bashrc"
|
||||
if [ -f "$HOME/.bashrc" ] ; then # bashrc is not sourced by default, so assume it isn't if file does not exist
|
||||
GHCUP_PROFILE_FILE="$HOME/.bashrc"
|
||||
else
|
||||
GHCUP_PROFILE_FILE="$HOME/.bash_profile"
|
||||
fi
|
||||
|
||||
MY_SHELL="bash"
|
||||
elif [ -n "${ZSH_VERSION}" ] ; then
|
||||
GHCUP_PROFILE_FILE="$HOME/.zshrc"
|
||||
|
||||
14
docker/build.sh
Normal file
14
docker/build.sh
Normal file
@@ -0,0 +1,14 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -ex
|
||||
|
||||
cd /app
|
||||
|
||||
cabal v2-update
|
||||
|
||||
cabal v2-install \
|
||||
--install-method=copy \
|
||||
--overwrite-policy=always \
|
||||
--installdir="/bin" \
|
||||
--ghc-options='-optl-static'
|
||||
|
||||
2179
ghcup-0.0.1.json
Normal file
2179
ghcup-0.0.1.json
Normal file
File diff suppressed because it is too large
Load Diff
119
ghcup-0.0.2.json
119
ghcup-0.0.2.json
@@ -58,35 +58,6 @@
|
||||
"distroPKGs": [],
|
||||
"notes": "You need the following packages: curl g++ gcc gmp make ncurses realpath xz-utils. Consult your distro documentation on the exact names of those packages."
|
||||
}
|
||||
},
|
||||
"Linux_CentOS": {
|
||||
"7": {
|
||||
"distroPKGs": [
|
||||
"gcc",
|
||||
"gcc-c++",
|
||||
"gmp",
|
||||
"gmp-devel",
|
||||
"make",
|
||||
"ncurses",
|
||||
"xz",
|
||||
"perl"
|
||||
],
|
||||
"notes": ""
|
||||
},
|
||||
"unknown_versioning": {
|
||||
"distroPKGs": [
|
||||
"gcc",
|
||||
"gcc-c++",
|
||||
"gmp",
|
||||
"gmp-devel",
|
||||
"make",
|
||||
"ncurses",
|
||||
"ncurses-compat-libs",
|
||||
"xz",
|
||||
"perl"
|
||||
],
|
||||
"notes": ""
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -199,7 +170,7 @@
|
||||
"dlSubdir": "ghc-8.6.2",
|
||||
"dlUri": "https://downloads.haskell.org/~ghc/8.6.2/ghc-8.6.2-src.tar.xz"
|
||||
},
|
||||
"viChangeLog": "https://downloads.haskell.org/~ghc/8.6.2/docs/html/users_guide/8.6.2-notes.html",
|
||||
"viChangeLog": "https://downloads.haskell.org/ghc/8.6.2/docs/html/users_guide/8.6.2-notes.html",
|
||||
"viTags": [
|
||||
"base-4.12.0.0"
|
||||
]
|
||||
@@ -296,7 +267,7 @@
|
||||
"dlSubdir": "ghc-8.0.2",
|
||||
"dlUri": "https://downloads.haskell.org/~ghc/8.0.2/ghc-8.0.2-src.tar.xz"
|
||||
},
|
||||
"viChangeLog": "https://downloads.haskell.org/~ghc/8.0.2/docs/html/users_guide/8.0.1-notes.html",
|
||||
"viChangeLog": "https://downloads.haskell.org/ghc/8.0.2/docs/html/users_guide/8.0.1-notes.html",
|
||||
"viTags": [
|
||||
"base-4.9.1.0"
|
||||
]
|
||||
@@ -412,7 +383,7 @@
|
||||
"dlSubdir": "ghc-8.6.4",
|
||||
"dlUri": "https://downloads.haskell.org/~ghc/8.6.4/ghc-8.6.4-src.tar.xz"
|
||||
},
|
||||
"viChangeLog": "https://downloads.haskell.org/~ghc/8.6.4/docs/html/users_guide/8.6.4-notes.html",
|
||||
"viChangeLog": "https://downloads.haskell.org/ghc/8.6.4/docs/html/users_guide/8.6.4-notes.html",
|
||||
"viTags": [
|
||||
"base-4.12.0.0"
|
||||
]
|
||||
@@ -520,7 +491,7 @@
|
||||
"dlSubdir": "ghc-8.4.1",
|
||||
"dlUri": "https://downloads.haskell.org/~ghc/8.4.1/ghc-8.4.1-src.tar.xz"
|
||||
},
|
||||
"viChangeLog": "https://downloads.haskell.org/~ghc/8.4.1/docs/html/users_guide/8.4.1-notes.html",
|
||||
"viChangeLog": "https://downloads.haskell.org/ghc/8.4.1/docs/html/users_guide/8.4.1-notes.html",
|
||||
"viTags": [
|
||||
"base-4.11.0.0"
|
||||
]
|
||||
@@ -657,7 +628,7 @@
|
||||
"dlSubdir": "ghc-8.6.3",
|
||||
"dlUri": "https://downloads.haskell.org/~ghc/8.6.3/ghc-8.6.3-src.tar.xz"
|
||||
},
|
||||
"viChangeLog": "https://downloads.haskell.org/~ghc/8.6.3/docs/html/users_guide/8.6.3-notes.html",
|
||||
"viChangeLog": "https://downloads.haskell.org/ghc/8.6.3/docs/html/users_guide/8.6.3-notes.html",
|
||||
"viTags": [
|
||||
"base-4.12.0.0"
|
||||
]
|
||||
@@ -800,7 +771,7 @@
|
||||
"dlSubdir": "ghc-8.10.1",
|
||||
"dlUri": "https://downloads.haskell.org/~ghc/8.10.1/ghc-8.10.1-src.tar.xz"
|
||||
},
|
||||
"viChangeLog": "https://downloads.haskell.org/~ghc/8.10.1/docs/html/users_guide/8.10.1-notes.html",
|
||||
"viChangeLog": "https://downloads.haskell.org/ghc/8.10.1/docs/html/users_guide/8.10.1-notes.html",
|
||||
"viTags": [
|
||||
"Latest",
|
||||
"base-4.14.0.0"
|
||||
@@ -931,7 +902,7 @@
|
||||
"dlSubdir": "ghc-8.6.5",
|
||||
"dlUri": "https://downloads.haskell.org/~ghc/8.6.5/ghc-8.6.5-src.tar.xz"
|
||||
},
|
||||
"viChangeLog": "https://downloads.haskell.org/~ghc/8.6.5/docs/html/users_guide/8.6.5-notes.html",
|
||||
"viChangeLog": "https://downloads.haskell.org/ghc/8.6.5/docs/html/users_guide/8.6.5-notes.html",
|
||||
"viTags": [
|
||||
"base-4.12.0.0"
|
||||
]
|
||||
@@ -1054,7 +1025,7 @@
|
||||
"dlSubdir": "ghc-8.4.2",
|
||||
"dlUri": "https://downloads.haskell.org/~ghc/8.4.2/ghc-8.4.2-src.tar.xz"
|
||||
},
|
||||
"viChangeLog": "https://downloads.haskell.org/~ghc/8.4.2/docs/html/users_guide/8.4.2-notes.html",
|
||||
"viChangeLog": "https://downloads.haskell.org/ghc/8.4.2/docs/html/users_guide/8.4.2-notes.html",
|
||||
"viTags": [
|
||||
"base-4.11.1.0"
|
||||
]
|
||||
@@ -1184,7 +1155,7 @@
|
||||
"dlSubdir": "ghc-8.8.1",
|
||||
"dlUri": "https://downloads.haskell.org/~ghc/8.8.1/ghc-8.8.1-src.tar.xz"
|
||||
},
|
||||
"viChangeLog": "https://downloads.haskell.org/~ghc/8.8.1/docs/html/users_guide/8.8.1-notes.html",
|
||||
"viChangeLog": "https://downloads.haskell.org/ghc/8.8.1/docs/html/users_guide/8.8.1-notes.html",
|
||||
"viTags": [
|
||||
"base-4.13.0.0"
|
||||
]
|
||||
@@ -1300,7 +1271,7 @@
|
||||
"dlSubdir": "ghc-8.4.3",
|
||||
"dlUri": "https://downloads.haskell.org/~ghc/8.4.3/ghc-8.4.3-src.tar.xz"
|
||||
},
|
||||
"viChangeLog": "https://downloads.haskell.org/~ghc/8.4.3/docs/html/users_guide/8.4.3-notes.html",
|
||||
"viChangeLog": "https://downloads.haskell.org/ghc/8.4.3/docs/html/users_guide/8.4.3-notes.html",
|
||||
"viTags": [
|
||||
"base-4.11.1.0"
|
||||
]
|
||||
@@ -1423,7 +1394,7 @@
|
||||
"dlSubdir": "ghc-8.6.1",
|
||||
"dlUri": "https://downloads.haskell.org/~ghc/8.6.1/ghc-8.6.1-src.tar.xz"
|
||||
},
|
||||
"viChangeLog": "https://downloads.haskell.org/~ghc/8.6.1/docs/html/users_guide/8.6.1-notes.html",
|
||||
"viChangeLog": "https://downloads.haskell.org/ghc/8.6.1/docs/html/users_guide/8.6.1-notes.html",
|
||||
"viTags": [
|
||||
"base-4.12.0.0"
|
||||
]
|
||||
@@ -1553,7 +1524,7 @@
|
||||
"dlSubdir": "ghc-8.8.2",
|
||||
"dlUri": "https://downloads.haskell.org/~ghc/8.8.2/ghc-8.8.2-src.tar.xz"
|
||||
},
|
||||
"viChangeLog": "https://downloads.haskell.org/~ghc/8.8.2/docs/html/users_guide/8.8.2-notes.html",
|
||||
"viChangeLog": "https://downloads.haskell.org/ghc/8.8.2/docs/html/users_guide/8.8.2-notes.html",
|
||||
"viTags": [
|
||||
"base-4.13.0.0"
|
||||
]
|
||||
@@ -1682,7 +1653,7 @@
|
||||
"dlSubdir": "ghc-7.10.3",
|
||||
"dlUri": "https://downloads.haskell.org/~ghc/7.10.3/ghc-7.10.3-src.tar.xz"
|
||||
},
|
||||
"viChangeLog": "https://downloads.haskell.org/~ghc/7.10.3/docs/html/users_guide/release-7-10-1.html",
|
||||
"viChangeLog": "https://downloads.haskell.org/ghc/7.10.3/docs/html/users_guide/release-7-10-1.html",
|
||||
"viTags": [
|
||||
"base-4.8.2.0"
|
||||
]
|
||||
@@ -1789,7 +1760,7 @@
|
||||
"dlSubdir": "ghc-8.2.2",
|
||||
"dlUri": "https://downloads.haskell.org/~ghc/8.2.2/ghc-8.2.2-src.tar.xz"
|
||||
},
|
||||
"viChangeLog": "https://downloads.haskell.org/~ghc/8.2.2/docs/html/users_guide/8.2.2-notes.html",
|
||||
"viChangeLog": "https://downloads.haskell.org/ghc/8.2.2/docs/html/users_guide/8.2.2-notes.html",
|
||||
"viTags": [
|
||||
"base-4.10.1.0"
|
||||
]
|
||||
@@ -1926,7 +1897,7 @@
|
||||
"dlSubdir": "ghc-8.4.4",
|
||||
"dlUri": "https://downloads.haskell.org/~ghc/8.4.4/ghc-8.4.4-src.tar.xz"
|
||||
},
|
||||
"viChangeLog": "https://downloads.haskell.org/~ghc/8.4.4/docs/html/users_guide/8.4.4-notes.html",
|
||||
"viChangeLog": "https://downloads.haskell.org/ghc/8.4.4/docs/html/users_guide/8.4.4-notes.html",
|
||||
"viTags": [
|
||||
"base-4.11.1.0"
|
||||
]
|
||||
@@ -2056,7 +2027,7 @@
|
||||
"dlSubdir": "ghc-8.8.3",
|
||||
"dlUri": "https://downloads.haskell.org/~ghc/8.8.3/ghc-8.8.3-src.tar.xz"
|
||||
},
|
||||
"viChangeLog": "https://downloads.haskell.org/~ghc/8.8.3/docs/html/users_guide/8.8.3-notes.html",
|
||||
"viChangeLog": "https://downloads.haskell.org/ghc/8.8.3/docs/html/users_guide/8.8.3-notes.html",
|
||||
"viTags": [
|
||||
"Recommended",
|
||||
"base-4.13.0.0"
|
||||
@@ -2069,23 +2040,23 @@
|
||||
"A_64": {
|
||||
"Linux_Alpine": {
|
||||
"unknown_versioning": {
|
||||
"dlHash": "2b7ea63601e11a0db2941b96e6a7036a48efc2a1ab3849d7dfce08b45f5daa58",
|
||||
"dlHash": "7b35e5986aba4a40fc37141cbde26612bfc916e95a2d2ff35a413612d8c7cd3a",
|
||||
"dlSubdir": null,
|
||||
"dlUri": "https://downloads.haskell.org/~cabal/cabal-install-3.0.0.0/cabal-install-3.0.0.0-x86_64-alpine-linux-musl.tar.xz"
|
||||
"dlUri": "https://hasufell.de/d/d3e215db133e4fcaa61e/files/?p=%2Fcabal-install-3.0.0.0-x86_64-alpine-linux-musl.tar.xz&dl=1"
|
||||
}
|
||||
},
|
||||
"FreeBSD": {
|
||||
"unknown_versioning": {
|
||||
"dlHash": "2240842ab2ae7b955feb8b526aba1c7991248c803383107adf39990441294d2a",
|
||||
"dlHash": "d97b6469ed612a1367ad1032d0722469ee5277668879694d7d4336233b937516",
|
||||
"dlSubdir": null,
|
||||
"dlUri": "https://downloads.haskell.org/~cabal/cabal-install-3.0.0.0/cabal-install-3.0.0.0-x86_64-portbld-freebsd.tar.xz"
|
||||
"dlUri": "https://hasufell.de/d/d3e215db133e4fcaa61e/files/?p=%2Fcabal-install-3.0.0.0-x86_64-portbld-freebsd.tar.xz&dl=1"
|
||||
}
|
||||
},
|
||||
"Darwin": {
|
||||
"unknown_versioning": {
|
||||
"dlHash": "d4857e068560515e4cbb0e8ca124c370e07892f2a28804d87152834e5fe2b845",
|
||||
"dlSubdir": null,
|
||||
"dlUri": "https://downloads.haskell.org/~cabal/cabal-install-3.0.0.0/cabal-install-3.0.0.0-x86_64-apple-darwin17.7.0.tar.xz"
|
||||
"dlUri": "https://downloads.haskell.org/cabal/cabal-install-3.0.0.0/cabal-install-3.0.0.0-x86_64-apple-darwin17.7.0.tar.xz"
|
||||
}
|
||||
},
|
||||
"Linux_UnknownLinux": {
|
||||
@@ -2099,16 +2070,16 @@
|
||||
"A_32": {
|
||||
"Linux_Alpine": {
|
||||
"unknown_versioning": {
|
||||
"dlHash": "ac018f061993d40bf146517e32629bcab274b4d9f5527b1c37a665ebdf3f5ac6",
|
||||
"dlHash": "a4191cd5a645b00e6a9c53abe6f3cb91fe700de7d7c520c9cb36ce8ec5c9919a",
|
||||
"dlSubdir": null,
|
||||
"dlUri": "https://downloads.haskell.org/~cabal/cabal-install-3.0.0.0/cabal-install-3.0.0.0-i386-alpine-linux-musl.tar.xz"
|
||||
"dlUri": "https://hasufell.de/d/d3e215db133e4fcaa61e/files/?p=%2Fcabal-install-3.0.0.0-i386-alpine-linux-musl.tar.xz&dl=1"
|
||||
}
|
||||
},
|
||||
"Linux_UnknownLinux": {
|
||||
"unknown_versioning": {
|
||||
"dlHash": "6898ccd6e6dc0872999c06daaf61d546164e12f60a1880d09852c9f0c59c5cf6",
|
||||
"dlSubdir": null,
|
||||
"dlUri": "https://downloads.haskell.org/~cabal/cabal-install-3.0.0.0/cabal-install-3.0.0.0-i386-unknown-linux.tar.xz"
|
||||
"dlUri": "https://downloads.haskell.org/cabal/cabal-install-3.0.0.0/cabal-install-3.0.0.0-i386-unknown-linux.tar.xz"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2126,23 +2097,23 @@
|
||||
"A_64": {
|
||||
"Linux_Alpine": {
|
||||
"unknown_versioning": {
|
||||
"dlHash": "8bae37a1ce8b5f10440b5591fed734935e1411c1b765258325ffe268e2cc2042",
|
||||
"dlHash": "c1f3c21a5307cea8d2a0bd9a2eab9f56f3dd90e947ae64e231f909024980992b",
|
||||
"dlSubdir": null,
|
||||
"dlUri": "https://downloads.haskell.org/~cabal/cabal-install-3.2.0.0/cabal-install-3.2.0.0-x86_64-alpine-linux-musl.tar.xz"
|
||||
"dlUri": "https://hasufell.de/d/d3e215db133e4fcaa61e/files/?p=%2Fcabal-install-3.2.0.0-x86_64-alpine-linux-musl.tar.xz&dl=1"
|
||||
}
|
||||
},
|
||||
"FreeBSD": {
|
||||
"unknown_versioning": {
|
||||
"dlHash": "f1e35151cca91541b0fb4bdb3ed18f3c348038eab751845ad19c11307d66c273",
|
||||
"dlHash": "e4dc00ab7fef51354e7624dd03e49c6bb684887fc95acb9b33bc52f357a5ef8c",
|
||||
"dlSubdir": null,
|
||||
"dlUri": "https://downloads.haskell.org/~cabal/cabal-install-3.2.0.0/cabal-install-3.2.0.0-x86_64-portbld-freebsd.tar.xz"
|
||||
"dlUri": "https://hasufell.de/d/d3e215db133e4fcaa61e/files/?p=%2Fcabal-install-3.2.0.0-x86_64-portbld-freebsd.tar.xz&dl=1"
|
||||
}
|
||||
},
|
||||
"Darwin": {
|
||||
"unknown_versioning": {
|
||||
"dlHash": "9197c17d2ece0f934f5b33e323cfcaf486e4681952687bc3d249488ce3cbe0e9",
|
||||
"dlSubdir": null,
|
||||
"dlUri": "https://downloads.haskell.org/~cabal/cabal-install-3.2.0.0/cabal-install-3.2.0.0-x86_64-apple-darwin17.7.0.tar.xz"
|
||||
"dlUri": "https://downloads.haskell.org/cabal/cabal-install-3.2.0.0/cabal-install-3.2.0.0-x86_64-apple-darwin17.7.0.tar.xz"
|
||||
}
|
||||
},
|
||||
"Linux_UnknownLinux": {
|
||||
@@ -2156,16 +2127,16 @@
|
||||
"A_32": {
|
||||
"Linux_Alpine": {
|
||||
"unknown_versioning": {
|
||||
"dlHash": "c2a419dedf730987b60daf8d24e871d115a09ea608d740d7c61b36e3f5b9c830",
|
||||
"dlHash": "4aaa52fbc337ae1ef855a2aa2808186580b21ec36883aafec7473e7d899bc5ec",
|
||||
"dlSubdir": null,
|
||||
"dlUri": "https://downloads.haskell.org/~cabal/cabal-install-3.2.0.0/cabal-install-3.2.0.0-i386-alpine-linux-musl.tar.xz"
|
||||
"dlUri": "https://hasufell.de/d/d3e215db133e4fcaa61e/files/?p=%2Fcabal-install-3.2.0.0-i386-alpine-linux-musl.tar.xz&dl=1"
|
||||
}
|
||||
},
|
||||
"Linux_UnknownLinux": {
|
||||
"unknown_versioning": {
|
||||
"dlHash": "2b3ac28549916de5f3379241797eaf60e84b6c001f2abbe73d9fadbbaf768e93",
|
||||
"dlSubdir": null,
|
||||
"dlUri": "https://downloads.haskell.org/~cabal/cabal-install-3.2.0.0/cabal-install-3.2.0.0-i386-unknown-linux.tar.xz"
|
||||
"dlUri": "https://downloads.haskell.org/cabal/cabal-install-3.2.0.0/cabal-install-3.2.0.0-i386-unknown-linux.tar.xz"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2188,7 +2159,7 @@
|
||||
"unknown_versioning": {
|
||||
"dlHash": "720bef015f834a03deb7180be2952a44e7c2e6c8429137570404c3de4f46b984",
|
||||
"dlSubdir": null,
|
||||
"dlUri": "https://downloads.haskell.org/~cabal/cabal-install-2.4.1.0/cabal-install-2.4.1.0-x86_64-alpine-linux-musl.tar.xz"
|
||||
"dlUri": "https://downloads.haskell.org/cabal/cabal-install-2.4.1.0/cabal-install-2.4.1.0-x86_64-alpine-linux-musl.tar.xz"
|
||||
}
|
||||
},
|
||||
"FreeBSD": {
|
||||
@@ -2202,14 +2173,14 @@
|
||||
"unknown_versioning": {
|
||||
"dlHash": "56361cf4b0d920fe23174751fea1fb82a8e1ce522bd9706a3fbe47a72e458c9c",
|
||||
"dlSubdir": null,
|
||||
"dlUri": "https://downloads.haskell.org/~cabal/cabal-install-2.4.1.0/cabal-install-2.4.1.0-x86_64-apple-darwin-sierra.tar.xz"
|
||||
"dlUri": "https://downloads.haskell.org/cabal/cabal-install-2.4.1.0/cabal-install-2.4.1.0-x86_64-apple-darwin-sierra.tar.xz"
|
||||
}
|
||||
},
|
||||
"Linux_UnknownLinux": {
|
||||
"unknown_versioning": {
|
||||
"dlHash": "6136c189ffccaa39916f9cb5788f757166444a2d0c473b987856a79ecbf0c714",
|
||||
"dlSubdir": null,
|
||||
"dlUri": "https://downloads.haskell.org/~cabal/cabal-install-2.4.1.0/cabal-install-2.4.1.0-x86_64-unknown-linux.tar.xz"
|
||||
"dlUri": "https://downloads.haskell.org/cabal/cabal-install-2.4.1.0/cabal-install-2.4.1.0-x86_64-unknown-linux.tar.xz"
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -2218,7 +2189,7 @@
|
||||
"unknown_versioning": {
|
||||
"dlHash": "b2da736cc27609442b10f77fc1a687aba603a7a33045b722dbf1a0066fade198",
|
||||
"dlSubdir": null,
|
||||
"dlUri": "https://downloads.haskell.org/~cabal/cabal-install-2.4.1.0/cabal-install-2.4.1.0-i386-unknown-linux.tar.xz"
|
||||
"dlUri": "https://downloads.haskell.org/cabal/cabal-install-2.4.1.0/cabal-install-2.4.1.0-i386-unknown-linux.tar.xz"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2233,37 +2204,37 @@
|
||||
}
|
||||
},
|
||||
"GHCup": {
|
||||
"0.1.5": {
|
||||
"0.1.4": {
|
||||
"viArch": {
|
||||
"A_64": {
|
||||
"FreeBSD": {
|
||||
"unknown_versioning": {
|
||||
"dlHash": "6dd57cc5958ef3a6ba7de22808d9292d31dada8af95277578b69be35fc090194",
|
||||
"dlHash": "cda0b959f053abc04ab0a1b9919a505b8c9304e2898a291f527a370cb0e00731",
|
||||
"dlSubdir": null,
|
||||
"dlUri": "https://downloads.haskell.org/~ghcup/0.1.5/x86_64-portbld-freebsd-ghcup-0.1.5"
|
||||
"dlUri": "https://downloads.haskell.org/~ghcup/0.1.4/x86_64-portbld-freebsd-ghcup-0.1.4"
|
||||
}
|
||||
},
|
||||
"Darwin": {
|
||||
"unknown_versioning": {
|
||||
"dlHash": "5be3324b65c737af942cc5ed1a025d4882f29c1efcc7dcd971a893efab78d394",
|
||||
"dlHash": "2422b79933ae037237ccb8f836417b90b3111d7931beb7ae8b9e33a1945c641e",
|
||||
"dlSubdir": null,
|
||||
"dlUri": "https://downloads.haskell.org/~ghcup/0.1.5/x86_64-apple-darwin-ghcup-0.1.5"
|
||||
"dlUri": "https://downloads.haskell.org/~ghcup/0.1.4/x86_64-apple-darwin-ghcup-0.1.4"
|
||||
}
|
||||
},
|
||||
"Linux_UnknownLinux": {
|
||||
"unknown_versioning": {
|
||||
"dlHash": "cfdb01dde77121859b5d90b6707238b54e23787fcbb3003e18ab52a5dbfee330",
|
||||
"dlHash": "78d69ed4c9a810a445af89ea25e4217a632799ecb427b06cd2320ffb574f555e",
|
||||
"dlSubdir": null,
|
||||
"dlUri": "https://downloads.haskell.org/~ghcup/0.1.5/x86_64-linux-ghcup-0.1.5"
|
||||
"dlUri": "https://downloads.haskell.org/~ghcup/0.1.4/x86_64-linux-ghcup-0.1.4"
|
||||
}
|
||||
}
|
||||
},
|
||||
"A_32": {
|
||||
"Linux_UnknownLinux": {
|
||||
"unknown_versioning": {
|
||||
"dlHash": "3707f60d703912709335dc0103fb1af5e5dfa83050825a8156b56bc81760b2a8",
|
||||
"dlHash": "057cc1cc39abdacd92cb1d4fb44c850fd9c5398a36b893286248ac5c38bc0c70",
|
||||
"dlSubdir": null,
|
||||
"dlUri": "https://downloads.haskell.org/~ghcup/0.1.5/i386-linux-ghcup-0.1.5"
|
||||
"dlUri": "https://downloads.haskell.org/~ghcup/0.1.4/i386-linux-ghcup-0.1.4"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
15
ghcup.cabal
15
ghcup.cabal
@@ -1,6 +1,6 @@
|
||||
cabal-version: 3.0
|
||||
name: ghcup
|
||||
version: 0.1.5
|
||||
version: 0.1.4
|
||||
synopsis: ghc toolchain installer as an exe/library
|
||||
description:
|
||||
A rewrite of the shell script ghcup, for providing
|
||||
@@ -21,8 +21,8 @@ source-repository head
|
||||
type: git
|
||||
location: https://gitlab.haskell.org/haskell/ghcup-hs.git
|
||||
|
||||
flag internal-downloader
|
||||
description: Compile the internal downloader, which links against OpenSSL
|
||||
flag Curl
|
||||
description: Use curl instead of http-io-streams for download
|
||||
default: False
|
||||
manual: True
|
||||
|
||||
@@ -302,14 +302,15 @@ library
|
||||
-- other-extensions:
|
||||
hs-source-dirs: lib
|
||||
|
||||
if flag(internal-downloader)
|
||||
if !flag(curl)
|
||||
import:
|
||||
, HsOpenSSL
|
||||
, http-io-streams
|
||||
, io-streams
|
||||
, terminal-progress-bar
|
||||
exposed-modules: GHCup.Download.IOStreams
|
||||
cpp-options: -DINTERNAL_DOWNLOADER
|
||||
else
|
||||
cpp-options: -DCURL
|
||||
|
||||
executable ghcup
|
||||
import:
|
||||
@@ -344,10 +345,6 @@ executable ghcup
|
||||
hs-source-dirs: app/ghcup
|
||||
default-language: Haskell2010
|
||||
|
||||
if flag(internal-downloader)
|
||||
cpp-options: -DINTERNAL_DOWNLOADER
|
||||
|
||||
|
||||
executable ghcup-gen
|
||||
import:
|
||||
config
|
||||
|
||||
@@ -897,25 +897,25 @@ ghc_8101_64_alpine = DownloadInfo
|
||||
|
||||
cabal_2410_32_linux :: DownloadInfo
|
||||
cabal_2410_32_linux = DownloadInfo
|
||||
[uri|https://downloads.haskell.org/~cabal/cabal-install-2.4.1.0/cabal-install-2.4.1.0-i386-unknown-linux.tar.xz|]
|
||||
[uri|https://downloads.haskell.org/cabal/cabal-install-2.4.1.0/cabal-install-2.4.1.0-i386-unknown-linux.tar.xz|]
|
||||
Nothing
|
||||
"b2da736cc27609442b10f77fc1a687aba603a7a33045b722dbf1a0066fade198"
|
||||
|
||||
cabal_2410_64_linux :: DownloadInfo
|
||||
cabal_2410_64_linux = DownloadInfo
|
||||
[uri|https://downloads.haskell.org/~cabal/cabal-install-2.4.1.0/cabal-install-2.4.1.0-x86_64-unknown-linux.tar.xz|]
|
||||
[uri|https://downloads.haskell.org/cabal/cabal-install-2.4.1.0/cabal-install-2.4.1.0-x86_64-unknown-linux.tar.xz|]
|
||||
Nothing
|
||||
"6136c189ffccaa39916f9cb5788f757166444a2d0c473b987856a79ecbf0c714"
|
||||
|
||||
cabal_2410_64_darwin :: DownloadInfo
|
||||
cabal_2410_64_darwin = DownloadInfo
|
||||
[uri|https://downloads.haskell.org/~cabal/cabal-install-2.4.1.0/cabal-install-2.4.1.0-x86_64-apple-darwin-sierra.tar.xz|]
|
||||
[uri|https://downloads.haskell.org/cabal/cabal-install-2.4.1.0/cabal-install-2.4.1.0-x86_64-apple-darwin-sierra.tar.xz|]
|
||||
Nothing
|
||||
"56361cf4b0d920fe23174751fea1fb82a8e1ce522bd9706a3fbe47a72e458c9c"
|
||||
|
||||
cabal_2410_64_alpine :: DownloadInfo
|
||||
cabal_2410_64_alpine = DownloadInfo
|
||||
[uri|https://downloads.haskell.org/~cabal/cabal-install-2.4.1.0/cabal-install-2.4.1.0-x86_64-alpine-linux-musl.tar.xz|]
|
||||
[uri|https://downloads.haskell.org/cabal/cabal-install-2.4.1.0/cabal-install-2.4.1.0-x86_64-alpine-linux-musl.tar.xz|]
|
||||
Nothing
|
||||
"720bef015f834a03deb7180be2952a44e7c2e6c8429137570404c3de4f46b984"
|
||||
|
||||
@@ -935,7 +935,7 @@ cabal_2410_64_freebsd = DownloadInfo
|
||||
|
||||
cabal_3000_32_linux :: DownloadInfo
|
||||
cabal_3000_32_linux = DownloadInfo
|
||||
[uri|https://downloads.haskell.org/~cabal/cabal-install-3.0.0.0/cabal-install-3.0.0.0-i386-unknown-linux.tar.xz|]
|
||||
[uri|https://downloads.haskell.org/cabal/cabal-install-3.0.0.0/cabal-install-3.0.0.0-i386-unknown-linux.tar.xz|]
|
||||
Nothing
|
||||
"6898ccd6e6dc0872999c06daaf61d546164e12f60a1880d09852c9f0c59c5cf6"
|
||||
|
||||
@@ -947,27 +947,27 @@ cabal_3000_64_linux = DownloadInfo
|
||||
|
||||
cabal_3000_64_darwin :: DownloadInfo
|
||||
cabal_3000_64_darwin = DownloadInfo
|
||||
[uri|https://downloads.haskell.org/~cabal/cabal-install-3.0.0.0/cabal-install-3.0.0.0-x86_64-apple-darwin17.7.0.tar.xz|]
|
||||
[uri|https://downloads.haskell.org/cabal/cabal-install-3.0.0.0/cabal-install-3.0.0.0-x86_64-apple-darwin17.7.0.tar.xz|]
|
||||
Nothing
|
||||
"d4857e068560515e4cbb0e8ca124c370e07892f2a28804d87152834e5fe2b845"
|
||||
|
||||
cabal_3000_64_freebsd :: DownloadInfo
|
||||
cabal_3000_64_freebsd = DownloadInfo
|
||||
[uri|https://downloads.haskell.org/~cabal/cabal-install-3.0.0.0/cabal-install-3.0.0.0-x86_64-portbld-freebsd.tar.xz|]
|
||||
[uri|https://hasufell.de/d/d3e215db133e4fcaa61e/files/?p=/cabal-install-3.0.0.0-x86_64-portbld-freebsd.tar.xz&dl=1|]
|
||||
Nothing
|
||||
"2240842ab2ae7b955feb8b526aba1c7991248c803383107adf39990441294d2a"
|
||||
"d97b6469ed612a1367ad1032d0722469ee5277668879694d7d4336233b937516"
|
||||
|
||||
cabal_3000_32_alpine :: DownloadInfo
|
||||
cabal_3000_32_alpine = DownloadInfo
|
||||
[uri|https://downloads.haskell.org/~cabal/cabal-install-3.0.0.0/cabal-install-3.0.0.0-i386-alpine-linux-musl.tar.xz|]
|
||||
[uri|https://hasufell.de/d/d3e215db133e4fcaa61e/files/?p=/cabal-install-3.0.0.0-i386-alpine-linux-musl.tar.xz&dl=1|]
|
||||
Nothing
|
||||
"ac018f061993d40bf146517e32629bcab274b4d9f5527b1c37a665ebdf3f5ac6"
|
||||
"a4191cd5a645b00e6a9c53abe6f3cb91fe700de7d7c520c9cb36ce8ec5c9919a"
|
||||
|
||||
cabal_3000_64_alpine :: DownloadInfo
|
||||
cabal_3000_64_alpine = DownloadInfo
|
||||
[uri|https://downloads.haskell.org/~cabal/cabal-install-3.0.0.0/cabal-install-3.0.0.0-x86_64-alpine-linux-musl.tar.xz|]
|
||||
[uri|https://hasufell.de/d/d3e215db133e4fcaa61e/files/?p=/cabal-install-3.0.0.0-x86_64-alpine-linux-musl.tar.xz&dl=1|]
|
||||
Nothing
|
||||
"2b7ea63601e11a0db2941b96e6a7036a48efc2a1ab3849d7dfce08b45f5daa58"
|
||||
"7b35e5986aba4a40fc37141cbde26612bfc916e95a2d2ff35a413612d8c7cd3a"
|
||||
|
||||
|
||||
|
||||
@@ -978,7 +978,7 @@ cabal_3000_64_alpine = DownloadInfo
|
||||
|
||||
cabal_3200_32_linux :: DownloadInfo
|
||||
cabal_3200_32_linux = DownloadInfo
|
||||
[uri|https://downloads.haskell.org/~cabal/cabal-install-3.2.0.0/cabal-install-3.2.0.0-i386-unknown-linux.tar.xz|]
|
||||
[uri|https://downloads.haskell.org/cabal/cabal-install-3.2.0.0/cabal-install-3.2.0.0-i386-unknown-linux.tar.xz|]
|
||||
Nothing
|
||||
"2b3ac28549916de5f3379241797eaf60e84b6c001f2abbe73d9fadbbaf768e93"
|
||||
|
||||
@@ -990,27 +990,27 @@ cabal_3200_64_linux = DownloadInfo
|
||||
|
||||
cabal_3200_64_darwin :: DownloadInfo
|
||||
cabal_3200_64_darwin = DownloadInfo
|
||||
[uri|https://downloads.haskell.org/~cabal/cabal-install-3.2.0.0/cabal-install-3.2.0.0-x86_64-apple-darwin17.7.0.tar.xz|]
|
||||
[uri|https://downloads.haskell.org/cabal/cabal-install-3.2.0.0/cabal-install-3.2.0.0-x86_64-apple-darwin17.7.0.tar.xz|]
|
||||
Nothing
|
||||
"9197c17d2ece0f934f5b33e323cfcaf486e4681952687bc3d249488ce3cbe0e9"
|
||||
|
||||
cabal_3200_64_freebsd :: DownloadInfo
|
||||
cabal_3200_64_freebsd = DownloadInfo
|
||||
[uri|https://downloads.haskell.org/~cabal/cabal-install-3.2.0.0/cabal-install-3.2.0.0-x86_64-portbld-freebsd.tar.xz|]
|
||||
[uri|https://hasufell.de/d/d3e215db133e4fcaa61e/files/?p=/cabal-install-3.2.0.0-x86_64-portbld-freebsd.tar.xz&dl=1|]
|
||||
Nothing
|
||||
"f1e35151cca91541b0fb4bdb3ed18f3c348038eab751845ad19c11307d66c273"
|
||||
"e4dc00ab7fef51354e7624dd03e49c6bb684887fc95acb9b33bc52f357a5ef8c"
|
||||
|
||||
cabal_3200_32_alpine :: DownloadInfo
|
||||
cabal_3200_32_alpine = DownloadInfo
|
||||
[uri|https://downloads.haskell.org/~cabal/cabal-install-3.2.0.0/cabal-install-3.2.0.0-i386-alpine-linux-musl.tar.xz|]
|
||||
[uri|https://hasufell.de/d/d3e215db133e4fcaa61e/files/?p=/cabal-install-3.2.0.0-i386-alpine-linux-musl.tar.xz&dl=1|]
|
||||
Nothing
|
||||
"c2a419dedf730987b60daf8d24e871d115a09ea608d740d7c61b36e3f5b9c830"
|
||||
"4aaa52fbc337ae1ef855a2aa2808186580b21ec36883aafec7473e7d899bc5ec"
|
||||
|
||||
cabal_3200_64_alpine :: DownloadInfo
|
||||
cabal_3200_64_alpine = DownloadInfo
|
||||
[uri|https://downloads.haskell.org/~cabal/cabal-install-3.2.0.0/cabal-install-3.2.0.0-x86_64-alpine-linux-musl.tar.xz|]
|
||||
[uri|https://hasufell.de/d/d3e215db133e4fcaa61e/files/?p=/cabal-install-3.2.0.0-x86_64-alpine-linux-musl.tar.xz&dl=1|]
|
||||
Nothing
|
||||
"8bae37a1ce8b5f10440b5591fed734935e1411c1b765258325ffe268e2cc2042"
|
||||
"c1f3c21a5307cea8d2a0bd9a2eab9f56f3dd90e947ae64e231f909024980992b"
|
||||
|
||||
|
||||
|
||||
@@ -1020,32 +1020,32 @@ cabal_3200_64_alpine = DownloadInfo
|
||||
-------------
|
||||
|
||||
|
||||
ghcup_015_32_linux :: DownloadInfo
|
||||
ghcup_015_32_linux = DownloadInfo
|
||||
[uri|https://downloads.haskell.org/~ghcup/0.1.5/i386-linux-ghcup-0.1.5|]
|
||||
ghcup_014_32_linux :: DownloadInfo
|
||||
ghcup_014_32_linux = DownloadInfo
|
||||
[uri|https://downloads.haskell.org/~ghcup/0.1.4/i386-linux-ghcup-0.1.4|]
|
||||
Nothing
|
||||
"3707f60d703912709335dc0103fb1af5e5dfa83050825a8156b56bc81760b2a8"
|
||||
"057cc1cc39abdacd92cb1d4fb44c850fd9c5398a36b893286248ac5c38bc0c70"
|
||||
|
||||
|
||||
ghcup_015_64_linux :: DownloadInfo
|
||||
ghcup_015_64_linux = DownloadInfo
|
||||
[uri|https://downloads.haskell.org/~ghcup/0.1.5/x86_64-linux-ghcup-0.1.5|]
|
||||
ghcup_014_64_linux :: DownloadInfo
|
||||
ghcup_014_64_linux = DownloadInfo
|
||||
[uri|https://downloads.haskell.org/~ghcup/0.1.4/x86_64-linux-ghcup-0.1.4|]
|
||||
Nothing
|
||||
"cfdb01dde77121859b5d90b6707238b54e23787fcbb3003e18ab52a5dbfee330"
|
||||
"78d69ed4c9a810a445af89ea25e4217a632799ecb427b06cd2320ffb574f555e"
|
||||
|
||||
|
||||
ghcup_015_64_freebsd :: DownloadInfo
|
||||
ghcup_015_64_freebsd = DownloadInfo
|
||||
[uri|https://downloads.haskell.org/~ghcup/0.1.5/x86_64-portbld-freebsd-ghcup-0.1.5|]
|
||||
ghcup_014_64_freebsd :: DownloadInfo
|
||||
ghcup_014_64_freebsd = DownloadInfo
|
||||
[uri|https://downloads.haskell.org/~ghcup/0.1.4/x86_64-portbld-freebsd-ghcup-0.1.4|]
|
||||
Nothing
|
||||
"6dd57cc5958ef3a6ba7de22808d9292d31dada8af95277578b69be35fc090194"
|
||||
"cda0b959f053abc04ab0a1b9919a505b8c9304e2898a291f527a370cb0e00731"
|
||||
|
||||
|
||||
ghcup_015_64_darwin10_13 :: DownloadInfo
|
||||
ghcup_015_64_darwin10_13 = DownloadInfo
|
||||
[uri|https://downloads.haskell.org/~ghcup/0.1.5/x86_64-apple-darwin-ghcup-0.1.5|]
|
||||
ghcup_014_64_darwin10_13 :: DownloadInfo
|
||||
ghcup_014_64_darwin10_13 = DownloadInfo
|
||||
[uri|https://downloads.haskell.org/~ghcup/0.1.4/x86_64-apple-darwin-ghcup-0.1.4|]
|
||||
Nothing
|
||||
"5be3324b65c737af942cc5ed1a025d4882f29c1efcc7dcd971a893efab78d394"
|
||||
"2422b79933ae037237ccb8f836417b90b3111d7931beb7ae8b9e33a1945c641e"
|
||||
|
||||
|
||||
|
||||
@@ -1064,7 +1064,7 @@ ghcupDownloads = M.fromList
|
||||
, VersionInfo
|
||||
[Base [pver|4.8.2.0|]]
|
||||
(Just
|
||||
[uri|https://downloads.haskell.org/~ghc/7.10.3/docs/html/users_guide/release-7-10-1.html|]
|
||||
[uri|https://downloads.haskell.org/ghc/7.10.3/docs/html/users_guide/release-7-10-1.html|]
|
||||
)
|
||||
(Just $ DownloadInfo
|
||||
[uri|https://downloads.haskell.org/~ghc/7.10.3/ghc-7.10.3-src.tar.xz|]
|
||||
@@ -1110,7 +1110,7 @@ ghcupDownloads = M.fromList
|
||||
, VersionInfo
|
||||
[Base [pver|4.9.1.0|]]
|
||||
(Just
|
||||
[uri|https://downloads.haskell.org/~ghc/8.0.2/docs/html/users_guide/8.0.1-notes.html|]
|
||||
[uri|https://downloads.haskell.org/ghc/8.0.2/docs/html/users_guide/8.0.1-notes.html|]
|
||||
)
|
||||
(Just $ DownloadInfo
|
||||
[uri|https://downloads.haskell.org/~ghc/8.0.2/ghc-8.0.2-src.tar.xz|]
|
||||
@@ -1156,7 +1156,7 @@ ghcupDownloads = M.fromList
|
||||
, VersionInfo
|
||||
[Base [pver|4.10.1.0|]]
|
||||
(Just
|
||||
[uri|https://downloads.haskell.org/~ghc/8.2.2/docs/html/users_guide/8.2.2-notes.html|]
|
||||
[uri|https://downloads.haskell.org/ghc/8.2.2/docs/html/users_guide/8.2.2-notes.html|]
|
||||
)
|
||||
(Just $ DownloadInfo
|
||||
[uri|https://downloads.haskell.org/~ghc/8.2.2/ghc-8.2.2-src.tar.xz|]
|
||||
@@ -1208,7 +1208,7 @@ ghcupDownloads = M.fromList
|
||||
, VersionInfo
|
||||
[Base [pver|4.11.0.0|]]
|
||||
(Just
|
||||
[uri|https://downloads.haskell.org/~ghc/8.4.1/docs/html/users_guide/8.4.1-notes.html|]
|
||||
[uri|https://downloads.haskell.org/ghc/8.4.1/docs/html/users_guide/8.4.1-notes.html|]
|
||||
)
|
||||
(Just $ DownloadInfo
|
||||
[uri|https://downloads.haskell.org/~ghc/8.4.1/ghc-8.4.1-src.tar.xz|]
|
||||
@@ -1247,7 +1247,7 @@ ghcupDownloads = M.fromList
|
||||
, VersionInfo
|
||||
[Base [pver|4.11.1.0|]]
|
||||
(Just
|
||||
[uri|https://downloads.haskell.org/~ghc/8.4.2/docs/html/users_guide/8.4.2-notes.html|]
|
||||
[uri|https://downloads.haskell.org/ghc/8.4.2/docs/html/users_guide/8.4.2-notes.html|]
|
||||
)
|
||||
(Just $ DownloadInfo
|
||||
[uri|https://downloads.haskell.org/~ghc/8.4.2/ghc-8.4.2-src.tar.xz|]
|
||||
@@ -1297,7 +1297,7 @@ ghcupDownloads = M.fromList
|
||||
, VersionInfo
|
||||
[Base [pver|4.11.1.0|]]
|
||||
(Just
|
||||
[uri|https://downloads.haskell.org/~ghc/8.4.3/docs/html/users_guide/8.4.3-notes.html|]
|
||||
[uri|https://downloads.haskell.org/ghc/8.4.3/docs/html/users_guide/8.4.3-notes.html|]
|
||||
)
|
||||
(Just $ DownloadInfo
|
||||
[uri|https://downloads.haskell.org/~ghc/8.4.3/ghc-8.4.3-src.tar.xz|]
|
||||
@@ -1346,7 +1346,7 @@ ghcupDownloads = M.fromList
|
||||
, VersionInfo
|
||||
[Base [pver|4.11.1.0|]]
|
||||
(Just
|
||||
[uri|https://downloads.haskell.org/~ghc/8.4.4/docs/html/users_guide/8.4.4-notes.html|]
|
||||
[uri|https://downloads.haskell.org/ghc/8.4.4/docs/html/users_guide/8.4.4-notes.html|]
|
||||
)
|
||||
(Just $ DownloadInfo
|
||||
[uri|https://downloads.haskell.org/~ghc/8.4.4/ghc-8.4.4-src.tar.xz|]
|
||||
@@ -1400,7 +1400,7 @@ ghcupDownloads = M.fromList
|
||||
, VersionInfo
|
||||
[Base [pver|4.12.0.0|]]
|
||||
(Just
|
||||
[uri|https://downloads.haskell.org/~ghc/8.6.1/docs/html/users_guide/8.6.1-notes.html|]
|
||||
[uri|https://downloads.haskell.org/ghc/8.6.1/docs/html/users_guide/8.6.1-notes.html|]
|
||||
)
|
||||
(Just $ DownloadInfo
|
||||
[uri|https://downloads.haskell.org/~ghc/8.6.1/ghc-8.6.1-src.tar.xz|]
|
||||
@@ -1450,7 +1450,7 @@ ghcupDownloads = M.fromList
|
||||
, VersionInfo
|
||||
[Base [pver|4.12.0.0|]]
|
||||
(Just
|
||||
[uri|https://downloads.haskell.org/~ghc/8.6.2/docs/html/users_guide/8.6.2-notes.html|]
|
||||
[uri|https://downloads.haskell.org/ghc/8.6.2/docs/html/users_guide/8.6.2-notes.html|]
|
||||
)
|
||||
(Just $ DownloadInfo
|
||||
[uri|https://downloads.haskell.org/~ghc/8.6.2/ghc-8.6.2-src.tar.xz|]
|
||||
@@ -1494,7 +1494,7 @@ ghcupDownloads = M.fromList
|
||||
, VersionInfo
|
||||
[Base [pver|4.12.0.0|]]
|
||||
(Just
|
||||
[uri|https://downloads.haskell.org/~ghc/8.6.3/docs/html/users_guide/8.6.3-notes.html|]
|
||||
[uri|https://downloads.haskell.org/ghc/8.6.3/docs/html/users_guide/8.6.3-notes.html|]
|
||||
)
|
||||
(Just $ DownloadInfo
|
||||
[uri|https://downloads.haskell.org/~ghc/8.6.3/ghc-8.6.3-src.tar.xz|]
|
||||
@@ -1548,7 +1548,7 @@ ghcupDownloads = M.fromList
|
||||
, VersionInfo
|
||||
[Base [pver|4.12.0.0|]]
|
||||
(Just
|
||||
[uri|https://downloads.haskell.org/~ghc/8.6.4/docs/html/users_guide/8.6.4-notes.html|]
|
||||
[uri|https://downloads.haskell.org/ghc/8.6.4/docs/html/users_guide/8.6.4-notes.html|]
|
||||
)
|
||||
(Just $ DownloadInfo
|
||||
[uri|https://downloads.haskell.org/~ghc/8.6.4/ghc-8.6.4-src.tar.xz|]
|
||||
@@ -1597,7 +1597,7 @@ ghcupDownloads = M.fromList
|
||||
, VersionInfo
|
||||
[Base [pver|4.12.0.0|]]
|
||||
(Just
|
||||
[uri|https://downloads.haskell.org/~ghc/8.6.5/docs/html/users_guide/8.6.5-notes.html|]
|
||||
[uri|https://downloads.haskell.org/ghc/8.6.5/docs/html/users_guide/8.6.5-notes.html|]
|
||||
)
|
||||
(Just $ DownloadInfo
|
||||
[uri|https://downloads.haskell.org/~ghc/8.6.5/ghc-8.6.5-src.tar.xz|]
|
||||
@@ -1650,7 +1650,7 @@ ghcupDownloads = M.fromList
|
||||
, VersionInfo
|
||||
[Base [pver|4.13.0.0|]]
|
||||
(Just
|
||||
[uri|https://downloads.haskell.org/~ghc/8.8.1/docs/html/users_guide/8.8.1-notes.html|]
|
||||
[uri|https://downloads.haskell.org/ghc/8.8.1/docs/html/users_guide/8.8.1-notes.html|]
|
||||
)
|
||||
(Just $ DownloadInfo
|
||||
[uri|https://downloads.haskell.org/~ghc/8.8.1/ghc-8.8.1-src.tar.xz|]
|
||||
@@ -1703,7 +1703,7 @@ ghcupDownloads = M.fromList
|
||||
, VersionInfo
|
||||
[Base [pver|4.13.0.0|]]
|
||||
(Just
|
||||
[uri|https://downloads.haskell.org/~ghc/8.8.2/docs/html/users_guide/8.8.2-notes.html|]
|
||||
[uri|https://downloads.haskell.org/ghc/8.8.2/docs/html/users_guide/8.8.2-notes.html|]
|
||||
)
|
||||
(Just $ DownloadInfo
|
||||
[uri|https://downloads.haskell.org/~ghc/8.8.2/ghc-8.8.2-src.tar.xz|]
|
||||
@@ -1756,7 +1756,7 @@ ghcupDownloads = M.fromList
|
||||
, VersionInfo
|
||||
[Recommended, Base [pver|4.13.0.0|]]
|
||||
(Just
|
||||
[uri|https://downloads.haskell.org/~ghc/8.8.3/docs/html/users_guide/8.8.3-notes.html|]
|
||||
[uri|https://downloads.haskell.org/ghc/8.8.3/docs/html/users_guide/8.8.3-notes.html|]
|
||||
)
|
||||
(Just $ DownloadInfo
|
||||
[uri|https://downloads.haskell.org/~ghc/8.8.3/ghc-8.8.3-src.tar.xz|]
|
||||
@@ -1809,7 +1809,7 @@ ghcupDownloads = M.fromList
|
||||
, VersionInfo
|
||||
[Latest, Base [pver|4.14.0.0|]]
|
||||
(Just
|
||||
[uri|https://downloads.haskell.org/~ghc/8.10.1/docs/html/users_guide/8.10.1-notes.html|]
|
||||
[uri|https://downloads.haskell.org/ghc/8.10.1/docs/html/users_guide/8.10.1-notes.html|]
|
||||
)
|
||||
(Just $ DownloadInfo
|
||||
[uri|https://downloads.haskell.org/~ghc/8.10.1/ghc-8.10.1-src.tar.xz|]
|
||||
@@ -1976,7 +1976,7 @@ ghcupDownloads = M.fromList
|
||||
)
|
||||
, ( GHCup
|
||||
, M.fromList
|
||||
[ ( [vver|0.1.5|]
|
||||
[ ( [vver|0.1.4|]
|
||||
, VersionInfo
|
||||
[Recommended, Latest]
|
||||
(Just
|
||||
@@ -1987,16 +1987,16 @@ ghcupDownloads = M.fromList
|
||||
[ ( A_64
|
||||
, M.fromList
|
||||
[ ( Linux UnknownLinux
|
||||
, M.fromList [(Nothing, ghcup_015_64_linux)]
|
||||
, M.fromList [(Nothing, ghcup_014_64_linux)]
|
||||
)
|
||||
, (Darwin , M.fromList [(Nothing, ghcup_015_64_darwin10_13)])
|
||||
, (FreeBSD, M.fromList [(Nothing, ghcup_015_64_freebsd)])
|
||||
, (Darwin , M.fromList [(Nothing, ghcup_014_64_darwin10_13)])
|
||||
, (FreeBSD, M.fromList [(Nothing, ghcup_014_64_freebsd)])
|
||||
]
|
||||
)
|
||||
, ( A_32
|
||||
, M.fromList
|
||||
[ ( Linux UnknownLinux
|
||||
, M.fromList [(Nothing, ghcup_015_32_linux)]
|
||||
, M.fromList [(Nothing, ghcup_014_32_linux)]
|
||||
)
|
||||
]
|
||||
)
|
||||
|
||||
@@ -5,7 +5,6 @@ module GHCup.Data.ToolRequirements where
|
||||
|
||||
import GHCup.Types
|
||||
import GHCup.Utils.String.QQ
|
||||
import GHCup.Utils.Version.QQ
|
||||
|
||||
import qualified Data.Map as M
|
||||
|
||||
@@ -62,37 +61,6 @@ toolRequirements = M.fromList
|
||||
)
|
||||
]
|
||||
)
|
||||
, ( Linux CentOS
|
||||
, M.fromList
|
||||
[ ( Nothing
|
||||
, Requirements
|
||||
[ "gcc"
|
||||
, "gcc-c++"
|
||||
, "gmp"
|
||||
, "gmp-devel"
|
||||
, "make"
|
||||
, "ncurses"
|
||||
, "ncurses-compat-libs"
|
||||
, "xz"
|
||||
, "perl"
|
||||
]
|
||||
""
|
||||
),
|
||||
( Just [vers|7|]
|
||||
, Requirements
|
||||
[ "gcc"
|
||||
, "gcc-c++"
|
||||
, "gmp"
|
||||
, "gmp-devel"
|
||||
, "make"
|
||||
, "ncurses"
|
||||
, "xz"
|
||||
, "perl"
|
||||
]
|
||||
""
|
||||
)
|
||||
]
|
||||
)
|
||||
, ( Darwin
|
||||
, M.fromList
|
||||
[ ( Nothing
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
module GHCup.Download where
|
||||
|
||||
#if defined(INTERNAL_DOWNLOADER)
|
||||
#if !defined(CURL)
|
||||
import GHCup.Download.IOStreams
|
||||
import GHCup.Download.Utils
|
||||
#endif
|
||||
@@ -35,19 +35,18 @@ import Control.Monad.Reader
|
||||
import Control.Monad.Trans.Resource
|
||||
hiding ( throwM )
|
||||
import Data.Aeson
|
||||
#if !defined(CURL)
|
||||
import Data.ByteString ( ByteString )
|
||||
#if defined(INTERNAL_DOWNLOADER)
|
||||
import Data.CaseInsensitive ( CI )
|
||||
#endif
|
||||
import Data.Maybe
|
||||
import Data.String.Interpolate
|
||||
import Data.Time.Clock
|
||||
import Data.Time.Clock.POSIX
|
||||
#if defined(INTERNAL_DOWNLOADER)
|
||||
#if !defined(CURL)
|
||||
import Data.Time.Format
|
||||
#endif
|
||||
import Data.Versions
|
||||
import Data.Word8
|
||||
import GHC.IO.Exception
|
||||
import HPath
|
||||
import HPath.IO as HIO
|
||||
@@ -58,14 +57,12 @@ import Prelude hiding ( abs
|
||||
, writeFile
|
||||
)
|
||||
import System.IO.Error
|
||||
import System.Posix.Env.ByteString ( getEnv )
|
||||
import URI.ByteString
|
||||
|
||||
import qualified Crypto.Hash.SHA256 as SHA256
|
||||
import qualified Data.ByteString as BS
|
||||
import qualified Data.ByteString.Base16 as B16
|
||||
import qualified Data.ByteString.Lazy as L
|
||||
#if defined(INTERNAL_DOWNLOADER)
|
||||
#if !defined(CURL)
|
||||
import qualified Data.CaseInsensitive as CI
|
||||
import qualified Data.Map.Strict as M
|
||||
import qualified Data.Text as T
|
||||
@@ -85,48 +82,6 @@ import qualified System.Posix.RawFilePath.Directory
|
||||
------------------
|
||||
|
||||
|
||||
-- | Like 'getDownloads', but tries to fall back to
|
||||
-- cached ~/.ghcup/cache/ghcup-<format-ver>.json
|
||||
getDownloadsF :: ( FromJSONKey Tool
|
||||
, FromJSONKey Version
|
||||
, FromJSON VersionInfo
|
||||
, MonadIO m
|
||||
, MonadCatch m
|
||||
, MonadLogger m
|
||||
, MonadThrow m
|
||||
, MonadFail m
|
||||
, MonadReader Settings m
|
||||
)
|
||||
=> URLSource
|
||||
-> Excepts
|
||||
'[JSONError , DownloadFailed , FileDoesNotExistError]
|
||||
m
|
||||
GHCupInfo
|
||||
getDownloadsF urlSource = do
|
||||
case urlSource of
|
||||
GHCupURL ->
|
||||
liftE
|
||||
$ handleIO (\_ -> readFromCache)
|
||||
$ catchE @_ @'[JSONError , FileDoesNotExistError]
|
||||
(\(DownloadFailed _) -> readFromCache)
|
||||
$ getDownloads urlSource
|
||||
(OwnSource _) -> liftE $ getDownloads urlSource
|
||||
(OwnSpec _) -> liftE $ getDownloads urlSource
|
||||
where
|
||||
readFromCache = do
|
||||
lift $ $(logWarn)
|
||||
[i|Could not get download info, trying cached version (this may not be recent!)|]
|
||||
let path = view pathL' ghcupURL
|
||||
cacheDir <- liftIO $ ghcupCacheDir
|
||||
json_file <- (cacheDir </>) <$> urlBaseName path
|
||||
bs <-
|
||||
handleIO' NoSuchThing
|
||||
(\_ -> throwE $ FileDoesNotExistError (toFilePath json_file))
|
||||
$ liftIO
|
||||
$ readFile json_file
|
||||
lE' JSONDecodeError $ eitherDecode' bs
|
||||
|
||||
|
||||
-- | Downloads the download information! But only if we need to ;P
|
||||
getDownloads :: ( FromJSONKey Tool
|
||||
, FromJSONKey Version
|
||||
@@ -136,7 +91,6 @@ getDownloads :: ( FromJSONKey Tool
|
||||
, MonadLogger m
|
||||
, MonadThrow m
|
||||
, MonadFail m
|
||||
, MonadReader Settings m
|
||||
)
|
||||
=> URLSource
|
||||
-> Excepts '[JSONError , DownloadFailed] m GHCupInfo
|
||||
@@ -162,12 +116,7 @@ getDownloads urlSource = do
|
||||
--
|
||||
-- Always save the local file with the mod time of the remote file.
|
||||
smartDl :: forall m1
|
||||
. ( MonadCatch m1
|
||||
, MonadIO m1
|
||||
, MonadFail m1
|
||||
, MonadLogger m1
|
||||
, MonadReader Settings m1
|
||||
)
|
||||
. (MonadCatch m1, MonadIO m1, MonadFail m1, MonadLogger m1)
|
||||
=> URI
|
||||
-> Excepts
|
||||
'[ FileDoesNotExistError
|
||||
@@ -199,38 +148,31 @@ getDownloads urlSource = do
|
||||
Just modTime -> do
|
||||
fileMod <- liftIO $ getModificationTime json_file
|
||||
if modTime > fileMod
|
||||
then dlWithMod modTime json_file
|
||||
then do
|
||||
bs <- liftE $ downloadBS uri'
|
||||
liftIO $ writeFileWithModTime modTime json_file bs
|
||||
pure bs
|
||||
else liftIO $ readFile json_file
|
||||
Nothing -> do
|
||||
lift $ $(logDebug) [i|Unable to get/parse Last-Modified header|]
|
||||
dlWithoutMod json_file
|
||||
liftIO $ deleteFile json_file
|
||||
liftE $ downloadBS uri'
|
||||
else -- access in less than 5 minutes, re-use file
|
||||
liftIO $ readFile json_file
|
||||
else do
|
||||
liftIO $ createDirIfMissing newDirPerms cacheDir
|
||||
getModTime >>= \case
|
||||
Just modTime -> dlWithMod modTime json_file
|
||||
Just modTime -> do
|
||||
bs <- liftE $ downloadBS uri'
|
||||
liftIO $ writeFileWithModTime modTime json_file bs
|
||||
pure bs
|
||||
Nothing -> do
|
||||
-- although we don't know last-modified, we still save
|
||||
-- it to a file, so we might use it in offline mode
|
||||
lift $ $(logDebug) [i|Unable to get/parse Last-Modified header|]
|
||||
dlWithoutMod json_file
|
||||
liftE $ downloadBS uri'
|
||||
|
||||
where
|
||||
dlWithMod modTime json_file = do
|
||||
bs <- liftE $ downloadBS uri'
|
||||
liftIO $ writeFileWithModTime modTime json_file bs
|
||||
pure bs
|
||||
dlWithoutMod json_file = do
|
||||
bs <- liftE $ downloadBS uri'
|
||||
liftIO $ hideError doesNotExistErrorType $ deleteFile json_file
|
||||
liftIO $ writeFileL json_file (Just newFilePerms) bs
|
||||
liftIO $ setModificationTime json_file (fromIntegral @Int 0)
|
||||
pure bs
|
||||
|
||||
|
||||
getModTime = do
|
||||
#if !defined(INTERNAL_DOWNLOADER)
|
||||
#if defined(CURL)
|
||||
pure Nothing
|
||||
#else
|
||||
headers <-
|
||||
@@ -329,19 +271,12 @@ download dli dest mfn
|
||||
(liftIO $ hideError doesNotExistErrorType $ deleteFile destFile)
|
||||
>> (throwE . DownloadFailed $ e)
|
||||
) $ do
|
||||
lift getDownloader >>= \case
|
||||
Curl -> do
|
||||
o' <- liftIO getCurlOpts
|
||||
liftE $ lEM @_ @'[ProcessError] $ liftIO $ exec "curl" True
|
||||
(o' ++ ["-fL", "-o", toFilePath destFile, serializeURIRef' $ view dlUri dli]) Nothing Nothing
|
||||
Wget -> do
|
||||
o' <- liftIO getWgetOpts
|
||||
liftE $ lEM @_ @'[ProcessError] $ liftIO $ exec "wget" True
|
||||
(o' ++ ["-O", toFilePath destFile , serializeURIRef' $ view dlUri dli]) Nothing Nothing
|
||||
#if defined(INTERNAL_DOWNLOADER)
|
||||
Internal -> do
|
||||
(https, host, fullPath, port) <- liftE $ uriToQuadruple (view dlUri dli)
|
||||
liftE $ downloadToFile https host fullPath port destFile
|
||||
#if defined(CURL)
|
||||
liftE $ lEM @_ @'[ProcessError] $ liftIO $ exec "curl" True
|
||||
["-fL", "-o", toFilePath destFile , serializeURIRef' $ view dlUri dli] Nothing Nothing
|
||||
#else
|
||||
(https, host, fullPath, port) <- liftE $ uriToQuadruple (view dlUri dli)
|
||||
liftE $ downloadToFile https host fullPath port destFile
|
||||
#endif
|
||||
|
||||
liftE $ checkDigest dli destFile
|
||||
@@ -394,7 +329,7 @@ downloadCached dli mfn = do
|
||||
|
||||
|
||||
-- | This is used for downloading the JSON.
|
||||
downloadBS :: (MonadReader Settings m, MonadCatch m, MonadIO m, MonadLogger m)
|
||||
downloadBS :: (MonadCatch m, MonadIO m)
|
||||
=> URI
|
||||
-> Excepts
|
||||
'[ FileDoesNotExistError
|
||||
@@ -421,33 +356,18 @@ downloadBS uri'
|
||||
where
|
||||
scheme = view (uriSchemeL' % schemeBSL') uri'
|
||||
path = view pathL' uri'
|
||||
#if defined(INTERNAL_DOWNLOADER)
|
||||
dl https = do
|
||||
#else
|
||||
#if defined(CURL)
|
||||
dl _ = do
|
||||
#endif
|
||||
lift $ $(logDebug) [i|downloading: #{serializeURIRef' uri'}|]
|
||||
lift getDownloader >>= \case
|
||||
Curl -> do
|
||||
o' <- liftIO getCurlOpts
|
||||
let exe = [rel|curl|]
|
||||
args = o' ++ ["-sSfL", serializeURIRef' uri']
|
||||
liftIO (executeOut exe args Nothing) >>= \case
|
||||
CapturedProcess ExitSuccess stdout _ -> do
|
||||
pure $ L.fromStrict stdout
|
||||
CapturedProcess (ExitFailure i') _ _ -> throwE $ NonZeroExit i' (toFilePath exe) args
|
||||
Wget -> do
|
||||
o' <- liftIO getWgetOpts
|
||||
let exe = [rel|wget|]
|
||||
args = o' ++ ["-qO-", serializeURIRef' uri']
|
||||
liftIO (executeOut exe args Nothing) >>= \case
|
||||
CapturedProcess ExitSuccess stdout _ -> do
|
||||
pure $ L.fromStrict stdout
|
||||
CapturedProcess (ExitFailure i') _ _ -> throwE $ NonZeroExit i' (toFilePath exe) args
|
||||
#if defined(INTERNAL_DOWNLOADER)
|
||||
Internal -> do
|
||||
(_, host', fullPath', port') <- liftE $ uriToQuadruple uri'
|
||||
liftE $ downloadBS' https host' fullPath' port'
|
||||
let exe = [rel|curl|]
|
||||
args = ["-sSfL", serializeURIRef' uri']
|
||||
liftIO (executeOut exe args Nothing) >>= \case
|
||||
CapturedProcess ExitSuccess stdout _ -> do
|
||||
pure $ L.fromStrict stdout
|
||||
CapturedProcess (ExitFailure i') _ _ -> throwE $ NonZeroExit i' (toFilePath exe) args
|
||||
#else
|
||||
dl https = do
|
||||
(_, host', fullPath', port') <- liftE $ uriToQuadruple uri'
|
||||
liftE $ downloadBS' https host' fullPath' port'
|
||||
#endif
|
||||
|
||||
|
||||
@@ -465,19 +385,3 @@ checkDigest dli file = do
|
||||
let eDigest = view dlHash dli
|
||||
when ((cDigest /= eDigest) && verify) $ throwE (DigestError cDigest eDigest)
|
||||
|
||||
|
||||
-- | Get additional curl args from env. This is an undocumented option.
|
||||
getCurlOpts :: IO [ByteString]
|
||||
getCurlOpts =
|
||||
getEnv "GHCUP_CURL_OPTS" >>= \case
|
||||
Just r -> pure $ BS.split _space r
|
||||
Nothing -> pure []
|
||||
|
||||
|
||||
-- | Get additional wget args from env. This is an undocumented option.
|
||||
getWgetOpts :: IO [ByteString]
|
||||
getWgetOpts =
|
||||
getEnv "GHCUP_WGET_OPTS" >>= \case
|
||||
Just r -> pure $ BS.split _space r
|
||||
Nothing -> pure []
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
{-# LANGUAGE CPP #-}
|
||||
{-# LANGUAGE DeriveGeneric #-}
|
||||
{-# LANGUAGE OverloadedStrings #-}
|
||||
|
||||
@@ -142,10 +141,9 @@ data URLSource = GHCupURL
|
||||
|
||||
|
||||
data Settings = Settings
|
||||
{ cache :: Bool
|
||||
, noVerify :: Bool
|
||||
, keepDirs :: KeepDirs
|
||||
, downloader :: Downloader
|
||||
{ cache :: Bool
|
||||
, noVerify :: Bool
|
||||
, keepDirs :: KeepDirs
|
||||
}
|
||||
deriving Show
|
||||
|
||||
@@ -155,12 +153,6 @@ data KeepDirs = Always
|
||||
| Never
|
||||
deriving (Eq, Show, Ord)
|
||||
|
||||
data Downloader = Curl
|
||||
| Wget
|
||||
#if defined(INTERNAL_DOWNLOADER)
|
||||
| Internal
|
||||
#endif
|
||||
deriving (Eq, Show, Ord)
|
||||
|
||||
data DebugInfo = DebugInfo
|
||||
{ diBaseDir :: Path Abs
|
||||
|
||||
@@ -174,7 +174,6 @@ ghcSet mtarget = do
|
||||
ghcBin <- (</> ghc) <$> liftIO ghcupBinDir
|
||||
|
||||
-- link destination is of the form ../ghc/<ver>/bin/ghc
|
||||
-- for old ghcup, it is ../ghc/<ver>/bin/ghc-<ver>
|
||||
liftIO $ handleIO' NoSuchThing (\_ -> pure $ Nothing) $ do
|
||||
link <- readSymbolicLink $ toFilePath ghcBin
|
||||
Just <$> ghcLinkVersion link
|
||||
@@ -194,8 +193,8 @@ ghcSet mtarget = do
|
||||
MP.setInput rest
|
||||
pure x
|
||||
)
|
||||
<* MP.chunk "/"
|
||||
<* MP.takeRest
|
||||
<* MP.chunk "/bin/"
|
||||
<* ghcTargetBinP "ghc"
|
||||
<* MP.eof
|
||||
|
||||
|
||||
@@ -350,10 +349,6 @@ getCache :: MonadReader Settings m => m Bool
|
||||
getCache = ask <&> cache
|
||||
|
||||
|
||||
getDownloader :: MonadReader Settings m => m Downloader
|
||||
getDownloader = ask <&> downloader
|
||||
|
||||
|
||||
|
||||
-------------
|
||||
--[ Other ]--
|
||||
|
||||
@@ -16,7 +16,7 @@ ghcupURL :: URI
|
||||
ghcupURL = [uri|https://www.haskell.org/ghcup/data/ghcup-0.0.2.json|]
|
||||
|
||||
ghcUpVer :: PVP
|
||||
ghcUpVer = [pver|0.1.5|]
|
||||
ghcUpVer = [pver|0.1.4|]
|
||||
|
||||
numericVer :: String
|
||||
numericVer = T.unpack . prettyPVP $ ghcUpVer
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
function _ghcup
|
||||
set -l cl (commandline --tokenize --current-process)
|
||||
# Hack around fish issue #3934
|
||||
set -l cn (commandline --tokenize --cut-at-cursor --current-process)
|
||||
set -l cn (count $cn)
|
||||
set -l tmpline --bash-completion-enriched --bash-completion-index $cn
|
||||
for arg in $cl
|
||||
set tmpline $tmpline --bash-completion-word $arg
|
||||
end
|
||||
for opt in (ghcup $tmpline)
|
||||
if test -d $opt
|
||||
echo -E "$opt/"
|
||||
else
|
||||
echo -E "$opt"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
complete --no-files --command ghcup --arguments '(_ghcup)'
|
||||
@@ -1,32 +0,0 @@
|
||||
#compdef ghcup
|
||||
|
||||
local request
|
||||
local completions
|
||||
local word
|
||||
local index=$((CURRENT - 1))
|
||||
|
||||
request=(--bash-completion-enriched --bash-completion-index $index)
|
||||
for arg in ${words[@]}; do
|
||||
request=(${request[@]} --bash-completion-word $arg)
|
||||
done
|
||||
|
||||
IFS=$'\n' completions=($( ghcup "${request[@]}" ))
|
||||
|
||||
for word in $completions; do
|
||||
local -a parts
|
||||
|
||||
# Split the line at a tab if there is one.
|
||||
IFS=$'\t' parts=($( echo $word ))
|
||||
|
||||
if [[ -n $parts[2] ]]; then
|
||||
if [[ $word[1] == "-" ]]; then
|
||||
local desc=("$parts[1] ($parts[2])")
|
||||
compadd -d desc -- $parts[1]
|
||||
else
|
||||
local desc=($(print -f "%-019s -- %s" $parts[1] $parts[2]))
|
||||
compadd -l -d desc -- $parts[1]
|
||||
fi
|
||||
else
|
||||
compadd -f -- $word
|
||||
fi
|
||||
done
|
||||
66
update-index-state.sh
Executable file
66
update-index-state.sh
Executable file
@@ -0,0 +1,66 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -eu
|
||||
|
||||
status_message() {
|
||||
printf "\\033[0;32m%s\\033[0m\\n" "$1"
|
||||
}
|
||||
|
||||
error_message() {
|
||||
printf "\\033[0;31m%s\\033[0m\\n" "$1"
|
||||
}
|
||||
|
||||
SCRIPTPATH="$( cd "$(dirname "$0")" ; pwd -P )"
|
||||
CACHE_LOCATION="${HOME}/.cabal/packages/hackage.haskell.org/01-index.cache"
|
||||
|
||||
if [ ! -f "${CACHE_LOCATION}" ] ; then
|
||||
error_message "${CACHE_LOCATION} does not exist, did you run 'cabal update'?"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ ! -f "${SCRIPTPATH}/cabal.project" ] ; then
|
||||
error_message "Could not find ${SCRIPTPATH}/cabal.project, skipping index state update."
|
||||
exit 3
|
||||
fi
|
||||
|
||||
cabal v2-update
|
||||
|
||||
arch=$(getconf LONG_BIT)
|
||||
|
||||
case "${arch}" in
|
||||
32)
|
||||
byte_size=4
|
||||
magic_word="CABA1002"
|
||||
;;
|
||||
64)
|
||||
byte_size=8
|
||||
magic_word="00000000CABA1002"
|
||||
;;
|
||||
*)
|
||||
error_message "Unknown architecture (long bit): ${arch}"
|
||||
exit 2
|
||||
;;
|
||||
esac
|
||||
|
||||
# This is the logic to parse the binary format of 01-index.cache.
|
||||
# The first word is a magic 'caba1002', the second one is the timestamp in unix epoch.
|
||||
# Better than copying the cabal-install source code.
|
||||
if [ "$(xxd -u -p -l${byte_size} -s 0 "${CACHE_LOCATION}")" != "${magic_word}" ] ; then
|
||||
error_message "Magic word does not match!"
|
||||
exit 4
|
||||
fi
|
||||
cache_timestamp=$(echo "ibase=16;obase=A;$(xxd -u -p -l${byte_size} -s ${byte_size} "${CACHE_LOCATION}")" | bc)
|
||||
|
||||
# If we got junk from the binary file, this should fail.
|
||||
cache_date=$(date --utc --date "@${cache_timestamp}" "+%FT%TZ")
|
||||
|
||||
|
||||
status_message "Updating index state in ${SCRIPTPATH}/cabal.project"
|
||||
|
||||
if grep -q "^index-state: .*" "${SCRIPTPATH}/cabal.project" ; then
|
||||
awk '/index-state:/ {gsub(/.*/, "index-state: '${cache_date}'")}; { print }' "${SCRIPTPATH}/cabal.project" > "${SCRIPTPATH}/cabal.project.tmp"
|
||||
mv "${SCRIPTPATH}/cabal.project.tmp" "${SCRIPTPATH}/cabal.project"
|
||||
else
|
||||
printf "index-state: %s\n" "${cache_date}" >> "${SCRIPTPATH}/cabal.project"
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user