Retry only for https protocol
[elinks.git] / contrib / grafthistory.sh
blob3721400a773beb0e37f545a824cf290c3c5c3195
1 #!/bin/sh -e
3 # Graft the ELinks development history to the current tree.
5 # Note that this will download about 80M.
7 if [ -n "`which wget 2>/dev/null`" ]; then
8 downloader="wget -c"
9 elif [ -n "`which curl 2>/dev/null`" ]; then
10 downloader="curl -C - -O"
11 else
12 echo "Error: You need to have wget or curl installed so that I can fetch the history." >&2
13 exit 1
16 [ "$GIT_DIR" ] || GIT_DIR=.git
17 if ! [ -d "$GIT_DIR" ]; then
18 echo "Error: You must run this from the project root (or set GIT_DIR to your .git directory)." >&2
19 exit 1
21 cd "$GIT_DIR"
23 echo "[grafthistory] Downloading the history"
24 mkdir -p objects/pack
25 cd objects/pack
26 echo "ELinks history converted from CVS. Keep this pack separate to speed up git gc." \
27 > pack-0d6c5c67aab3b9d5d9b245da5929c15d79124a48.keep
28 # pack-0d6c5c67aab3b9d5d9b245da5929c15d79124a48.idx is 3163784 bytes long.
29 # Downloading it takes less than 6 seconds here, whereas generating it
30 # with git index-pack takes over 4 minutes (750 MHz Duron, git 1.5.4.1).
31 $downloader http://elinks.cz/elinks-history.git/objects/pack/pack-0d6c5c67aab3b9d5d9b245da5929c15d79124a48.idx
32 $downloader http://elinks.cz/elinks-history.git/objects/pack/pack-0d6c5c67aab3b9d5d9b245da5929c15d79124a48.pack
34 echo "[grafthistory] Setting up the grafts"
35 cd ../..
36 mkdir -p info
37 # master
38 echo 0f6d4310ad37550be3323fab80456e4953698bf0 06135dc2b8bb7ed2e441305bdaa82048396de633 >>info/grafts
39 # REL_0_10
40 echo 43a9a406737fd22a8558c47c74b4ad04d4c92a2b 730242dcf2cdeed13eae7e8b0c5f47bb03326792 >>info/grafts
42 echo "[grafthistory] Refreshing the dumb server info wrt. new packs"
43 cd ..
44 git update-server-info