mirror of
https://github.com/MariaDB/server.git
synced 2025-01-20 14:02:32 +01:00
bb2d3eaa30
BitKeeper/etc/ignore: auto-union BitKeeper/etc/logging_ok: auto-union Build-tools/Do-compile: Auto merged VC++Files/sql/mysqld.dsp: Auto merged client/Makefile.am: Auto merged client/mysql.cc: Auto merged BitKeeper/deleted/.del-acinclude.m4~f4ab416bac5003: Auto merged client/mysqltest.c: Auto merged include/my_base.h: Auto merged innobase/dict/dict0dict.c: Auto merged innobase/dict/dict0load.c: Auto merged innobase/include/dict0dict.h: Auto merged innobase/include/row0mysql.h: Auto merged innobase/os/os0file.c: Auto merged innobase/srv/srv0srv.c: Auto merged libmysql/libmysql.c: Auto merged myisam/mi_check.c: Auto merged myisam/mi_rnext_same.c: Auto merged myisam/mi_write.c: Auto merged myisam/sort.c: Auto merged mysql-test/mysql-test-run.sh: Auto merged mysql-test/r/ctype_ucs.result: Auto merged mysql-test/r/ctype_ujis.result: Auto merged mysql-test/r/gis-rtree.result: Auto merged mysql-test/r/group_by.result: Auto merged mysql-test/r/merge.result: Auto merged mysql-test/r/metadata.result: Auto merged mysql-test/r/ndb_alter_table.result: Auto merged mysql-test/r/ps_1general.result: Auto merged mysql-test/r/insert_update.result: Auto merged mysql-test/r/timezone2.result: Auto merged mysql-test/r/type_enum.result: Auto merged mysql-test/r/variables.result: Auto merged mysql-test/t/ctype_ucs.test: Auto merged mysql-test/t/merge.test: Auto merged mysql-test/t/ps_1general.test: Auto merged mysql-test/t/subselect.test: Auto merged mysql-test/t/system_mysql_db_fix.test: Auto merged mysql-test/t/variables.test: Auto merged ndb/include/ndbapi/NdbConnection.hpp: Auto merged ndb/include/ndbapi/NdbDictionary.hpp: Auto merged ndb/src/common/util/version.c: Auto merged ndb/src/kernel/blocks/dbacc/DbaccInit.cpp: Auto merged ndb/src/kernel/blocks/dbacc/Makefile.am: Auto merged ndb/src/kernel/blocks/dbdict/Dbdict.cpp: Auto merged ndb/src/kernel/blocks/dbdih/DbdihMain.cpp: Auto merged ndb/src/kernel/blocks/dblqh/DblqhInit.cpp: Auto merged ndb/src/kernel/blocks/dbtc/DbtcMain.cpp: Auto merged ndb/src/kernel/blocks/dbtux/Dbtux.hpp: Auto merged ndb/src/ndbapi/NdbBlob.cpp: Auto merged ndb/src/ndbapi/NdbConnection.cpp: Auto merged ndb/src/ndbapi/NdbDictionary.cpp: Auto merged ndb/src/ndbapi/NdbDictionaryImpl.cpp: Auto merged ndb/src/ndbapi/NdbDictionaryImpl.hpp: Auto merged ndb/src/ndbapi/NdbOperationExec.cpp: Auto merged ndb/src/ndbapi/NdbScanOperation.cpp: Auto merged ndb/test/ndbapi/Makefile.am: Auto merged scripts/make_win_src_distribution.sh: Auto merged scripts/mysql_install_db.sh: Auto merged sql/field.cc: Auto merged sql/ha_innodb.cc: Auto merged sql/ha_ndbcluster.cc: Auto merged sql/ha_ndbcluster.h: Auto merged sql/handler.cc: Auto merged sql/item_cmpfunc.cc: Auto merged sql/item_create.h: Auto merged sql/item_func.cc: Auto merged sql/item_geofunc.cc: Auto merged sql/item_row.cc: Auto merged sql/item_strfunc.cc: Auto merged sql/item_strfunc.h: Auto merged sql/item_sum.cc: Auto merged sql/item_sum.h: Auto merged sql/log.cc: Auto merged sql/log_event.cc: Auto merged sql/mysqld.cc: Auto merged sql/net_serv.cc: Auto merged sql/password.c: Auto merged sql/protocol.cc: Auto merged sql/repl_failsafe.cc: Auto merged sql/set_var.cc: Auto merged sql/slave.cc: Auto merged sql/sql_acl.cc: Auto merged sql/sql_cache.cc: Auto merged sql/sql_class.cc: Auto merged sql/sql_derived.cc: Auto merged sql/sql_do.cc: Auto merged sql/sql_handler.cc: Auto merged sql/sql_help.cc: Auto merged sql/sql_lex.cc: Auto merged sql/sql_lex.h: Auto merged sql/sql_repl.cc: Auto merged sql/sql_show.cc: Auto merged sql/sql_union.cc: Auto merged sql/examples/ha_archive.cc: Auto merged sql/strfunc.cc: Auto merged sql/table.cc: Auto merged sql/table.h: Auto merged sql/tztime.h: Auto merged sql/udf_example.cc: Auto merged sql/unireg.cc: Auto merged Makefile.am: Simple merge client/mysqldump.c: Simple merge configure.in: Simple merge libmysqld/lib_sql.cc: Automatic merge mysql-test/r/func_str.result: Automatic merge mysql-test/r/grant.result: simple merge mysql-test/r/multi_update.result: automatc merge mysql-test/r/ps.result: automatic merge mysql-test/r/ps_2myisam.result: Automatic merge mysql-test/r/ps_3innodb.result: Automatic merge mysql-test/r/ps_4heap.result: Automatic merge mysql-test/r/ps_5merge.result: Automatic merge mysql-test/r/ps_6bdb.result: Automatic merge mysql-test/r/ps_7ndb.result: Automatic merge mysql-test/r/show_check.result: Automatic merge mysql-test/r/subselect.result: Automatic merge mysql-test/t/grant.test: Automatic merge mysql-test/t/multi_update.test: Automatic merge mysql-test/t/ps.test: Automatic merge mysql-test/t/show_check.test: Automatic merge ndb/docs/wl2077.txt: merge ndb/src/mgmsrv/main.cpp: merge scripts/mysql_fix_privilege_tables.sh: merge sql/item.cc: Merge (difficult) sql/item.h: simple merge sql/item_cmpfunc.h: Automatic merge sql/item_subselect.cc: Simple merge sql/item_subselect.h: Automatic merge sql/mysql_priv.h: Simple merge sql/slave.h: Automatic merge sql/sql_base.cc: Removed code that was backported to 4.1 sql/sql_class.h: Merge (some code moved to sql_insert.cc) sql/sql_db.cc: simple merge sql/sql_insert.cc: Merge (difficult as logic had changed both in 4.1 and 5.0) Some coded moved here from sql_class.h sql/sql_parse.cc: Merge (difficult) sql/sql_prepare.cc: Simple merge sql/sql_select.cc: Automatic merge sql/sql_table.cc: Simple merge sql/sql_update.cc: Difficult merge because of different logic for multi-updates sql/sql_yacc.yy: Simple merge tests/client_test.c: Simple merge
506 lines
9.1 KiB
Bash
506 lines
9.1 KiB
Bash
#!/bin/sh
|
|
|
|
#
|
|
# Script to create a Windows src package
|
|
#
|
|
|
|
version=@VERSION@
|
|
export version
|
|
CP="cp -p"
|
|
|
|
DEBUG=0
|
|
SILENT=0
|
|
SUFFIX=""
|
|
DIRNAME=""
|
|
OUTTAR="0"
|
|
OUTZIP="0"
|
|
|
|
#
|
|
# This script must run from MySQL top directory
|
|
#
|
|
|
|
if [ ! -f scripts/make_win_src_distribution ]; then
|
|
echo "ERROR : You must run this script from the MySQL top-level directory"
|
|
exit 1
|
|
fi
|
|
SOURCE=`pwd`
|
|
|
|
#
|
|
# Check for source compilation/configuration
|
|
#
|
|
|
|
if [ ! -f sql/sql_yacc.cc ]; then
|
|
echo "ERROR : Sorry, you must run this script after the complete build,"
|
|
echo " hope you know what you are trying to do !!"
|
|
exit 1
|
|
fi
|
|
|
|
#
|
|
# Debug print of the status
|
|
#
|
|
|
|
print_debug()
|
|
{
|
|
for statement
|
|
do
|
|
if [ "$DEBUG" = "1" ] ; then
|
|
echo $statement
|
|
fi
|
|
done
|
|
}
|
|
|
|
#
|
|
# Usage of the script
|
|
#
|
|
|
|
show_usage()
|
|
{
|
|
echo "MySQL utility script to create a Windows src package, and it takes"
|
|
echo "the following arguments:"
|
|
echo ""
|
|
echo " --debug Debug, without creating the package"
|
|
echo " --tmp Specify the temporary location"
|
|
echo " --suffix Suffix name for the package"
|
|
echo " --dirname Directory name to copy files (intermediate)"
|
|
echo " --silent Do not list verbosely files processed"
|
|
echo " --tar Create tar.gz package"
|
|
echo " --zip Create zip package"
|
|
echo " --help Show this help message"
|
|
|
|
exit 0
|
|
}
|
|
|
|
#
|
|
# Parse the input arguments
|
|
#
|
|
|
|
parse_arguments() {
|
|
for arg do
|
|
case "$arg" in
|
|
--add-tar) ADDTAR=1 ;;
|
|
--debug) DEBUG=1;;
|
|
--tmp=*) TMP=`echo "$arg" | sed -e "s;--tmp=;;"` ;;
|
|
--suffix=*) SUFFIX=`echo "$arg" | sed -e "s;--suffix=;;"` ;;
|
|
--dirname=*) DIRNAME=`echo "$arg" | sed -e "s;--dirname=;;"` ;;
|
|
--silent) SILENT=1 ;;
|
|
--tar) OUTTAR=1 ;;
|
|
--zip) OUTZIP=1 ;;
|
|
--help) show_usage ;;
|
|
*)
|
|
echo "Unknown argument '$arg'"
|
|
exit 1
|
|
;;
|
|
esac
|
|
done
|
|
}
|
|
|
|
parse_arguments "$@"
|
|
|
|
#
|
|
# Assign the tmp directory if it was set from the environment variables
|
|
#
|
|
|
|
for i in $TMP $TMPDIR $TEMPDIR $TEMP /tmp
|
|
do
|
|
if [ "$i" ]; then
|
|
print_debug "Setting TMP to '$i'"
|
|
TMP=$i
|
|
break
|
|
fi
|
|
done
|
|
|
|
|
|
#
|
|
# Convert argument file from unix to DOS text
|
|
#
|
|
|
|
unix_to_dos()
|
|
{
|
|
for arg do
|
|
print_debug "Replacing LF -> CRLF from '$arg'"
|
|
|
|
awk '{sub(/$/,"\r");print}' < $arg > $arg.tmp
|
|
rm -f $arg
|
|
mv $arg.tmp $arg
|
|
done
|
|
}
|
|
|
|
|
|
#
|
|
# Create a tmp dest directory to copy files
|
|
#
|
|
|
|
BASE=$TMP/my_win_dist$SUFFIX
|
|
|
|
if [ -d $BASE ] ; then
|
|
print_debug "Destination directory '$BASE' already exists, deleting it"
|
|
rm -r -f $BASE
|
|
fi
|
|
|
|
$CP -r $SOURCE/VC++Files $BASE
|
|
|
|
#
|
|
# Process version tags in InstallShield files
|
|
#
|
|
|
|
vreplace()
|
|
{
|
|
for arg do
|
|
unix_to_dos $arg
|
|
cat $arg | sed -e 's!@''VERSION''@!@VERSION@!' > $arg.tmp
|
|
rm -f $arg
|
|
mv $arg.tmp $arg
|
|
done
|
|
}
|
|
|
|
if test -d $BASE/InstallShield
|
|
then
|
|
for d in 4.1.XX-gpl 4.1.XX-pro 4.1.XX-classic
|
|
do
|
|
cd $BASE/InstallShield/$d/String\ Tables/0009-English
|
|
vreplace value.shl
|
|
cd ../../Setup\ Files/Compressed\ Files/Language\ Independent/OS\ Independent
|
|
vreplace infolist.txt
|
|
done
|
|
fi
|
|
|
|
#
|
|
# Move all error message files to root directory
|
|
#
|
|
|
|
$CP -r $SOURCE/sql/share $BASE/
|
|
rm -r -f "$BASE/share/Makefile"
|
|
rm -r -f "$BASE/share/Makefile.in"
|
|
rm -r -f "$BASE/share/Makefile.am"
|
|
|
|
mkdir $BASE/Docs $BASE/extra $BASE/include
|
|
|
|
#
|
|
# Copy directory files
|
|
#
|
|
|
|
copy_dir_files()
|
|
{
|
|
for arg do
|
|
print_debug "Copying files from directory '$arg'"
|
|
cd $SOURCE/$arg
|
|
if [ ! -d $BASE/$arg ]; then
|
|
print_debug "Creating directory '$arg'"
|
|
mkdir $BASE/$arg
|
|
fi
|
|
for i in *.c *.cpp *.h *.ih *.i *.ic *.asm *.def *.hpp *.dsp \
|
|
README INSTALL* LICENSE *.inc *.test *.result \
|
|
*.pem Moscow_leap des_key_file *.dat *.000001 \
|
|
*.require *.opt
|
|
|
|
do
|
|
if [ -f $i ]
|
|
then
|
|
$CP $SOURCE/$arg/$i $BASE/$arg/$i
|
|
fi
|
|
done
|
|
for i in *.cc
|
|
do
|
|
if [ -f $i ]
|
|
then
|
|
i=`echo $i | sed 's/.cc$//g'`
|
|
$CP $SOURCE/$arg/$i.cc $BASE/$arg/$i.cpp
|
|
fi
|
|
done
|
|
done
|
|
}
|
|
|
|
#
|
|
# Copy directory contents recursively
|
|
#
|
|
|
|
copy_dir_dirs() {
|
|
|
|
for arg do
|
|
|
|
cd $SOURCE
|
|
(
|
|
find $arg -type d \
|
|
-and -not -path \*SCCS\* \
|
|
-and -not -path \*.deps\* \
|
|
-and -not -path \*autom4te.cache -print
|
|
)|(
|
|
while read v
|
|
do
|
|
copy_dir_files $v
|
|
done
|
|
)
|
|
|
|
done
|
|
}
|
|
|
|
#
|
|
# Input directories to be copied
|
|
#
|
|
|
|
for i in client dbug extra heap include isam \
|
|
libmysql libmysqld merge myisam \
|
|
myisammrg mysys regex sql strings sql-common \
|
|
tools vio zlib
|
|
do
|
|
copy_dir_files $i
|
|
done
|
|
|
|
#
|
|
# Create project files for ndb
|
|
#
|
|
make -C $SOURCE/ndb windoze
|
|
|
|
#
|
|
# Input directories to be copied recursively
|
|
#
|
|
|
|
for i in bdb innobase mysql-test ndb
|
|
do
|
|
copy_dir_dirs $i
|
|
done
|
|
|
|
#
|
|
# Create dummy innobase configure header
|
|
#
|
|
|
|
if [ -f $BASE/innobase/ib_config.h ]; then
|
|
rm -f $BASE/innobase/ib_config.h
|
|
fi
|
|
touch $BASE/innobase/ib_config.h
|
|
|
|
|
|
#
|
|
# Copy miscellaneous files
|
|
#
|
|
|
|
cd $SOURCE
|
|
for i in COPYING ChangeLog README EXCEPTIONS-CLIENT\
|
|
INSTALL-SOURCE INSTALL-WIN \
|
|
INSTALL-WIN-SOURCE \
|
|
Docs/manual_toc.html Docs/manual.html \
|
|
Docs/manual.txt Docs/mysqld_error.txt \
|
|
Docs/INSTALL-BINARY Docs/internals.texi
|
|
do
|
|
print_debug "Copying file '$i'"
|
|
if [ -f $i ]
|
|
then
|
|
$CP $i $BASE/$i
|
|
fi
|
|
done
|
|
|
|
cp extra/sql_state.h extra/mysqld_error.h $BASE/include
|
|
|
|
#
|
|
# support files
|
|
#
|
|
mkdir $BASE/support-files
|
|
|
|
# Rename the cnf files to <file>.ini
|
|
for i in support-files/*.cnf
|
|
do
|
|
i=`echo $i | sed 's/.cnf$//g'`
|
|
cp $i.cnf $BASE/$i.ini
|
|
done
|
|
|
|
#
|
|
# Raw dirs from source tree
|
|
#
|
|
|
|
for i in scripts sql-bench SSL tests
|
|
do
|
|
print_debug "Copying directory '$i'"
|
|
if [ -d $i ]
|
|
then
|
|
$CP -R $i $BASE/$i
|
|
fi
|
|
done
|
|
|
|
#
|
|
# Fix some windows files to avoid compiler warnings
|
|
#
|
|
|
|
./extra/replace std:: "" < $BASE/sql/sql_yacc.cpp | sed '/^ *switch (yytype)$/ { N; /\n *{$/ { N; /\n *default:$/ { N; /\n *break;$/ { N; /\n *}$/ d; };};};} ' > $BASE/sql/sql_yacc.cpp-new
|
|
mv $BASE/sql/sql_yacc.cpp-new $BASE/sql/sql_yacc.cpp
|
|
|
|
#
|
|
# Search the tree for plain text files and adapt the line end marker
|
|
#
|
|
find $BASE \( -name "*.dsp" -o -name "*.dsw" -o -name "*.cnf" -o -name "*.ini" \
|
|
-o -name COPYING -o -name ChangeLog -o -name EXCEPTIONS-CLIENT -o -name "INSTALL*" -o -name LICENSE -o -name "README*" \) -type f -print \
|
|
| while read v
|
|
do
|
|
unix_to_dos $v
|
|
done
|
|
# File extension '.txt' matches too many other files, error messages etc.
|
|
unix_to_dos $BASE/Docs/*.txt
|
|
|
|
mv $BASE/README $BASE/README.txt
|
|
|
|
#
|
|
# Clean up if we did this from a bk tree
|
|
#
|
|
|
|
if [ -d $BASE/SSL/SCCS ]
|
|
then
|
|
find $BASE/ -type d -name SCCS -printf " \"%p\"" | xargs rm -r -f
|
|
fi
|
|
|
|
#
|
|
# Initialize the initial data directory
|
|
#
|
|
|
|
if [ -f scripts/mysql_install_db ]; then
|
|
print_debug "Initializing the 'data' directory"
|
|
scripts/mysql_install_db --no-defaults --windows --datadir=$BASE/data
|
|
if test "$?" = 1
|
|
then
|
|
exit 1;
|
|
fi
|
|
fi
|
|
|
|
#
|
|
# Specify the distribution package name and copy it
|
|
#
|
|
|
|
if test -z $DIRNAME
|
|
then
|
|
NEW_DIR_NAME=mysql@MYSQL_SERVER_SUFFIX@-$version$SUFFIX
|
|
else
|
|
NEW_DIR_NAME=$DIRNAME
|
|
fi
|
|
NEW_NAME=$NEW_DIR_NAME-win-src
|
|
|
|
BASE2=$TMP/$NEW_DIR_NAME
|
|
rm -r -f $BASE2
|
|
mv $BASE $BASE2
|
|
BASE=$BASE2
|
|
|
|
#
|
|
# If debugging, don't create a zip/tar/gz
|
|
#
|
|
|
|
if [ "$DEBUG" = "1" ] ; then
|
|
echo "Please check the distribution files from $BASE"
|
|
echo "Exiting (without creating the package).."
|
|
exit
|
|
fi
|
|
|
|
#
|
|
# This is needed to prefere gnu tar instead of tar because tar can't
|
|
# always handle long filenames
|
|
#
|
|
|
|
PATH_DIRS=`echo $PATH | sed -e 's/^:/. /' -e 's/:$/ ./' -e 's/::/ . /g' -e 's/:/ /g' `
|
|
which_1 ()
|
|
{
|
|
for cmd
|
|
do
|
|
for d in $PATH_DIRS
|
|
do
|
|
for file in $d/$cmd
|
|
do
|
|
if test -x $file -a ! -d $file
|
|
then
|
|
echo $file
|
|
exit 0
|
|
fi
|
|
done
|
|
done
|
|
done
|
|
exit 1
|
|
}
|
|
|
|
#
|
|
# Create the result zip/tar file
|
|
#
|
|
|
|
if [ "$OUTTAR" = "0" ]; then
|
|
if [ "$OUTZIP" = "0" ]; then
|
|
OUTZIP=1
|
|
fi
|
|
fi
|
|
|
|
set_tarzip_options()
|
|
{
|
|
for arg
|
|
do
|
|
if [ "$arg" = "tar" ]; then
|
|
ZIPFILE1=gnutar
|
|
ZIPFILE2=gtar
|
|
OPT=cvf
|
|
EXT=".tar"
|
|
NEED_COMPRESS=1
|
|
if [ "$SILENT" = "1" ] ; then
|
|
OPT=cf
|
|
fi
|
|
else
|
|
ZIPFILE1=zip
|
|
ZIPFILE2=""
|
|
OPT="-r"
|
|
EXT=".zip"
|
|
NEED_COMPRESS=0
|
|
if [ "$SILENT" = "1" ] ; then
|
|
OPT="$OPT -q"
|
|
fi
|
|
fi
|
|
done
|
|
}
|
|
|
|
|
|
#
|
|
# Create the archive
|
|
#
|
|
create_archive()
|
|
{
|
|
|
|
print_debug "Using $tar to create archive"
|
|
|
|
cd $TMP
|
|
|
|
rm -f $SOURCE/$NEW_NAME$EXT
|
|
$tar $OPT $SOURCE/$NEW_NAME$EXT $NEW_DIR_NAME
|
|
cd $SOURCE
|
|
|
|
if [ "$NEED_COMPRESS" = "1" ]
|
|
then
|
|
print_debug "Compressing archive"
|
|
gzip -9 $NEW_NAME$EXT
|
|
EXT="$EXT.gz"
|
|
fi
|
|
|
|
if [ "$SILENT" = "0" ] ; then
|
|
echo "$NEW_NAME$EXT created successfully !!"
|
|
fi
|
|
}
|
|
|
|
if [ "$OUTTAR" = "1" ]; then
|
|
set_tarzip_options 'tar'
|
|
|
|
tar=`which_1 $ZIPFILE1 $ZIPFILE2`
|
|
if test "$?" = "1" -o "$tar" = ""
|
|
then
|
|
print_debug "Search failed for '$ZIPFILE1', '$ZIPFILE2', using default 'tar'"
|
|
tar=tar
|
|
set_tarzip_options 'tar'
|
|
fi
|
|
|
|
create_archive
|
|
fi
|
|
|
|
if [ "$OUTZIP" = "1" ]; then
|
|
set_tarzip_options 'zip'
|
|
|
|
tar=`which_1 $ZIPFILE1 $ZIPFILE2`
|
|
if test "$?" = "1" -o "$tar" = ""
|
|
then
|
|
echo "Search failed for '$ZIPFILE1', '$ZIPFILE2', cannot create zip!"
|
|
fi
|
|
|
|
create_archive
|
|
fi
|
|
|
|
print_debug "Removing temporary directory"
|
|
rm -r -f $BASE
|
|
|
|
# End of script
|