kiss: simplify

This commit is contained in:
Dylan Araps 2020-02-06 14:24:21 +02:00
parent 428a388c39
commit eb2b2a08e0
No known key found for this signature in database
GPG Key ID: 46D62DD9F1DE636E

9
kiss
View File

@ -773,20 +773,16 @@ pkg_conflicts() {
sed -i "$(esc "$con" "/$cho_dir/$p_name$con_name")" \ sed -i "$(esc "$con" "/$cho_dir/$p_name$con_name")" \
"$tar_dir/$p_name/$pkg_db/$p_name/manifest" "$tar_dir/$p_name/$pkg_db/$p_name/manifest"
done done
else
if "$grep" -Fxf "$cac_dir/$pid-m" -- "$@"; then elif "$grep" -Fxf "$cac_dir/$pid-m" -- "$@"; then
log "Package '$p_name' conflicts with another package" "" "!>" log "Package '$p_name' conflicts with another package" "" "!>"
log "Run 'KISS_CHOICE=1 kiss i $p_name' to add conflicts" "" "!>" log "Run 'KISS_CHOICE=1 kiss i $p_name' to add conflicts" "" "!>"
die "as alternatives." die "as alternatives."
fi fi
fi
} }
pkg_swap() { pkg_swap() {
# Swap between package alternatives. # Swap between package alternatives.
# Check to see if the package is installed. This
# will exit with an error if it is not.
pkg_list "$1" >/dev/null pkg_list "$1" >/dev/null
alt=$(printf %s "$1$2" | sed 's|/|>|g') alt=$(printf %s "$1$2" | sed 's|/|>|g')
@ -829,7 +825,6 @@ pkg_remove() {
# Remove a package and all of its files. The '/etc' directory # Remove a package and all of its files. The '/etc' directory
# is handled differently and configuration files are *not* # is handled differently and configuration files are *not*
# overwritten. # overwritten.
pkg_list "$1" >/dev/null || return pkg_list "$1" >/dev/null || return
# Enable globbing. # Enable globbing.