diff options
| author | hisham <hisham@9ca3f7c1-7366-0410-b1a3-b5c78f85698c> | 2009-04-01 17:11:57 +0000 |
|---|---|---|
| committer | hisham <hisham@9ca3f7c1-7366-0410-b1a3-b5c78f85698c> | 2009-04-01 17:11:57 +0000 |
| commit | a88d6f2eeba2b3355c33fac6d736cf6086342f47 (patch) | |
| tree | 03ebfa0ced0186e091609cf337e290580fab8c11 /makedist | |
| download | luarocks-0.5.2.tar.gz luarocks-0.5.2.tar.bz2 luarocks-0.5.2.zip | |
Import latest revision from CVS at luaforge.netv1.0v0.5.2v0.5.1v0.5v0.4.3v0.4.2v0.4.1v0.4v0.3.2v0.3.1v0.3v0.2v0.1
git-svn-id: http://luarocks.org/svn/luarocks/trunk@1 9ca3f7c1-7366-0410-b1a3-b5c78f85698c
Diffstat (limited to 'makedist')
| -rwxr-xr-x | makedist | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/makedist b/makedist new file mode 100755 index 00000000..3e78040a --- /dev/null +++ b/makedist | |||
| @@ -0,0 +1,68 @@ | |||
| 1 | #!/bin/sh | ||
| 2 | |||
| 3 | cvslist() { | ||
| 4 | if [ "$1" ] | ||
| 5 | then local prefix="$1/" | ||
| 6 | fi | ||
| 7 | cvs list $1 | grep -v "^?" | while read line | ||
| 8 | do | ||
| 9 | local path="$prefix$line" | ||
| 10 | echo "$path" | ||
| 11 | if [ -d "$path" ] | ||
| 12 | then | ||
| 13 | cvslist "$path" | ||
| 14 | fi | ||
| 15 | done | ||
| 16 | } | ||
| 17 | |||
| 18 | if ! [ "$1" ] | ||
| 19 | then | ||
| 20 | echo "usage: $0 <version>" | ||
| 21 | exit 1 | ||
| 22 | fi | ||
| 23 | |||
| 24 | cvs list > /dev/null 2> /dev/null | ||
| 25 | if [ $? != 0 ] | ||
| 26 | then | ||
| 27 | echo "Your version of CVS may be too old. At least 1.12 is needed." | ||
| 28 | exit 1 | ||
| 29 | fi | ||
| 30 | |||
| 31 | make clean | ||
| 32 | |||
| 33 | out="luarocks-$1" | ||
| 34 | rm -rf "$out" | ||
| 35 | mkdir "$out" | ||
| 36 | list=`cvslist` | ||
| 37 | rm -f missing_ref | ||
| 38 | echo "$list" | while read i | ||
| 39 | do | ||
| 40 | if [ -f "$i" ] | ||
| 41 | then | ||
| 42 | dir=`dirname $i` | ||
| 43 | mkdir -p "$out/$dir" | ||
| 44 | cp "$i" "$out/$dir" | ||
| 45 | if echo "$i" | grep -q "^src/" | ||
| 46 | then | ||
| 47 | grep -qw `basename "$i"` Makefile || { | ||
| 48 | echo "Missing ref in makefile: $i" | ||
| 49 | touch missing_ref | ||
| 50 | exit 1 | ||
| 51 | } | ||
| 52 | fi | ||
| 53 | fi | ||
| 54 | done | ||
| 55 | if [ -e missing_ref ] | ||
| 56 | then | ||
| 57 | rm -f missing_ref | ||
| 58 | exit 1 | ||
| 59 | fi | ||
| 60 | rm -f "$out-win32.zip" "$out.tar.gz" | ||
| 61 | rm "$out/makedist" | ||
| 62 | rm "$out/install.bat" | ||
| 63 | tar czvpf "$out.tar.gz" "$out" | ||
| 64 | cp install.bat "$out" | ||
| 65 | cp -a win32/bin "$out" | ||
| 66 | cp -a win32/lua5.1 "$out" | ||
| 67 | zip -r "$out-win32.zip" "$out" | ||
| 68 | rm -rf "$out" | ||
