1
0
mirror of https://codeberg.org/kiss-community/kiss synced 2024-11-04 14:05:41 -07:00

kiss: clean up conflicts

This commit is contained in:
Dylan Araps 2021-07-17 11:31:29 +03:00
parent cec912a496
commit 029da210b9
No known key found for this signature in database
GPG Key ID: 13295DAC2CF13B5C

13
kiss
View File

@ -992,7 +992,6 @@ pkg_conflicts() {
done < "$tar_dir/$1/$pkg_db/$1/manifest" > "$_tmp_file_pre"
cd "$tar_dir/$1"
p_name=$1
set +f
set -f "$sys_db"/*/manifest
@ -1053,7 +1052,7 @@ pkg_conflicts() {
# Create the "choices" directory inside of the tarball.
# This directory will store the conflicting file.
mkdir -p "$tar_dir/$p_name/$cho_db"
mkdir -p "$PWD/$cho_db"
# Construct the file name of the "db" entry of the
# conflicting file. (pkg_name>usr>bin>ls)
@ -1061,14 +1060,10 @@ pkg_conflicts() {
# Move the conflicting file to the choices directory
# and name it according to the format above.
mv -f "$tar_dir/$p_name$con" \
"$tar_dir/$p_name/$cho_db/$p_name$_fnr" 2>/dev/null || {
mv -f "$PWD$con" "$PWD/$cho_db/$p_name$_fnr" 2>/dev/null || {
log "File must be in ${con%/*} and not a symlink to it"
log "This usually occurs when a binary is installed to"
log "/sbin instead of /usr/bin (example)"
log "Before this package can be used as an alternative,"
log "this must be fixed in $p_name. Contact the maintainer"
die "by finding their details via 'kiss-maintainer'" "" "!>"
die "/sbin instead of /usr/bin (example)"
}
done < "$_tmp_file"
@ -1076,7 +1071,7 @@ pkg_conflicts() {
# Rewrite the package's manifest to update its location
# to its new spot (and name) in the choices directory.
pkg_manifest "$p_name" "$tar_dir" 2>/dev/null
pkg_manifest "$p_name" "$tar_dir"
elif [ -s "$_tmp_file" ]; then
log "Package '$p_name' conflicts with another package" "" "!>"