summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDidier Spaier <didier@slint.fr>2018-01-06 17:15:01 -0600
committerRobby Workman <rworkman@slackware.com>2018-01-06 17:53:46 -0600
commitb6cf5ec58c344e22e664424a848dba2d737ebfc9 (patch)
tree98ccbc8fc9de0cf2dfe232cced8153fb5853c3e3
parent14ce3da94e77745d0cf5bb7d69b628f0c8f78e67 (diff)
downloadslackpkg-b6cf5ec58c344e22e664424a848dba2d737ebfc9.tar.xz
core-functions.sh: Warn (first time) if -current mirror is selected
Require confirmation the first time a -current mirror is selected.
-rw-r--r--files/core-functions.sh32
1 files changed, 25 insertions, 7 deletions
diff --git a/files/core-functions.sh b/files/core-functions.sh
index 4da06a5..f71259d 100644
--- a/files/core-functions.sh
+++ b/files/core-functions.sh
@@ -253,16 +253,34 @@ Before you install|upgrade|reinstall anything you need to run:\n\n\
Please edit that file and uncomment ONE mirror. Slackpkg\n\
only works with ONE mirror selected.\n"
cleanup
- else
- COUNT=$(echo $SOURCE | wc -w | tr -d " ")
- if [ "$COUNT" != "1" ]; then
- echo -e "\n\
-Slackpkg only works with ONE mirror selected. Please edit your\n\
-${CONF}/mirrors and comment all but one line - two or more\n\
-mirrors uncommented is not valid syntax.\n"
+ fi
+ if echo $SOURCE|grep -q " "; then
+ echo "
+Slackpkg only works with ONE mirror selected. Please edit your
+${CONF}/mirrors and comment all but one line - two or more
+mirrors uncommented is not valid syntax.
+"
+ cleanup
+ fi
+ MIRROR_VERSION=$(echo $SOURCE|sed "s/.*-//;s/.$//")
+ if [ "$MIRROR_VERSION" = "current" ] && [ ! -f ${ROOT}/${WORKDIR}/current ]; then
+ echo -n "
+You have selected a mirror for Slackware -current in ${CONF}/mirrors,
+but Slackware version $SLACKWARE_VERSION appears to be installed.
+
+Slackware -current is the development (i.e. unstable) tree.
+
+Is this really what you want?
+
+To confirm your choice, press Y, else press N. Then, press Enter: "
+ read current
+ if [ "$current" = "Y" ] || [ "$current" = "y" ]; then
+ touch ${ROOT}/${WORKDIR}/current
+ else
cleanup
fi
fi
+ [ ! "$MIRROR_VERSION" = "current" ] && rm -f ${ROOT}/${WORKDIR}/current
# It will check if the mirror selected are ftp.slackware.com
# if set to "ftp.slackware.com" tell the user to choose another