2 |
# Magellan Linux Installer (mage.sh) |
# Magellan Linux Installer (mage.sh) |
3 |
# $Id$ |
# $Id$ |
4 |
|
|
5 |
# default die function |
# set default variables |
6 |
die() |
: ${MAGERC="@@SYSCONFDIR@@/mage.rc"} |
7 |
{ |
: ${MLIBDIR="@@MAGELIBDIR@@"} |
8 |
xtitleclean |
|
9 |
mqueryfeature "debug" && echo -e ${COLRED}"Exited ${BASH_SOURCE} at line no ${BASH_LINENO}."${COLDEFAULT} |
# first of all include common functions |
10 |
echo -e ${COLRED}"$@"${COLDEFAULT} |
source ${MLIBDIR}/common.functions.sh |
11 |
exit 1 |
source @@SYSCONFDIR@@/mage.rc.global |
12 |
} |
source ${MAGERC} |
13 |
|
source ${MLIBDIR}/mage4.functions.sh |
|
# include all needed files |
|
|
[ -f /etc/mage.rc.global ] && \ |
|
|
source /etc/mage.rc.global || \ |
|
|
die "/etc/mage.rc.global missing" |
|
|
|
|
|
[ -f ${MAGERC} ] && source ${MAGERC} || \ |
|
|
die "Your ${MAGERC} is missing. Aborting." |
|
|
|
|
|
[ -f ${MLIBDIR}/mage4.functions.sh ] && \ |
|
|
source ${MLIBDIR}/mage4.functions.sh || \ |
|
|
die "mage functions missing" |
|
14 |
|
|
15 |
# export default path |
# export default path |
16 |
export PATH="${PATH}:${MLIBDIR}" |
export PATH="${PATH}:${MLIBDIR}" |
33 |
fi |
fi |
34 |
|
|
35 |
# default messages |
# default messages |
|
showversion() |
|
|
{ |
|
|
local MAGEVERSION="$(< ${MLIBDIR}/version)" |
|
|
|
|
|
echo -en "Magellan Package Manager v${MAGEVERSION} " |
|
|
echo -e "-- Niels Rogalla (niro@magellan-linux.de)" |
|
|
} |
|
|
|
|
36 |
print_usage() |
print_usage() |
37 |
{ |
{ |
38 |
#showversion |
#showversion |