kiss: store newline in variable

This commit is contained in:
Dylan Araps 2021-07-16 14:11:03 +03:00
parent 0980dc877d
commit 4517334d8a
No known key found for this signature in database
GPG Key ID: 13295DAC2CF13B5C
1 changed files with 6 additions and 4 deletions

10
kiss
View File

@ -938,8 +938,7 @@ pkg_checksums() {
# Store the generated checksums in a string for use internally # Store the generated checksums in a string for use internally
# without the need for subshells. # without the need for subshells.
_hash="$_hash${_hash:+" _hash="$_hash${_hash:+"$newline"}$hash"
"}$hash"
esac esac
done < "$repo_dir/sources" || die "$1" "Failed to generate checksums" done < "$repo_dir/sources" || die "$1" "Failed to generate checksums"
} }
@ -1635,8 +1634,7 @@ pkg_update() {
# Detect repository orphans (installed packages with no # Detect repository orphans (installed packages with no
# associated repository). # associated repository).
case $repo_dir in */var/db/kiss/installed/*) case $repo_dir in */var/db/kiss/installed/*)
_repo_orp="$_repo_orp _repo_orp="$_repo_orp$newline${pkg##*/}"
${pkg##*/}"
esac esac
# Compare installed packages to repository packages. # Compare installed packages to repository packages.
@ -1922,6 +1920,10 @@ main() {
# in the filesystem. # in the filesystem.
ppwd=$PWD ppwd=$PWD
# Never know when you're gonna need one of these.
newline="
"
# The PID of the current shell process is used to isolate directories # The PID of the current shell process is used to isolate directories
# to each specific KISS instance. This allows multiple package manager # to each specific KISS instance. This allows multiple package manager
# instances to be run at once. Store the value in another variable so # instances to be run at once. Store the value in another variable so