mirror of
https://github.com/MariaDB/server.git
synced 2025-01-18 13:02:28 +01:00
Merge
This commit is contained in:
commit
c68c4f3cb7
1 changed files with 123 additions and 135 deletions
|
@ -1,56 +1,78 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# The default path should be /usr/local
|
|
||||||
|
|
||||||
# Get some info from configure
|
# This is a script to create a TAR or ZIP binary distribution out of a
|
||||||
# chmod +x ./scripts/setsomevars
|
# built source tree. The output file will be put at the top level of
|
||||||
|
# the source tree, as "mysql-<vsn>....{tar.gz,zip}"
|
||||||
|
#
|
||||||
|
# The temporary directory path given to "--tmp=<path>" has to be
|
||||||
|
# absolute and with no spaces.
|
||||||
|
|
||||||
machine=@MACHINE_TYPE@
|
machine=@MACHINE_TYPE@
|
||||||
system=@SYSTEM_TYPE@
|
system=@SYSTEM_TYPE@
|
||||||
version=@VERSION@
|
version=@VERSION@
|
||||||
export machine system version
|
SOURCE=`pwd`
|
||||||
SOURCE=`pwd`
|
|
||||||
CP="cp -p"
|
CP="cp -p"
|
||||||
MV="mv"
|
MV="mv"
|
||||||
|
|
||||||
STRIP=1
|
STRIP=1
|
||||||
DEBUG=0
|
DEBUG=0
|
||||||
SILENT=0
|
SILENT=0
|
||||||
MACHINE=
|
MACHINE=""
|
||||||
|
PLATFORM=""
|
||||||
TMP=/tmp
|
TMP=/tmp
|
||||||
SUFFIX=""
|
SUFFIX=""
|
||||||
NDBCLUSTER=
|
NDBCLUSTER=""
|
||||||
|
|
||||||
parse_arguments() {
|
for arg do
|
||||||
for arg do
|
case "$arg" in
|
||||||
case "$arg" in
|
--debug) DEBUG=1;;
|
||||||
--debug) DEBUG=1;;
|
--tmp=*) TMP=`echo "$arg" | sed -e "s;--tmp=;;"` ;;
|
||||||
--tmp=*) TMP=`echo "$arg" | sed -e "s;--tmp=;;"` ;;
|
--suffix=*) SUFFIX=`echo "$arg" | sed -e "s;--suffix=;;"` ;;
|
||||||
--suffix=*) SUFFIX=`echo "$arg" | sed -e "s;--suffix=;;"` ;;
|
--no-strip) STRIP=0 ;;
|
||||||
--no-strip) STRIP=0 ;;
|
--machine=*) MACHINE=`echo "$arg" | sed -e "s;--machine=;;"` ;;
|
||||||
--machine=*) MACHINE=`echo "$arg" | sed -e "s;--machine=;;"` ;;
|
--platform=*) PLATFORM=`echo "$arg" | sed -e "s;--platform=;;"` ;;
|
||||||
--silent) SILENT=1 ;;
|
--silent) SILENT=1 ;;
|
||||||
--with-ndbcluster) NDBCLUSTER=1 ;;
|
--with-ndbcluster) NDBCLUSTER=1 ;;
|
||||||
*)
|
*)
|
||||||
echo "Unknown argument '$arg'"
|
echo "Unknown argument '$arg'"
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
}
|
|
||||||
|
|
||||||
parse_arguments "$@"
|
# Remove vendor from $system
|
||||||
|
system=`echo $system | sed -e 's/[a-z]*-\(.*\)/\1/g'`
|
||||||
|
|
||||||
|
# Map OS names to "our" OS names (eg. darwin6.8 -> osx10.2)
|
||||||
|
system=`echo $system | sed -e 's/darwin6.*/osx10.2/g'`
|
||||||
|
system=`echo $system | sed -e 's/darwin7.*/osx10.3/g'`
|
||||||
|
system=`echo $system | sed -e 's/darwin8.*/osx10.4/g'`
|
||||||
|
system=`echo $system | sed -e 's/\(aix4.3\).*/\1/g'`
|
||||||
|
system=`echo $system | sed -e 's/\(aix5.1\).*/\1/g'`
|
||||||
|
system=`echo $system | sed -e 's/\(aix5.2\).*/\1/g'`
|
||||||
|
system=`echo $system | sed -e 's/\(aix5.3\).*/\1/g'`
|
||||||
|
system=`echo $system | sed -e 's/osf5.1b/tru64/g'`
|
||||||
|
system=`echo $system | sed -e 's/linux-gnu/linux/g'`
|
||||||
|
system=`echo $system | sed -e 's/solaris2.\([0-9]*\)/solaris\1/g'`
|
||||||
|
system=`echo $system | sed -e 's/sco3.2v\(.*\)/openserver\1/g'`
|
||||||
|
|
||||||
|
if [ x"$MACHINE" != x"" ] ; then
|
||||||
|
machine=$MACHINE
|
||||||
|
fi
|
||||||
|
|
||||||
#make
|
if [ x"$PLATFORM" != x"" ] ; then
|
||||||
|
platform="$PLATFORM"
|
||||||
|
else
|
||||||
|
platform="$system-$machine"
|
||||||
|
fi
|
||||||
|
|
||||||
# This should really be integrated with automake and not duplicate the
|
# FIXME This should really be integrated with automake and not duplicate the
|
||||||
# installation list.
|
# installation list.
|
||||||
|
|
||||||
BASE=$TMP/my_dist$SUFFIX
|
BASE=$TMP/my_dist$SUFFIX
|
||||||
|
|
||||||
if [ -d $BASE ] ; then
|
if [ -d $BASE ] ; then
|
||||||
rm -r -f $BASE
|
rm -rf $BASE
|
||||||
fi
|
fi
|
||||||
|
|
||||||
BS=""
|
BS=""
|
||||||
|
@ -79,25 +101,29 @@ if [ $BASE_SYSTEM != "netware" ] ; then
|
||||||
chmod o-rwx $BASE/data $BASE/data/*
|
chmod o-rwx $BASE/data $BASE/data/*
|
||||||
fi
|
fi
|
||||||
|
|
||||||
for i in ChangeLog \
|
# Copy files if they exists, warn for those that don't
|
||||||
Docs/mysql.info
|
copyfileto()
|
||||||
do
|
{
|
||||||
if [ -f $i ]
|
destdir=$1
|
||||||
then
|
shift
|
||||||
$CP $i $BASE/docs
|
for i
|
||||||
fi
|
do
|
||||||
done
|
if [ -f $i ] ; then
|
||||||
|
$CP $i $destdir
|
||||||
|
elif [ -d $i ] ; then
|
||||||
|
echo "Warning: Will not copy directory \"$i\""
|
||||||
|
else
|
||||||
|
echo "Warning: Listed file not found \"$i\""
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
for i in COPYING COPYING.LIB README Docs/INSTALL-BINARY \
|
copyfileto $BASE/docs ChangeLog Docs/mysql.info
|
||||||
|
|
||||||
|
copyfileto $BASE COPYING COPYING.LIB README Docs/INSTALL-BINARY \
|
||||||
EXCEPTIONS-CLIENT MySQLEULA.txt LICENSE.doc README.NW
|
EXCEPTIONS-CLIENT MySQLEULA.txt LICENSE.doc README.NW
|
||||||
do
|
|
||||||
if [ -f $i ]
|
|
||||||
then
|
|
||||||
$CP $i $BASE
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
# Non platform-specific bin files:
|
# Non platform-specific bin dir files:
|
||||||
BIN_FILES="extra/comp_err$BS extra/replace$BS extra/perror$BS \
|
BIN_FILES="extra/comp_err$BS extra/replace$BS extra/perror$BS \
|
||||||
extra/resolveip$BS extra/my_print_defaults$BS \
|
extra/resolveip$BS extra/my_print_defaults$BS \
|
||||||
extra/resolve_stack_dump$BS extra/mysql_waitpid$BS \
|
extra/resolve_stack_dump$BS extra/mysql_waitpid$BS \
|
||||||
|
@ -114,7 +140,7 @@ BIN_FILES="extra/comp_err$BS extra/replace$BS extra/perror$BS \
|
||||||
libmysqld/examples/mysqltest_embedded$BS \
|
libmysqld/examples/mysqltest_embedded$BS \
|
||||||
";
|
";
|
||||||
|
|
||||||
# Platform-specific bin files:
|
# Platform-specific bin dir files:
|
||||||
if [ $BASE_SYSTEM = "netware" ] ; then
|
if [ $BASE_SYSTEM = "netware" ] ; then
|
||||||
BIN_FILES="$BIN_FILES \
|
BIN_FILES="$BIN_FILES \
|
||||||
netware/mysqld_safe$BS netware/mysql_install_db$BS \
|
netware/mysqld_safe$BS netware/mysql_install_db$BS \
|
||||||
|
@ -137,33 +163,21 @@ else
|
||||||
";
|
";
|
||||||
fi
|
fi
|
||||||
|
|
||||||
for i in $BIN_FILES
|
copyfileto $BASE/bin $BIN_FILES
|
||||||
do
|
|
||||||
if [ -f $i ]
|
|
||||||
then
|
|
||||||
$CP $i $BASE/bin
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
if [ x$STRIP = x1 ] ; then
|
if [ x$STRIP = x1 ] ; then
|
||||||
strip $BASE/bin/*
|
strip $BASE/bin/*
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Copy not binary files
|
# Copy not binary files
|
||||||
for i in sql/mysqld.sym.gz
|
copyfileto $BASE/bin sql/mysqld.sym.gz
|
||||||
do
|
|
||||||
if [ -f $i ]
|
|
||||||
then
|
|
||||||
$CP $i $BASE/bin
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
if [ $BASE_SYSTEM = "netware" ] ; then
|
if [ $BASE_SYSTEM = "netware" ] ; then
|
||||||
$CP -r netware/*.pl $BASE/scripts
|
$CP netware/*.pl $BASE/scripts
|
||||||
$CP scripts/mysqlhotcopy $BASE/scripts/mysqlhotcopy.pl
|
$CP scripts/mysqlhotcopy $BASE/scripts/mysqlhotcopy.pl
|
||||||
fi
|
fi
|
||||||
|
|
||||||
for i in \
|
copyfileto $BASE/lib \
|
||||||
libmysql/.libs/libmysqlclient.a libmysql/.libs/libmysqlclient.so* \
|
libmysql/.libs/libmysqlclient.a libmysql/.libs/libmysqlclient.so* \
|
||||||
libmysql/libmysqlclient.* libmysql_r/.libs/libmysqlclient_r.a \
|
libmysql/libmysqlclient.* libmysql_r/.libs/libmysqlclient_r.a \
|
||||||
libmysql_r/.libs/libmysqlclient_r.so* libmysql_r/libmysqlclient_r.* \
|
libmysql_r/.libs/libmysqlclient_r.so* libmysql_r/libmysqlclient_r.* \
|
||||||
|
@ -171,12 +185,6 @@ for i in \
|
||||||
libmysqld/.libs/libmysqld.a libmysqld/.libs/libmysqld.so* \
|
libmysqld/.libs/libmysqld.a libmysqld/.libs/libmysqld.so* \
|
||||||
libmysqld/libmysqld.a netware/libmysql.imp \
|
libmysqld/libmysqld.a netware/libmysql.imp \
|
||||||
zlib/.libs/libz.a
|
zlib/.libs/libz.a
|
||||||
do
|
|
||||||
if [ -f $i ]
|
|
||||||
then
|
|
||||||
$CP $i $BASE/lib
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
# convert the .a to .lib for NetWare
|
# convert the .a to .lib for NetWare
|
||||||
if [ $BASE_SYSTEM = "netware" ] ; then
|
if [ $BASE_SYSTEM = "netware" ] ; then
|
||||||
|
@ -187,7 +195,8 @@ if [ $BASE_SYSTEM = "netware" ] ; then
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
$CP config.h include/* $BASE/include
|
copyfileto $BASE/include config.h include/*
|
||||||
|
|
||||||
rm -f $BASE/include/Makefile* $BASE/include/*.in $BASE/include/config-win.h
|
rm -f $BASE/include/Makefile* $BASE/include/*.in $BASE/include/config-win.h
|
||||||
if [ $BASE_SYSTEM != "netware" ] ; then
|
if [ $BASE_SYSTEM != "netware" ] ; then
|
||||||
rm -f $BASE/include/config-netware.h
|
rm -f $BASE/include/config-netware.h
|
||||||
|
@ -202,22 +211,18 @@ if [ $BASE_SYSTEM != "netware" ] ; then
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
$CP support-files/* $BASE/support-files
|
copyfileto $BASE/support-files support-files/*
|
||||||
$CP scripts/*.sql $BASE/share
|
|
||||||
|
copyfileto $BASE/share scripts/*.sql
|
||||||
|
|
||||||
$CP -r sql/share/* $MYSQL_SHARE
|
$CP -r sql/share/* $MYSQL_SHARE
|
||||||
rm -f $MYSQL_SHARE/Makefile* $MYSQL_SHARE/*/*.OLD
|
rm -f $MYSQL_SHARE/Makefile* $MYSQL_SHARE/*/*.OLD
|
||||||
|
|
||||||
for i in mysql-test/mysql-test-run mysql-test/install_test_db \
|
copyfileto $BASE/mysql-test \
|
||||||
|
mysql-test/mysql-test-run mysql-test/install_test_db \
|
||||||
mysql-test/mysql-test-run.pl mysql-test/README \
|
mysql-test/mysql-test-run.pl mysql-test/README \
|
||||||
mysql-test/valgrind.supp \
|
mysql-test/valgrind.supp \
|
||||||
netware/mysql_test_run.nlm netware/install_test_db.ncf
|
netware/mysql_test_run.nlm netware/install_test_db.ncf
|
||||||
do
|
|
||||||
if [ -f $i ]
|
|
||||||
then
|
|
||||||
$CP $i $BASE/mysql-test
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
$CP mysql-test/lib/*.pl $BASE/mysql-test/lib
|
$CP mysql-test/lib/*.pl $BASE/mysql-test/lib
|
||||||
$CP mysql-test/lib/*.sql $BASE/mysql-test/lib
|
$CP mysql-test/lib/*.sql $BASE/mysql-test/lib
|
||||||
|
@ -234,19 +239,29 @@ $CP mysql-test/r/*.result mysql-test/r/*.require \
|
||||||
|
|
||||||
if [ $BASE_SYSTEM != "netware" ] ; then
|
if [ $BASE_SYSTEM != "netware" ] ; then
|
||||||
chmod a+x $BASE/bin/*
|
chmod a+x $BASE/bin/*
|
||||||
$CP scripts/* $BASE/bin
|
copyfileto $BASE/bin scripts/*
|
||||||
$BASE/bin/replace \@localstatedir\@ ./data \@bindir\@ ./bin \@scriptdir\@ ./bin \@libexecdir\@ ./bin \@sbindir\@ ./bin \@prefix\@ . \@HOSTNAME\@ @HOSTNAME@ \@pkgdatadir\@ ./support-files < $SOURCE/scripts/mysql_install_db.sh > $BASE/scripts/mysql_install_db
|
$BASE/bin/replace \@localstatedir\@ ./data \@bindir\@ ./bin \@scriptdir\@ \
|
||||||
$BASE/bin/replace \@prefix\@ /usr/local/mysql \@bindir\@ ./bin \@sbindir\@ ./bin \@libexecdir\@ ./bin \@MYSQLD_USER\@ @MYSQLD_USER@ \@localstatedir\@ /usr/local/mysql/data \@HOSTNAME\@ @HOSTNAME@ < $SOURCE/support-files/mysql.server.sh > $BASE/support-files/mysql.server
|
./bin \@libexecdir\@ ./bin \@sbindir\@ ./bin \@prefix\@ . \@HOSTNAME\@ \
|
||||||
|
@HOSTNAME@ \@pkgdatadir\@ ./support-files \
|
||||||
|
< scripts/mysql_install_db.sh > $BASE/scripts/mysql_install_db
|
||||||
|
$BASE/bin/replace \@prefix\@ /usr/local/mysql \@bindir\@ ./bin \
|
||||||
|
\@sbindir\@ ./bin \@libexecdir\@ ./bin \
|
||||||
|
\@MYSQLD_USER\@ @MYSQLD_USER@ \@localstatedir\@ /usr/local/mysql/data \
|
||||||
|
\@HOSTNAME\@ @HOSTNAME@ \
|
||||||
|
< support-files/mysql.server.sh > $BASE/support-files/mysql.server
|
||||||
$BASE/bin/replace /my/gnu/bin/hostname /bin/hostname -- $BASE/bin/mysqld_safe
|
$BASE/bin/replace /my/gnu/bin/hostname /bin/hostname -- $BASE/bin/mysqld_safe
|
||||||
mv $BASE/support-files/binary-configure $BASE/configure
|
mv $BASE/support-files/binary-configure $BASE/configure
|
||||||
chmod a+x $BASE/bin/* $BASE/scripts/* $BASE/support-files/mysql-* $BASE/support-files/mysql.server $BASE/configure
|
chmod a+x $BASE/bin/* $BASE/scripts/* $BASE/support-files/mysql-* \
|
||||||
|
$BASE/support-files/mysql.server $BASE/configure
|
||||||
$CP -r sql-bench/* $BASE/sql-bench
|
$CP -r sql-bench/* $BASE/sql-bench
|
||||||
rm -f $BASE/sql-bench/*.sh $BASE/sql-bench/Makefile* $BASE/lib/*.la
|
rm -f $BASE/sql-bench/*.sh $BASE/sql-bench/Makefile* $BASE/lib/*.la
|
||||||
rm -f $BASE/bin/*.sql
|
rm -f $BASE/bin/*.sql
|
||||||
fi
|
fi
|
||||||
|
|
||||||
rm -f $BASE/bin/Makefile* $BASE/bin/*.in $BASE/bin/*.sh $BASE/bin/mysql_install_db $BASE/bin/make_binary_distribution $BASE/bin/setsomevars $BASE/support-files/Makefile* $BASE/support-files/*.sh
|
rm -f $BASE/bin/Makefile* $BASE/bin/*.in $BASE/bin/*.sh \
|
||||||
|
$BASE/bin/mysql_install_db $BASE/bin/make_binary_distribution \
|
||||||
|
$BASE/bin/setsomevars $BASE/support-files/Makefile* \
|
||||||
|
$BASE/support-files/*.sh
|
||||||
|
|
||||||
#
|
#
|
||||||
# Copy system dependent files
|
# Copy system dependent files
|
||||||
|
@ -280,9 +295,9 @@ if [ $BASE_SYSTEM != "netware" ] ; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Clean up if we did this from a bk tree
|
# Clean up if we did this from a bk tree
|
||||||
if [ -d $BASE/sql-bench/SCCS ] ; then
|
if [ -d $BASE/sql-bench/SCCS ] ; then
|
||||||
find $BASE/share -name SCCS -print | xargs rm -r -f
|
find $BASE/share -name SCCS -print | xargs rm -rf
|
||||||
find $BASE/sql-bench -name SCCS -print | xargs rm -r -f
|
find $BASE/sql-bench -name SCCS -print | xargs rm -rf
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# NDB Cluster
|
# NDB Cluster
|
||||||
|
@ -297,52 +312,27 @@ if [ x$NDBCLUSTER = x1 ]; then
|
||||||
rm -rf $BASE/ndb-stage
|
rm -rf $BASE/ndb-stage
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Remove vendor from $system
|
|
||||||
system=`echo $system | sed -e 's/[a-z]*-\(.*\)/\1/g'`
|
|
||||||
|
|
||||||
# Map OS names to "our" OS names (eg. darwin6.8 -> osx10.2)
|
|
||||||
system=`echo $system | sed -e 's/darwin6.*/osx10.2/g'`
|
|
||||||
system=`echo $system | sed -e 's/darwin7.*/osx10.3/g'`
|
|
||||||
system=`echo $system | sed -e 's/darwin8.*/osx10.4/g'`
|
|
||||||
system=`echo $system | sed -e 's/\(aix4.3\).*/\1/g'`
|
|
||||||
system=`echo $system | sed -e 's/\(aix5.1\).*/\1/g'`
|
|
||||||
system=`echo $system | sed -e 's/\(aix5.2\).*/\1/g'`
|
|
||||||
system=`echo $system | sed -e 's/\(aix5.3\).*/\1/g'`
|
|
||||||
system=`echo $system | sed -e 's/osf5.1b/tru64/g'`
|
|
||||||
system=`echo $system | sed -e 's/linux-gnu/linux/g'`
|
|
||||||
system=`echo $system | sed -e 's/solaris2.\([0-9]*\)/solaris\1/g'`
|
|
||||||
system=`echo $system | sed -e 's/sco3.2v\(.*\)/openserver\1/g'`
|
|
||||||
|
|
||||||
# Use the override --machine if present
|
|
||||||
if [ -n "$MACHINE" ] ; then
|
|
||||||
machine=$MACHINE
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Change the distribution to a long descriptive name
|
# Change the distribution to a long descriptive name
|
||||||
NEW_NAME=mysql@MYSQL_SERVER_SUFFIX@-$version-$system-$machine$SUFFIX
|
NEW_NAME=mysql@MYSQL_SERVER_SUFFIX@-$version-$platform$SUFFIX
|
||||||
|
|
||||||
# Print the platform name for build logs
|
# Print the platform name for build logs
|
||||||
echo "PLATFORM NAME: $system-$machine"
|
echo "PLATFORM NAME: $platform"
|
||||||
|
|
||||||
BASE2=$TMP/$NEW_NAME
|
BASE2=$TMP/$NEW_NAME
|
||||||
rm -r -f $BASE2
|
rm -rf $BASE2
|
||||||
mv $BASE $BASE2
|
mv $BASE $BASE2
|
||||||
BASE=$BASE2
|
BASE=$BASE2
|
||||||
#
|
#
|
||||||
# If we are compiling with gcc, copy libgcc.a to the distribution as libmygcc.a
|
# If we are compiling with gcc, copy libgcc.a to the distribution as libmygcc.a
|
||||||
#
|
#
|
||||||
|
|
||||||
if test "@GXX@" = "yes"
|
if [ x"@GXX@" = x"yes" ] ; then
|
||||||
then
|
|
||||||
cd $BASE/lib
|
|
||||||
gcclib=`@CC@ --print-libgcc-file`
|
gcclib=`@CC@ --print-libgcc-file`
|
||||||
if test $? -ne 0
|
if [ $? -ne 0 ] ; then
|
||||||
then
|
|
||||||
print "Warning: Couldn't find libgcc.a!"
|
print "Warning: Couldn't find libgcc.a!"
|
||||||
else
|
else
|
||||||
$CP $gcclib libmygcc.a
|
$CP $gcclib $BASE/lib/libmygcc.a
|
||||||
fi
|
fi
|
||||||
cd $SOURCE
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#if we are debugging, do not do tar/gz
|
#if we are debugging, do not do tar/gz
|
||||||
|
@ -353,7 +343,9 @@ fi
|
||||||
# This is needed to prefere gnu tar instead of tar because tar can't
|
# This is needed to prefere gnu tar instead of tar because tar can't
|
||||||
# always handle long filenames
|
# always handle long filenames
|
||||||
|
|
||||||
PATH_DIRS=`echo $PATH | sed -e 's/^:/. /' -e 's/:$/ ./' -e 's/::/ . /g' -e 's/:/ /g' `
|
PATH_DIRS=`echo $PATH | \
|
||||||
|
sed -e 's/^:/. /' -e 's/:$/ ./' -e 's/::/ . /g' -e 's/:/ /g' `
|
||||||
|
|
||||||
which_1 ()
|
which_1 ()
|
||||||
{
|
{
|
||||||
for cmd
|
for cmd
|
||||||
|
@ -362,8 +354,7 @@ which_1 ()
|
||||||
do
|
do
|
||||||
for file in $d/$cmd
|
for file in $d/$cmd
|
||||||
do
|
do
|
||||||
if test -x $file -a ! -d $file
|
if [ -x $file -a ! -d $file ] ; then
|
||||||
then
|
|
||||||
echo $file
|
echo $file
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
@ -378,38 +369,35 @@ if [ $BASE_SYSTEM != "netware" ] ; then
|
||||||
#
|
#
|
||||||
# Create the result tar file
|
# Create the result tar file
|
||||||
#
|
#
|
||||||
|
|
||||||
tar=`which_1 gnutar gtar`
|
tar=`which_1 gnutar gtar`
|
||||||
if test "$?" = "1" -o "$tar" = ""
|
if [ "$?" = "1" -o x"$tar" = x"" ] ; then
|
||||||
then
|
|
||||||
tar=tar
|
tar=tar
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Using $tar to create archive"
|
echo "Using $tar to create archive"
|
||||||
cd $TMP
|
|
||||||
|
|
||||||
OPT=cvf
|
OPT=cvf
|
||||||
if [ x$SILENT = x1 ] ; then
|
if [ x$SILENT = x1 ] ; then
|
||||||
OPT=cf
|
OPT=cf
|
||||||
fi
|
fi
|
||||||
|
|
||||||
$tar $OPT $SOURCE/$NEW_NAME.tar $NEW_NAME
|
echo "Creating and compressing archive"
|
||||||
cd $SOURCE
|
|
||||||
echo "Compressing archive"
|
|
||||||
rm -f $NEW_NAME.tar.gz
|
rm -f $NEW_NAME.tar.gz
|
||||||
gzip -9 $NEW_NAME.tar
|
(cd $TMP ; $tar $OPT - $NEW_NAME) | gzip -9 > $NEW_NAME.tar.gz
|
||||||
echo "$NEW_NAME.tar.gz created"
|
echo "$NEW_NAME.tar.gz created"
|
||||||
|
|
||||||
else
|
else
|
||||||
|
|
||||||
#
|
#
|
||||||
# Create a zip file for NetWare users
|
# Create a zip file for NetWare users
|
||||||
#
|
#
|
||||||
|
|
||||||
cd $TMP
|
rm -f $NEW_NAME.zip
|
||||||
if test -e "$SOURCE/$NEW_NAME.zip"; then rm $SOURCE/$NEW_NAME.zip; fi
|
(cd $TMP; zip -r "$SOURCE/$NEW_NAME.zip" $NEW_NAME)
|
||||||
zip -r $SOURCE/$NEW_NAME.zip $NEW_NAME
|
|
||||||
echo "$NEW_NAME.zip created"
|
echo "$NEW_NAME.zip created"
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Removing temporary directory"
|
echo "Removing temporary directory"
|
||||||
rm -r -f $BASE
|
rm -rf $BASE
|
||||||
|
|
Loading…
Reference in a new issue