Fixed up admin scripts.
Signed-off-by: Jan Vidar Krey <janvidar@extatic.org>
This commit is contained in:
parent
f0938e8afa
commit
3a270564d2
@ -6,15 +6,22 @@ else
|
|||||||
HOST_MACHINE=`uname -m | tr [:upper:] [:lower:] | sed s/i686/i386/ | sed s/x86_64/amd64/ | sed s/ppc64/powerpc/`
|
HOST_MACHINE=`uname -m | tr [:upper:] [:lower:] | sed s/i686/i386/ | sed s/x86_64/amd64/ | sed s/ppc64/powerpc/`
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
BINSUFFIX=
|
||||||
|
|
||||||
if [ "${HOST_SYSTEM}" = "mingw32_nt-5.1" ]; then
|
if [ "${HOST_SYSTEM}" = "mingw32_nt-5.1" ]; then
|
||||||
HOST_SYSTEM=win32
|
HOST_SYSTEM=win32
|
||||||
BINARY=uhub.exe
|
BINSUFFIX=.exe
|
||||||
WANTZIP=1
|
WANTZIP=1
|
||||||
else
|
else
|
||||||
WANTZIP=0
|
WANTZIP=0
|
||||||
BINARY=uhub
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
MAKE=make
|
||||||
|
BINARY=uhub${BINSUFFIX}
|
||||||
|
|
||||||
|
if [ "${HOST_SYSTEM}" = "FreeBSD" ]; then
|
||||||
|
MAKE=gmake
|
||||||
|
fi
|
||||||
|
|
||||||
VERSION=`grep define\ VERSION version.h | cut -f 3 -d " " | tr -d [=\"=]`
|
VERSION=`grep define\ VERSION version.h | cut -f 3 -d " " | tr -d [=\"=]`
|
||||||
SNAPSHOT=`date '+%Y%m%d'`
|
SNAPSHOT=`date '+%Y%m%d'`
|
||||||
@ -51,15 +58,23 @@ function package_zips
|
|||||||
gzip -c -9 $1.tar > $1.tar.gz
|
gzip -c -9 $1.tar > $1.tar.gz
|
||||||
bzip2 -c -9 $1.tar > $1.tar.bz2
|
bzip2 -c -9 $1.tar > $1.tar.bz2
|
||||||
rm -f $1.tar
|
rm -f $1.tar
|
||||||
zip -q -9 -r $1.zip $2
|
|
||||||
|
if [ $WANTZIP -eq 1 ]; then
|
||||||
|
zip -q -9 -r $1.zip $2
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
function export_sources
|
function export_sources
|
||||||
{
|
{
|
||||||
export_source_directory
|
if [ ! -d ${PACKAGE} ]; then
|
||||||
make autotest.c && cp autotest.c ${PACKAGE}/autotest.c
|
export_source_directory
|
||||||
rm -Rf ${PACKAGE}/admin
|
fi
|
||||||
|
|
||||||
|
cd ${PACKAGE}
|
||||||
|
${MAKE} autotest.c
|
||||||
|
|
||||||
|
cd ..
|
||||||
|
rm -Rf ${PACKAGE}/admin
|
||||||
package_zips ${PACKAGE_SRC} ${PACKAGE}
|
package_zips ${PACKAGE_SRC} ${PACKAGE}
|
||||||
|
|
||||||
rm -Rf ${PACKAGE};
|
rm -Rf ${PACKAGE};
|
||||||
@ -68,24 +83,31 @@ function export_sources
|
|||||||
|
|
||||||
function export_binaries
|
function export_binaries
|
||||||
{
|
{
|
||||||
export_source_directory
|
if [ ! -d ${PACKAGE} ]; then
|
||||||
|
export_source_directory
|
||||||
|
fi
|
||||||
|
|
||||||
|
cd ${PACKAGE}
|
||||||
|
${MAKE} RELEASE=YES
|
||||||
|
|
||||||
|
if [ ! -x ${BINARY} ]; then
|
||||||
|
echo "Packaging failed, no binary found..."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
cd ..
|
||||||
|
|
||||||
rm -Rf ${PACKAGE}/admin
|
rm -Rf ${PACKAGE}/admin
|
||||||
rm -Rf ${PACKAGE}/autotest
|
rm -Rf ${PACKAGE}/autotest
|
||||||
rm -Rf ${PACKAGE}/src
|
rm -Rf ${PACKAGE}/src
|
||||||
|
rm -Rf ${PACKAGE}/debian
|
||||||
rm -f ${PACKAGE}/autotest.c
|
rm -f ${PACKAGE}/autotest.c
|
||||||
rm -f ${PACKAGE}/*akefile
|
rm -f ${PACKAGE}/*akefile
|
||||||
rm -f ${PACKAGE}/version.h
|
rm -f ${PACKAGE}/version.h
|
||||||
rm -f ${PACKAGE}/doc/Doxyfile
|
rm -f ${PACKAGE}/doc/Doxyfile
|
||||||
rm -f ${PACKAGE}/doc/uhub.dot
|
rm -f ${PACKAGE}/doc/uhub.dot
|
||||||
|
rm -f ${PACKAGE}/libuhub*
|
||||||
|
|
||||||
make
|
|
||||||
|
|
||||||
if [ -x ${BINARY} ]; then
|
|
||||||
cp ${BINARY} ${PACKAGE}
|
|
||||||
else
|
|
||||||
echo "No binary found!"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
package_zips ${PACKAGE_BIN} ${PACKAGE}
|
package_zips ${PACKAGE_BIN} ${PACKAGE}
|
||||||
|
|
||||||
|
@ -2,8 +2,7 @@
|
|||||||
|
|
||||||
# set -x
|
# set -x
|
||||||
|
|
||||||
ME=`dirname $0`
|
. admin/common.sh
|
||||||
. ${ME}/common.sh
|
|
||||||
|
|
||||||
# Git Export
|
# Git Export
|
||||||
export_source_directory
|
export_source_directory
|
||||||
|
@ -2,8 +2,7 @@
|
|||||||
|
|
||||||
# set -x
|
# set -x
|
||||||
|
|
||||||
ME=`dirname $0`
|
. admin/common.sh
|
||||||
. ${ME}/common.sh
|
|
||||||
|
|
||||||
# Git Export
|
# Git Export
|
||||||
export_sources
|
export_sources
|
||||||
|
@ -114,6 +114,7 @@ int main_loop()
|
|||||||
if (hub)
|
if (hub)
|
||||||
{
|
{
|
||||||
hub_log(log_info, "Reloading configuration files...");
|
hub_log(log_info, "Reloading configuration files...");
|
||||||
|
hub_log(log_debug, "Hub status: %d", (int) hub->status);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (read_config(arg_config, &configuration, !arg_have_config) == -1)
|
if (read_config(arg_config, &configuration, !arg_have_config) == -1)
|
||||||
|
Loading…
Reference in New Issue
Block a user