kiss: fix possible KISS_ROOT usage

If the user defines KISS_ROOT to / or anything that ends
with '/', some functions will not work as intended (like fixdeps).
This removes the '/' at the very end, if it exists.

Signed-off-by: Dylan Araps <dylan.araps@gmail.com>
This commit is contained in:
Cem Keylan 2020-04-15 11:26:43 +03:00 committed by Dylan Araps
parent a6b79b79da
commit a0f0b8b5ad

4
kiss
View File

@ -1325,6 +1325,10 @@ main() {
# This is used enough to warrant a place here.
uid=$(id -u)
# Make sure that the KISS_ROOT doesn't end with a '/'. This might
# break some operations.
KISS_ROOT=${KISS_ROOT%/}
# This allows for automatic setup of a KISS chroot and will
# do nothing on a normal system.
mkdir -p "${sys_db:=$KISS_ROOT/$pkg_db}" 2>/dev/null ||: