From 029da210b91562cfe8fcca5346992646de1fda50 Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Sat, 17 Jul 2021 11:31:29 +0300 Subject: [PATCH] kiss: clean up conflicts --- kiss | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/kiss b/kiss index 35a73df..500a78e 100755 --- a/kiss +++ b/kiss @@ -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" "" "!>"