forked from datacharmer/mysql-sandbox
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mkdist.sh
executable file
·52 lines (43 loc) · 1.25 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
#!/bin/bash
if [ "$1" == "" ]
then
echo "VERSION required";
exit
fi
VERSION=$1
export YEAR=$(date +%Y)
perl -i.1bak -pe 'BEGIN{$y=shift;};s/(2006-)\d+ (Giuseppe Maxia)/$1$y $2/' $YEAR lib/MySQL/Sandbox.pm
perl -i.bak -pe 'BEGIN{$V=shift;};s/^(our \$VERSION=)([^;]+)/$1"$V"/' $VERSION lib/MySQL/Sandbox.pm
perl -i.bak -pe 'BEGIN{$V=shift;};s/^(our \$VERSION=)([^;]+)/$1"$V"/' $VERSION lib/MySQL/Sandbox/Scripts.pm
perl -i.bak -pe 'BEGIN{$V=shift;};s/^(our \$VERSION=)([^;]+)/$1"$V"/' $VERSION lib/MySQL/Sandbox/Recipes.pm
pod2markdown lib/MySQL/Sandbox.pm > README.md
#pod2html lib/MySQL/Sandbox.pm > ./drafts/sandbox.html
#pod2html lib/MySQL/Sandbox/Recipes.pm > ./drafts/cookbook.html
# perl Makefile.PL PREFIX=$HOME/usr/local
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
#mv *.gz ~/workdir/new_sandbox/dists/
fi
make clean
find . -name "*~" -exec rm {} \;
find . -name "*.bak" -exec rm {} \;
find . -name "*.1bak" -exec rm {} \;
rm -rf t/test_sb/
rm -f pod*.tmp