This repository has been archived by the owner on Apr 9, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 57
/
mkdist.sh
executable file
·74 lines (63 loc) · 1.62 KB
/
mkdist.sh
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#!/bin/bash
if [ -z "$1" ]
then
echo "VERSION required";
exit
fi
export VERSION=$1
required_tools=(perl make pod2markdown)
for tool in ${required_tools[*]}
do
tool_exists=$(type -P "$tool")
if [ -z "$tool_exists" ]
then
echo "# $tool not found in PATH"
exit 1
fi
done
export YEAR=$(date +%Y)
TOOLS="deploy_to_remote_sandboxes.sh low_level_make_sandbox make_multiple_custom_sandbox"
TOOLS="$TOOLS make_multiple_sandbox make_replication_sandbox make_sandbox make_sandbox_from_installed"
TOOLS="$TOOLS make_sandbox_from_source msandbox msb sbtool test_sandbox"
LIBS="lib/MySQL/Sandbox.pm lib/MySQL/Sandbox/Scripts.pm lib/MySQL/Sandbox/Recipes.pm"
CHANGE_COPYRIGHT_YEAR='BEGIN{$y=shift;};s/(2006-)\d+(\s+)(Giuseppe\s+Maxia)/$1$y$2$3/'
CHANGE_VERSION='BEGIN{$V=shift;};s/^(our\s+\$VERSION=)([^;]+)/${1}q{$V}/'
#set -x
for TOOL in $TOOLS
do
perl -i.bak -pe $CHANGE_COPYRIGHT_YEAR $YEAR bin/$TOOL
done
for LIB in $LIBS
do
perl -i.bak -pe $CHANGE_VERSION $VERSION $LIB
perl -i.1bak -pe $CHANGE_COPYRIGHT_YEAR $YEAR $LIB
done
#set +x
pod2markdown lib/MySQL/Sandbox.pm > README.md
perl Makefile.PL PREFIX=$HOME/usr/local
make
make test
if [ "$?" != "0" ]
then
exit 1
fi
if [ "$2" == "install" ]
then
echo "DOING!!"
make install
echo "DONE!!"
else
if [ -f MySQL-Sandbox-$VERSION.tar.gz ]
then
echo "file MySQL-Sandbox-$VERSION.tar.gz already exists"
exit
fi
make dist
fi
make clean
find . -name "*~" -exec rm -f {} \;
find . -name "*.bak" -exec rm -f {} \;
find . -name "*.1bak" -exec rm -f {} \;
rm -rf t/test_sb/
rm -f pod*.tmp
rm -f Makefile.old