alexoundos / haskell-stack-mirror-script Goto Github PK
View Code? Open in Web Editor NEWBash script that downloads a full set of available stack and hackage resources ready to be mirrored offline.
License: GNU General Public License v3.0
Bash script that downloads a full set of available stack and hackage resources ready to be mirrored offline.
License: GNU General Public License v3.0
Would it suffice in many use cases to download only what's included in a single snapshot and/or only the latest versions of packages? I imagine that would significantly reduce the size of the mirror.
By the same token, including only specific packages (and their dependencies) or excluding specific packages might be useful, though perhaps less so for full offline functionality.
To get the script to extract the filenames from 01-index.tar.gz, I needed to modify the grep and sed regexes slightly: I'm not sure if this is because of a change in the index tarball format?
@@ -210,8 +210,8 @@ echo "======= producing list of packages urls to download ====================="
HACKAGE_MIRROR_ESC=$(echo $HACKAGE_MIRROR | sed -e 's/[\/&]/\\&/g')
tar --list -f "$MIRROR_DIR/$(basename $HACKAGE_INDEX)" \
- | egrep "(.*)/([[:digit:].]+)/$" \
- | sed "s/\(.*\)\/\(.*\)\/$/$HACKAGE_MIRROR_ESC\/\1-\2.tar.gz/" \
+ | egrep "(.*)/([[:digit:].]+)/" \
+ | sed "s/\(.*\)\/\(.*\)\/.*$/$HACKAGE_MIRROR_ESC\/\1-\2.tar.gz/" \
| sort -o download-packages-urls
if [ $? -ne 0 ]; then
echo "error getting list of packages urls to download"
"stack new" fails because of hard-coded urls for fetching templates.
You have to manually specify url/path to the desired template.
Related to stack issue: commercialhaskell/stack#2804
In order to run stack setup
you have to supply a path to "mirror/stack-setup-mirror.yaml" manually with --setup-info-yaml
option every time.
This is due to inability of stack to use setup-info:
field in "~/.stack/config.yaml" in a proper manner. See progress on these 2 issues related to improper treatment of it and possible fix: commercialhaskell/stack#2982 and commercialhaskell/stack#2983.
The idea is that setup-info:
field with a combination of urls:
and package-indices
in config.yaml file should be sufficient to perform any stack
command using this offline mirror.
It looks like Stack changed a bunch of stuff in version 2 that effects this project. So far they all seem to relate to the config.yaml
file:
package-indices
now requires hackage-security
(see here). I think a workaround for this could be:
package-indices:
- name: Hackage
download-prefix: $MIRROR_URL/packages/
http: $MIRROR_URL/01-index.tar.gz
hackage-security:
keyids: [""]
key-threshold: 0
lts-build-plans
and nightly-build-plans
are no longer supported. As far as I can tell, there's no alternative/workaround for this. It looks like one can workaround this on a per project basic though by specifying a snapshot location in stack.yaml
(see here). So adding a note about that to the readme might be helpful.A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.