From 3ddf3a7067bea9a115a28a41a25e0832c3a0a3b5 Mon Sep 17 00:00:00 2001 From: "mauro.giachero" Date: Thu, 7 May 2009 10:14:19 +0000 Subject: [PATCH] Fix per-user SLACKVER setting. If the user ever created a personal sbopkg.conf file not containing the SLACKVER=... line, the old code would not add it. This patch fixes the code by removing the assignment if it exists, and then unconditionally adding the new one at the end. Signed-off-by: Mauro Giachero --- src/usr/sbin/sbopkg | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/usr/sbin/sbopkg b/src/usr/sbin/sbopkg index 666ed63..21f862a 100755 --- a/src/usr/sbin/sbopkg +++ b/src/usr/sbin/sbopkg @@ -782,10 +782,9 @@ select_version() { break fi if [[ -e $HOME/.sbopkg.conf ]]; then - sed -i "s/^SLACKVER.*$/SLACKVER=$SLACKVER/" $HOME/.sbopkg.conf - else - echo "SLACKVER=$SLACKVER" > $HOME/.sbopkg.conf + sed -i '/^SLACKVER=.*$/d' $HOME/.sbopkg.conf fi + echo "SLACKVER=$SLACKVER" >> $HOME/.sbopkg.conf break done rm -f $SBOPKGTMP/sbopkg_version_selection