GitMe SuperFetch
[git/jnareb-git.git] / share / GitMe / release.sh
blob15622b5cf7b6ffc66e00951805788ba33247f5a2
1 #!/bin/sh
3 # Recreate GitMe-$VERSION.exe
5 test -z "$1" && {
6 echo "Usage: $0 <version>"
7 exit 1
10 TARGET="$HOME"/GitMe-"$1".exe
11 TMPDIR=/tmp/installer-tmp
12 OPTS7="-m0=lzma -mx=9 -md=64M"
13 TMPPACK=/tmp.7z
14 SHARE=/share/GitMe
16 test ! -d "$TMPDIR" || rm -rf "$TMPDIR" || exit
17 mkdir "$TMPDIR" &&
18 cd "$TMPDIR" &&
19 (cd .. && test ! -f "$TMPPACK" || rm "$TMPPACK") &&
20 echo "Copying files" &&
21 cat "$SHARE"/fileList.txt | (cd / && tar -c --file=- --files-from=-) |
22 tar xvf - &&
23 cat "$SHARE"/fileList-mingw.txt |
24 (cd /mingw && tar -c --file=- --files-from=-) |
25 tar xvf - &&
26 strip bin/*.exe &&
27 mkdir etc &&
28 cp "$SHARE"/gitconfig etc/ &&
29 cp "$SHARE"/bootstrap.cmd ./ &&
30 cp "$SHARE"/bootstrap.sh ./ &&
31 echo "Creating archive" &&
32 cd .. &&
33 for file in "$TMPDIR/bin/"*; do
34 fixfile=`echo ${file} | sed -e "s,.*exe$,," -e "s,.*dll$,,"`
35 if [ -n "$fixfile" ]; then
36 echo Fixing interpreter line on file ${fixfile}
37 sed -e "s,^#!.*/bin/sh$,#!/bin/sh," ${fixfile} > ${fixfile}.tmp
38 mv ${fixfile}.tmp ${fixfile}
40 done &&
41 7z a $OPTS7 "$TMPPACK" installer-tmp &&
42 cat /mingw/bin/7zSD.sfx "$SHARE"/7z-install.txt "$TMPPACK" > "$TARGET" &&
43 echo Success! You\'ll find the new installer at $TARGET
44 rm $TMPPACK