1
0
mirror of https://codeberg.org/kiss-community/kiss synced 2024-12-25 08:30:05 -07:00

kiss: minor changes

This commit is contained in:
Dylan Araps 2020-05-19 10:37:30 +03:00
parent 0abc6be41d
commit 724d393bb1
No known key found for this signature in database
GPG Key ID: 46D62DD9F1DE636E

22
kiss
View File

@ -127,10 +127,6 @@ pkg_lint() {
[ ! -f sources ] || [ "$2" ] || [ -f checksums ] || [ ! -f sources ] || [ "$2" ] || [ -f checksums ] ||
die "$1" "Checksums are missing" die "$1" "Checksums are missing"
case $PWD in "$KISS_ROOT/var/db/kiss/installed"*)
war "$1" "no longer exists in the repositories"
esac
} }
pkg_find() { pkg_find() {
@ -166,9 +162,6 @@ pkg_list() {
# List installed packages. As the format is files and # List installed packages. As the format is files and
# directories, this just involves a simple for loop and # directories, this just involves a simple for loop and
# file read. # file read.
# Change directories to the database. This allows us to
# avoid having to 'basename' each path.
cd "$sys_db" 2>/dev/null cd "$sys_db" 2>/dev/null
# Optional arguments can be passed to check for specific # Optional arguments can be passed to check for specific
@ -1017,8 +1010,6 @@ pkg_install_files() {
*) test "$1" "$KISS_ROOT/$line" || *) test "$1" "$KISS_ROOT/$line" ||
# Treat symlinks differently as the 'install' command
# will resolve them (we don't want this).
if [ -h "$2/$line" ]; then if [ -h "$2/$line" ]; then
# Skip symlinks which already exist as directories. # Skip symlinks which already exist as directories.
# (Think baselayout being updated) # (Think baselayout being updated)
@ -1111,12 +1102,15 @@ pkg_remove() {
fi fi
while read -r file; do while read -r file; do
# The file is in '/etc' skip it. This prevents the package # Skip removal of files in /etc/.
# manager from removing user edited configuration files. if [ -z "${file##/etc/*}" ]; then
[ "${file##/etc/*}" ] || continue continue
if [ -d "$KISS_ROOT/$file" ]; then # Directories.
rmdir "$KISS_ROOT/$file" 2>/dev/null || continue elif [ -d "$KISS_ROOT/$file" ]; then
rmdir "$KISS_ROOT/$file" 2>/dev/null ||:
# Everything else.
else else
rm -f "$KISS_ROOT/$file" rm -f "$KISS_ROOT/$file"
fi fi