mirror of
https://github.com/MariaDB/server.git
synced 2025-01-16 12:02:42 +01:00
359594ccd2
--- Removed reference to debian svn location of debian dir. Changed verbage of comment to appease Timothy. --- Removed added manpages that aren't appropriate for our build. --- Added debian dir to list of dist targets. Added list of files needed to be distributed in debian dir. --- Added semi-colons to fix syntax error. --- BUG#27769 MySQL should include debian packaing dir Added debian/Makefile to configure.in to support make dist. BitKeeper/deleted/.del-configure.in.rej: Delete: configure.in.rej Makefile.am: Added debian dir to list of dist targets. configure.in: Added debian/Makefile to configure.in to support make dist BitKeeper/deleted/.del-comp_err.1: Adding files to support building for debian. BitKeeper/deleted/.del-msql2mysql.1: Adding files to support building for debian. BitKeeper/deleted/.del-my_print_defaults.1: Adding files to support building for debian. BitKeeper/deleted/.del-myisam_ftdump.1: Adding files to support building for debian. BitKeeper/deleted/.del-myisamchk.1: Adding files to support building for debian. BitKeeper/deleted/.del-myisamlog.1: Adding files to support building for debian. BitKeeper/deleted/.del-myisampack.1: Adding files to support building for debian. BitKeeper/deleted/.del-mysql_config.1: Adding files to support building for debian. BitKeeper/deleted/.del-mysql_convert_table_format.1: Adding files to support building for debian. BitKeeper/deleted/.del-mysql_explain_log.1: Adding files to support building for debian. BitKeeper/deleted/.del-mysql_find_rows.1: Adding files to support building for debian. BitKeeper/deleted/.del-mysql_fix_extensions.1: Adding files to support building for debian. BitKeeper/deleted/.del-mysql_install_db.1: Adding files to support building for debian. BitKeeper/deleted/.del-mysql_secure_installation.1: Adding files to support building for debian. BitKeeper/deleted/.del-mysql_setpermission.1: Adding files to support building for debian. BitKeeper/deleted/.del-mysql_tableinfo.1: Adding files to support building for debian. BitKeeper/deleted/.del-mysql_waitpid.1: Adding files to support building for debian. BitKeeper/deleted/.del-mysqlbinlog.1: Adding files to support building for debian. BitKeeper/deleted/.del-mysqlbug.1: Adding files to support building for debian. BitKeeper/deleted/.del-mysqlcheck.1: Adding files to support building for debian. BitKeeper/deleted/.del-mysqldumpslow.1: Adding files to support building for debian. BitKeeper/deleted/.del-mysqlimport.1: Adding files to support building for debian. BitKeeper/deleted/.del-mysqlmanager.1: Adding files to support building for debian. BitKeeper/deleted/.del-mysqltest.1: Adding files to support building for debian. BitKeeper/deleted/.del-pack_isam.1: Adding files to support building for debian. BitKeeper/deleted/.del-resolve_stack_dump.1: Adding files to support building for debian. BitKeeper/deleted/.del-resolveip.1: Adding files to support building for debian. debian/Makefile.am: Added list of files needed to be distributed in debian dir. debian/README.Maintainer: Adding files to support building for debian. --- Removed reference to debian svn location of debian dir. Changed verbage of comment to appease Timothy. debian/changelog: Adding files to support building for debian. debian/compat: Adding files to support building for debian. debian/control.in: Adding files to support building for debian. debian/copyright.more: Adding files to support building for debian. debian/copyright: Adding files to support building for debian. debian/defs.mk: Adding files to support building for debian. debian/libmysqlclientMYSOVER-dev.README.Maintainer.in: Adding files to support building for debian. debian/libmysqlclientMYSOVER-dev.dirs.in: Adding files to support building for debian. debian/libmysqlclientMYSOVER-dev.docs.in: Adding files to support building for debian. debian/libmysqlclientMYSOVER-dev.examples.in: Adding files to support building for debian. debian/libmysqlclientMYSOVER-dev.files.in: Adding files to support building for debian. debian/libmysqlclientMYSOVER-dev.links.in: Adding files to support building for debian. debian/libmysqlclientMYSOVER.README.Debian.in: Adding files to support building for debian. debian/libmysqlclientMYSOVER.dirs.in: Adding files to support building for debian. debian/libmysqlclientMYSOVER.docs.in: Adding files to support building for debian. debian/libmysqlclientMYSOVER.files.in: Adding files to support building for debian. debian/libmysqlclientMYSOVER.postinst.in: Adding files to support building for debian. debian/libndbclientNDBSOVER-dev.dirs.in: Adding files to support building for debian. debian/libndbclientNDBSOVER-dev.files.in: Adding files to support building for debian. debian/libndbclientNDBSOVER-dev.links.in: Adding files to support building for debian. debian/libndbclientNDBSOVER.README.Debian.in: Adding files to support building for debian. debian/libndbclientNDBSOVER.dirs.in: Adding files to support building for debian. debian/libndbclientNDBSOVER.files.in: Adding files to support building for debian. debian/libndbclientNDBSOVER.postinst.in: Adding files to support building for debian. debian/mysql-client-MYVER.NEWS.in: Adding files to support building for debian. debian/mysql-client-MYVER.README.Debian.in: Adding files to support building for debian. debian/mysql-client-MYVER.dirs.in: Adding files to support building for debian. debian/mysql-client-MYVER.docs.in: Adding files to support building for debian. debian/mysql-client-MYVER.files.in: Adding files to support building for debian. debian/mysql-client-MYVER.lintian-overrides.in: Adding files to support building for debian. debian/mysql-common.README.Debian.in: Adding files to support building for debian. debian/mysql-common.dirs.in: Adding files to support building for debian. debian/mysql-common.files.in: Adding files to support building for debian. debian/mysql-common.postrm.in: Adding files to support building for debian. debian/mysql-common.preinst.in: Adding files to support building for debian. debian/mysql-extra-MYVER.dirs.in: Adding files to support building for debian. debian/mysql-extra-MYVER.files.in: Adding files to support building for debian. debian/mysql-management-MYVER.dirs.in: Adding files to support building for debian. debian/mysql-management-MYVER.files.in: Adding files to support building for debian. debian/mysql-management-MYVER.mysql-management.init.in: Adding files to support building for debian. debian/mysql-server-MYOLDVER.preinst.in: Adding files to support building for debian. debian/mysql-server-MYVER.NEWS.in: Adding files to support building for debian. debian/mysql-server-MYVER.README.Debian.in: Adding files to support building for debian. debian/mysql-server-MYVER.config.in: Adding files to support building for debian. debian/mysql-server-MYVER.dirs.in: Adding files to support building for debian. debian/mysql-server-MYVER.docs.in: Adding files to support building for debian. debian/mysql-server-MYVER.files.in: Adding files to support building for debian. debian/mysql-server-MYVER.links.in: Adding files to support building for debian. debian/mysql-server-MYVER.lintian-overrides.in: Adding files to support building for debian. debian/mysql-server-MYVER.logcheck.ignore.paranoid.in: Adding files to support building for debian. debian/mysql-server-MYVER.logcheck.ignore.server.in: Adding files to support building for debian. debian/mysql-server-MYVER.logcheck.ignore.workstation.in: Adding files to support building for debian. debian/mysql-server-MYVER.mysql-server.logrotate.in: Adding files to support building for debian. debian/mysql-server-MYVER.postinst.in: Adding files to support building for debian. debian/mysql-server-MYVER.postrm.in: Adding files to support building for debian. debian/additions/my.cnf: Adding files to support building for debian. debian/additions/mysql-server.lintian-overrides: Adding files to support building for debian. debian/additions/ndb_mgmd.cnf: Adding files to support building for debian. debian/mysql-server-MYVER.preinst.in: Adding files to support building for debian. debian/mysql-server-MYVER.prerm.in: Adding files to support building for debian. debian/mysql-server-MYVER.templates.in: Adding files to support building for debian. debian/mysql-server.preinst.in: Adding files to support building for debian. debian/mysql-storage-MYVER.dirs.in: Adding files to support building for debian. debian/mysql-storage-MYVER.files.in: Adding files to support building for debian. debian/mysql-storage-MYVER.mysql-storage.init.in: Adding files to support building for debian. debian/mysql-test-MYVER.dirs.in: Adding files to support building for debian. debian/mysql-test-MYVER.files.in: Adding files to support building for debian. debian/mysql-tools-MYVER.dirs.in: Adding files to support building for debian. debian/mysql-tools-MYVER.files.in: Adding files to support building for debian. debian/po/POTFILES.in.in: Adding files to support building for debian. debian/po/ca.po: Adding files to support building for debian. debian/po/cs.po: Adding files to support building for debian. debian/po/da.po: Adding files to support building for debian. debian/po/de.po: Adding files to support building for debian. debian/po/es.po: Adding files to support building for debian. debian/po/eu.po: Adding files to support building for debian. debian/po/fr.po: Adding files to support building for debian. debian/po/gl.po: Adding files to support building for debian. debian/po/it.po: Adding files to support building for debian. debian/po/ja.po: Adding files to support building for debian. debian/po/nb.po: Adding files to support building for debian. debian/po/nl.po: Adding files to support building for debian. debian/po/pt.po: Adding files to support building for debian. debian/po/pt_BR.po: Adding files to support building for debian. debian/po/ro.po: Adding files to support building for debian. debian/po/ru.po: Adding files to support building for debian. debian/po/sv.po: Adding files to support building for debian. debian/po/templates.pot: Adding files to support building for debian. debian/po/tr.po: Adding files to support building for debian. debian/rules: Adding files to support building for debian. --- Added semi-colons to fix syntax error. debian/source.lintian-overrides.in: Adding files to support building for debian. debian/watch: Adding files to support building for debian.
191 lines
5 KiB
Bash
191 lines
5 KiB
Bash
#!/bin/bash -e
|
|
#
|
|
# summary of how this script can be called:
|
|
# * <new-preinst> install
|
|
# * <new-preinst> install <old-version>
|
|
# * <new-preinst> upgrade <old-version>
|
|
# * <old-preinst> abort-upgrade <new-version>
|
|
#
|
|
|
|
if [ -n "$DEBIAN_SCRIPT_DEBUG" ]; then set -v -x; DEBIAN_SCRIPT_TRACE=1; fi
|
|
${DEBIAN_SCRIPT_TRACE:+ echo "#42#DEBUG# RUNNING $0 $*" 1>&2 }
|
|
|
|
export PATH=$PATH:/sbin:/usr/sbin:/bin:/usr/bin
|
|
|
|
# Try to stop the server in a sane way. If it does not success let the admin
|
|
# do it himself. No database directories should be removed while the server
|
|
# is running! Another mysqld in e.g. a different chroot is fine for us.
|
|
stop_server() {
|
|
if [ ! -x /etc/init.d/mysql ]; then return; fi
|
|
|
|
set +e
|
|
if [ -x /usr/sbin/invoke-rc.d ]; then
|
|
cmd="invoke-rc.d mysql stop"
|
|
else
|
|
cmd="/etc/init.d/mysql stop"
|
|
fi
|
|
$cmd
|
|
errno=$?
|
|
set -e
|
|
|
|
# 0=ok, 100=no init script (fresh install)
|
|
if [ "$errno" != 0 -a "$errno" != 100 ]; then
|
|
echo "${cmd/ */} returned $errno" 1>&2
|
|
echo "There is a MySQL server running, but we failed in our attempts to stop it." 1>&2
|
|
echo "Stop it yourself and try again!" 1>&2
|
|
exit 1
|
|
fi
|
|
}
|
|
|
|
##### here's a bunch of helper functions for converting database formats ######
|
|
|
|
cvt_get_param(){
|
|
/usr/sbin/mysqld --print-defaults \
|
|
| tr " " "\n" \
|
|
| grep -- "--$1" \
|
|
| tail -n 1 \
|
|
| cut -d= -f2
|
|
}
|
|
|
|
cvt_setup_stuff(){
|
|
mytmp=`mktemp -d -t mysql-ISAM-convert.XXXXXX`
|
|
cvt_log="$mytmp/conversion.log"
|
|
if [ ! -d "$mytmp" ]; then
|
|
echo "can't create temporary directory, oh well." >&2
|
|
exit 1
|
|
fi
|
|
|
|
chgrp mysql $mytmp
|
|
chmod g+rwx $mytmp
|
|
cvt_socket=${mytmp}/mysql.sock
|
|
|
|
cvt_mysqld="mysqld --skip-grant-tables --skip-networking --socket $cvt_socket"
|
|
cvt_mysql="mysql --socket $cvt_socket"
|
|
cvt_mysqladmin="mysqladmin --socket $cvt_socket"
|
|
}
|
|
|
|
cvt_get_databases(){
|
|
echo fetching database list ... >&2
|
|
$cvt_mysql -e 'show databases' | sed -n -e '2,$p'
|
|
}
|
|
|
|
cvt_get_tables(){
|
|
echo querying tables in $1 ... >&2
|
|
$cvt_mysql $1 -e 'show table status' | sed -n -e '2,$p' | \
|
|
cut -f 1,2 | grep -w 'ISAM$' | cut -f 1
|
|
}
|
|
|
|
cvt_convert_table(){
|
|
echo converting $1.$2 ... >&2
|
|
$cvt_mysql $1 -e "alter table $2 type=MyISAM"
|
|
}
|
|
|
|
cvt_wait_for_server(){
|
|
local count
|
|
echo -n waiting for server startup.. >&2
|
|
while ! $cvt_mysql </dev/null >/dev/null 2>&1; do
|
|
echo -n . >&2
|
|
sleep 1
|
|
count=".$count"
|
|
if [ -f $mytmp/mysql.done ]; then
|
|
echo "sorry... looks like the server crashed :(" >&2
|
|
return 1
|
|
elif [ "$count" = "...................." ]; then
|
|
echo "sorry... looks like the server didn't start :(" >&2
|
|
return 1
|
|
fi
|
|
done
|
|
echo ok. >&2
|
|
}
|
|
|
|
cvt_wait_for_exit(){
|
|
local count
|
|
echo -n waiting for server shutdown.. >&2
|
|
while [ ! -f $mytmp/mysql.done ]; do
|
|
echo -n . >&2
|
|
sleep 1
|
|
count=".$count"
|
|
if [ "$count" = "...................." ]; then
|
|
echo "hrm... guess it never started?" >&2
|
|
return 0
|
|
fi
|
|
done
|
|
echo ok. >&2
|
|
}
|
|
|
|
cvt_cleanup(){
|
|
local mysql_kids
|
|
rm -rf $mytmp
|
|
# kill any mysqld child processes left over. there *shouldn't* be any,
|
|
# but let's not take chances with that
|
|
mysql_kids=`ps o 'pid command' --ppid $$ | grep -E '^[[:digit:]]+ mysqld ' | cut -d' ' -f1`
|
|
if [ "$mysql_kids" ]; then
|
|
echo "strange, some mysql processes left around. killing them now." >&2
|
|
kill $mysql_kids
|
|
sleep 10
|
|
mysql_kids=`ps o 'pid command' --ppid $$ | grep -E '^[[:digit:]]+ mysqld ' | cut -d' ' -f1`
|
|
if [ "$mysql_kids" ]; then
|
|
echo "okay, they're really not getting the hint..." >&2
|
|
kill -9 $mysql_kids
|
|
fi
|
|
fi
|
|
}
|
|
|
|
################################ main() ##########################
|
|
|
|
# to be sure
|
|
stop_server
|
|
|
|
# test if upgrading from non conffile state
|
|
if [ "$1" = "upgrade" ] && [ -x /usr/sbin/mysqld ]; then
|
|
cvt_datadir=`cvt_get_param datadir`
|
|
# test for ISAM tables, which we must convert NOW
|
|
if [ -n "`find $cvt_datadir -name '*.ISM' 2>/dev/null`" ]; then
|
|
set +e
|
|
cat << EOF >&2
|
|
----------------------------------------
|
|
WARNING WARNING WARNING
|
|
----------------------------------------
|
|
|
|
It has been detected that are are using ISAM format on some of your
|
|
mysql database tables. This format has been deprecated and no longer
|
|
supported. to prevent these databases from essentially disappearing,
|
|
an attempt at format conversion will now be made. please check after
|
|
your upgrade that all tables are present and accounted for.
|
|
|
|
apologies for the noise, but we thought you'd appreciate it :)
|
|
|
|
----------------------------------------
|
|
WARNING WARNING WARNING
|
|
----------------------------------------
|
|
EOF
|
|
cvt_setup_stuff
|
|
($cvt_mysqld >$cvt_log 2>&1; touch $mytmp/mysql.done ) &
|
|
|
|
if cvt_wait_for_server; then
|
|
dbs=`cvt_get_databases`
|
|
for db in $dbs; do
|
|
tables=`cvt_get_tables $db`
|
|
for tbl in $tables; do
|
|
cvt_convert_table $db $tbl
|
|
done
|
|
done
|
|
else
|
|
cvt_error="yes"
|
|
fi
|
|
|
|
echo shutting down server... >&2
|
|
$cvt_mysqladmin shutdown
|
|
cvt_wait_for_exit
|
|
echo "all done!" >&2
|
|
if [ ! "$cvt_error" = "yes" ]; then
|
|
cvt_cleanup
|
|
else
|
|
echo "you might want to look in $mytmp..." >&2
|
|
fi
|
|
|
|
set -e
|
|
fi
|
|
fi
|
|
|
|
exit 0
|