Browse Source

migratekde3: Refresh script (a bit) to be accorded with the changes made for the starttde and the r14-xdg-update script

Signed-off-by: Matías Fonzo <selk@dragora.org>
pull/138/head
Matías Fonzo 8 months ago
parent
commit
5ae691eb44
No known key found for this signature in database GPG Key ID: 3AAF1CEC203A99D5
1 changed files with 19 additions and 28 deletions
  1. +19
    -28
      migratekde3

+ 19
- 28
migratekde3 View File

@@ -38,24 +38,25 @@

Wait_For_Response () {
unset response
# -r Backslash does not act as an escape character.
# -p Display "PROMPT" without a trailing newline, before attempting to read any input.
while true; do
read -r -p "$1 (y/n): " yn
case $yn in
[Yy]* ) response=y; break;;
[Nn]* ) response=n; break;;
* ) echo "Please answer yes (y/Y) or no (n/N).";;
printf "%s" "$1 (y/n): " > /dev/tty
IFS= read -r ANSWER < /dev/tty || exit 1;
case $ANSWER in
y* | Y* ) response=y; break;;
n* | N* ) response=n; break;;
* ) echo "Please answer yes (y/Y) or no (n/N)." > /dev/tty;;
esac
done
unset ANSWER
}

Proceed_From_Response () {
if [ "$response" = "n" -o "$response" = "N" ]; then
if [ "$response" = "n" ]; then
echo "Exiting."
echo
exit 0
else
unset response
echo "Continuing."
echo
fi
@@ -107,28 +108,20 @@ fi
# To determine that location use the following method rather than presuming
# the existence of $TDEDIR. That environment variable might not be
# defined or defined to point to KDE4 binaries.
BIN_DIR="`dirname \`readlink -f $0\``"
if [ -x $BIN_DIR/tde-config ]; then
TDE_VERSION="`$BIN_DIR/tde-config --version | grep TDE | awk '{print $2}'`"
BIN_DIR="$(dirname -- "$0")"
if [ -x ${BIN_DIR}/tde-config ]; then
TDE_VERSION="$( ${BIN_DIR}/tde-config --version | sed -n 's|^TDE: ||p' )"
TDEDIR="${BIN_DIR%/bin}"
echo "Trinity Desktop Environment version is $TDE_VERSION" 1>&2
export TDEDIR=${BIN_DIR%/bin}
echo "Trinity Desktop Environment base directory is $TDEDIR" 1>&2
else
# This might be a Trinity version before kde-config was renamed to tde-config.
# Don't use kde-config because of a bug that always creates a $TDEHOME directory.
if [ -x $BIN_DIR/konqueror ]; then
TDE_VERSION="`$BIN_DIR/konqueror --version | grep KDE | awk '{print $2}'`"
echo "Trinity Desktop Environment version is $TDE_VERSION" 1>&2
export TDEDIR=${BIN_DIR%/bin}
echo "Trinity Desktop Environment base directory is $TDEDIR" 1>&2
else
echo "Unable to determine the TDE bin directory, where this script should be installed."
echo "This script should be installed in the same directory."
echo "Exiting."
exit 1
fi
echo "Unable to determine the TDE bin directory, where this script should be installed."
echo "This script should be installed in the same directory."
echo "Exiting."
exit 1
fi
unset BIN_DIR
unset BIN_DIR TDE_VERSION
export TDEDIR

# Trap when the user runs this script while in a Trinity session.
# Most files can be updated "live" but some can't, such as kdeglobals.
@@ -469,8 +462,6 @@ unset LINK_NAME
unset AVAILABLE
unset PROFILE_SIZE
unset REMAINING_SPACE
unset BIN_DIR
unset TDE_VERSION
unset TDEHOME_LINK
unset CACHE_DIR
unset SOCKET_DIR


Loading…
Cancel
Save