From e0b0a089133878a29135cbcffe52ae3cc5baa92c Mon Sep 17 00:00:00 2001 From: piterpunk Date: Wed, 5 Apr 2023 20:16:31 -0300 Subject: [PATCH] Detects if installed system is Slackware Current If the installed system is Slackware Current, creates the `/var/lib/slackpkg/current` file by default, saving the user from being asked about using a `current` mirror in a Slackware stable install. --- files/core-functions.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/files/core-functions.sh b/files/core-functions.sh index 8245478..4a58cd8 100644 --- a/files/core-functions.sh +++ b/files/core-functions.sh @@ -64,6 +64,12 @@ function system_setup() { # Create $WORKDIR just in case mkdir -p "${WORKDIR}" + # Set the "current" flag if system is running Slackware Current + if [ -n "$(echo $SLACKWARE_VERSION | sed -ne 's/.*\(+\|current\)$/\1/pi')" ] && \ + [ ! -e ${WORKDIR}/current ]; then + touch ${WORKDIR}/current + fi + # Select the command to fetch files and packages from network sources if [ "$DOWNLOADER" = "curl" ]; then DOWNLOADER="curl ${CURLFLAGS} -o" @@ -188,7 +194,7 @@ as example or overwrite it with slackpkg.conf.new.\n\ if [ "$ARCH" = "none" ] && [ "$CMD" != "new-config" ]; then echo -e "\ \nThe ARCH values in slackpkg.conf are now different. You can remove\n\ -ARCH from there, and slackpkg you use your current ARCH or you can look\n\ +ARCH from there, and slackpkg will use your current ARCH or you can look\n\ at slackpkg.conf.new or slackpkg.conf manual page to see the new valid\n\ ARCH values\n" cleanup