You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
76 lines
1.8 KiB
76 lines
1.8 KiB
#
|
|
# Copyright (c) 2005, Petteri Räty <betelgeuse@gentoo.org>
|
|
# Copyright (c) 2004, Jochen Maes <sejo@gentoo.org>
|
|
# Copyright (c) 2004, Karl Trygve Kalleberg <karltk@gentoo.org>
|
|
# Copyright (c) 2004, Gentoo Foundation
|
|
#
|
|
# Licensed under the GNU General Public License, v2
|
|
|
|
# The Azureus config dir has moved
|
|
olddotazudir="${HOME}/.Azureus"
|
|
oldgentoocfg="${olddotazudir}/gentoo.config"
|
|
dotazudir="${HOME}/.azureus"
|
|
gentoocfg="${dotazudir}/gentoo.config"
|
|
|
|
if [[ -f "${oldgentoocfg}" && -f "${gentoocfg}" ]]; then
|
|
cat > /dev/stderr <<END
|
|
You have gentoo.config files in both
|
|
${dotazudir} and
|
|
${olddotazudir}
|
|
${olddotazudir} is deprecated and you can delete this directory.
|
|
|
|
END
|
|
fi
|
|
|
|
create_initial_config() {
|
|
if [[ ! -e "${dotazudir}" ]] ; then
|
|
mkdir "${dotazudir}"
|
|
echo "Creating ${dotazudir}"
|
|
fi
|
|
|
|
[[ ${UI} ]] && UI="swt"
|
|
|
|
echo "Creating ${gentoocfg}"
|
|
|
|
# Create the config file
|
|
cat > "${gentoocfg}" <<END
|
|
# User Interface options:
|
|
# console - console based
|
|
# swt - swt (GUI) based
|
|
UI="${UI}"
|
|
|
|
# Options you want to pass to the java binary
|
|
JAVA_OPTIONS=""
|
|
END
|
|
}
|
|
|
|
if [[ -f "${gentoocfg}" ]] ; then
|
|
. "${gentoocfg}"
|
|
echo "using ${gentoocfg}"
|
|
elif [[ -f "${oldgentoocfg}" ]]; then
|
|
. "${oldgentoocfg}"
|
|
echo "using ${oldgentoocfg}"
|
|
else
|
|
create_initial_config
|
|
fi
|
|
|
|
if [[ -z "${UI}" && -n "${UI_OPTIONS}" ]]; then
|
|
echo '${UI_OPTIONS} is no longer supported. ${UI} should be used instead instead' > /dev/stderr
|
|
echo 'Unsetting ${UI_OPTIONS} and trying to migrate to ${UI}' > /dev/stderr
|
|
if [[ ${UI_OPTIONS} = *--ui=console* ]]; then
|
|
UI=console
|
|
elif [[ ${UI_OPTIONS} = *--ui=swt* ]]; then
|
|
UI=swt
|
|
else
|
|
echo 'Could not make $UI from $UI_OPTIONS' > /dev/stderr
|
|
fi
|
|
unset UI_OPTIONS
|
|
fi
|
|
|
|
if [[ -z "${UI}" ]]; then
|
|
echo '$UI not set defaulting to swt' > /dev/stderr
|
|
UI="swt"
|
|
fi
|
|
|
|
[[ ! -e "${dotazudir}" ]] && create_initial_config
|