Overview
Comment: | Add bootstrap.sh |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
c86125c1d74dbbf26db9cf8837850284 |
User & Date: | js on 2024-08-18 16:43:19 |
Other Links: | manifest | tags |
Context
2024-08-18
| ||
16:43 | vim: Disable modelines check-in: 8982597fa0 user: js tags: trunk | |
16:43 | Add bootstrap.sh check-in: c86125c1d7 user: js tags: trunk | |
2024-03-31
| ||
20:57 | zshrc: Use $USER instead of $(whoami) check-in: c86690c591 user: js tags: trunk | |
Changes
Added bootstrap.sh version [67626c0d17].
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 | #!/bin/sh # # This script bootstraps the configs repo on a machine that has no Fossil # installed while verifying everything against embedded hashes. The idea is to # have a single script that needs to be copied to the target machine and then # bootstraps everything in a trusted way. # set -e fossil_version="2.24" fossil_sha512="7fc7de7d947b0946866df38c6cb2215f6452d31903cae6470bb4a692816b2803eb66ea372280256e5cd00759e4d02a0ae459de2f56f39af10e873579d53d33ee" config_checkin="c86690c5919cdcbfc31ec23b7438039a43211055fc883e6013c2c8dd18aee922" download_and_verify() { wget -O "$1" "$2" hash="$(openssl sha512 "$1" | cut -d' ' -f 2)" echo "Hash for $1:" echo " Expected: $3" echo " Got: $hash" if test x"$hash" = x"$3"; then echo "Hash matches!" else echo "Hash doesn't match!" exit 1 fi } download_and_verify "fossil-src-$fossil_version.tar.gz" "https://fossil-scm.org/home/tarball/version-$fossil_version/fossil-src-$fossil_version.tar.gz" "$fossil_sha512" gunzip -c "fossil-src-$fossil_version.tar.gz" | tar xf - cd "fossil-src-$fossil_version" ./configure --prefix="$HOME/.local" if which gmake >/dev/null 2>&1; then gmake gmake install else make make install fi cd .. rm -fr "fossil-src-$fossil_version" "fossil-src-$fossil_version.tar.gz" export PATH="$HOME/.local/bin:$PATH" mkdir -p "$HOME/Devel/configs" cd "$HOME/Devel/configs" fossil clone https://fl.nil.im/configs configs.fossil fossil open configs.fossil fossil up "$config_checkin" ./setup.sh cd "$HOME" echo "export PATH=\"\$HOME/.local/bin:\$PATH\"" >>.zshenv exec zsh -l |