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 <mauro.giachero@gmail.com>
This commit is contained in:
mauro.giachero 2009-05-07 10:14:19 +00:00
parent 449e2371a9
commit 3ddf3a7067

View file

@ -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