/share/tcltk: add private .gitignore
[msysgit.git] / share / tcltk / release.sh
blob74b4a659e57a82a431aa688bf6e08f98cf59d442
1 #!/bin/sh
3 # This is the Tcl/Tk updating script for msysGit
6 # Make sure that the working directory is clean and does not have untracked
7 # files; otherwise our semi-automatic finding the new files will not work!
9 (cd / &&
10 git diff-files --quiet &&
11 git diff-index --cached --quiet HEAD &&
12 test -z "$(git ls-files --exclude-from=.gitignore \
13 --exclude-per-directory=.gitignore --others)") || {
14 echo "State not pristine enough for successful Tcl/Tk update"
15 exit 1
18 cd "$(dirname "$0")"
20 # Remove old Tcl/Tk files stored in fileList.txt
22 cat fileList.txt | (cd / && xargs git rm) || exit
24 mirror=http://kent.dl.sourceforge.net/sourceforge/tcl/
25 version=8.5b2
27 for p in tcl tk
29 # get the package
30 u=$mirror$p$version-src.tar.gz
31 b=$(basename $u)
32 test -f $b || curl $u > $b || exit
34 # unpack it
35 d=$p$version
36 test -d $d || tar xzvf $b || exit
38 # compile it
39 shortversion=$(echo $version |
40 sed -e "s/[ab][0-9][0-9]*$//" -e "s/[^0-9]//g")
41 case $p in
42 tcl) prog=tclsh$shortversion.exe;;
43 tk) prog=wish$shortversion.exe;;
44 esac
45 test -f $d/win/$prog || (
46 cd $d/win &&
47 ./configure --prefix=/mingw &&
48 make ||
49 exit
52 # install it
53 test -f /mingw/bin/$prog || (
54 cd $d/win &&
55 make install ||
56 exit
58 done
60 # update index
61 (cd / && git add .) || exit
63 git diff --cached --diff-filter=AM --name-only |
64 sed -e "s/^/\//" > fileList.txt ||
65 exit
67 git add fileList.txt || exit
69 echo "Successfully built and installed Tcl/Tk $version"
70 echo "After checking the result, please commit (possibly with --amend)"
71 echo