summaryrefslogtreecommitdiffstats
path: root/migratekde3
diff options
context:
space:
mode:
authorMatías Fonzo <[email protected]>2020-03-23 18:16:50 -0300
committerMichele Calgaro <[email protected]>2020-03-25 12:05:44 +0900
commit94f0f4dbcef761256a7eeeded83894ed3bb03660 (patch)
tree00f7917cbef4f4e9c07429d9b3e8cabb28356fed /migratekde3
parent313064bbff5ed53e9f9a628e30168cf8d9d00a98 (diff)
downloadtdebase-94f0f4dbcef761256a7eeeded83894ed3bb03660.tar.gz
tdebase-94f0f4dbcef761256a7eeeded83894ed3bb03660.zip
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 <[email protected]> (cherry picked from commit 5ae691eb44a0f9a6e41b3bd1a4c7eeda4b66d935)
Diffstat (limited to 'migratekde3')
-rwxr-xr-xmigratekde347
1 files changed, 19 insertions, 28 deletions
diff --git a/migratekde3 b/migratekde3
index eff7f182e..ea2334bd4 100755
--- a/migratekde3
+++ b/migratekde3
@@ -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