forked from kiss-community/kiss
kiss: fix pkg conflicts
This commit is contained in:
parent
98b5cbd75b
commit
c8a29c451e
38
kiss
38
kiss
@ -574,8 +574,6 @@ pkg_conflicts() {
|
|||||||
# Check to see if a package conflicts with another.
|
# Check to see if a package conflicts with another.
|
||||||
log "$2" "Checking for package conflicts"
|
log "$2" "Checking for package conflicts"
|
||||||
|
|
||||||
set +ef
|
|
||||||
|
|
||||||
# Filter the tarball's manifest and select only files
|
# Filter the tarball's manifest and select only files
|
||||||
# and any files they resolve to on the filesystem \
|
# and any files they resolve to on the filesystem \
|
||||||
# (/bin/ls -> /usr/bin/ls).
|
# (/bin/ls -> /usr/bin/ls).
|
||||||
@ -584,20 +582,36 @@ pkg_conflicts() {
|
|||||||
|
|
||||||
printf '%s\n' "$file"
|
printf '%s\n' "$file"
|
||||||
|
|
||||||
(cd "$KISS_ROOT/" && readlink -f "./$file") ||:
|
readlink -f "$KISS_ROOT/$file" ||:
|
||||||
done |
|
done > "$cac_dir/$pid-m"
|
||||||
|
|
||||||
# Filter the existing file list through the manifest of the
|
p_name=$2
|
||||||
# presently installed version of the package (if it exists).
|
|
||||||
grep -svFxf "$sys_db/$2/manifest" - 2>/dev/null > "$cac_dir/$pid-m"
|
|
||||||
|
|
||||||
# If the generated manifest contains matches, check the
|
# Generate a list of all installed package manifests.
|
||||||
# contents for conflicts.
|
set +ef
|
||||||
|
set -f -- "$sys_db"/*/manifest
|
||||||
|
|
||||||
|
# Filter the manifest list and remove the previously
|
||||||
|
# installed version of the package if it exists.
|
||||||
|
for pkg; do
|
||||||
|
i_name=${pkg%/*}
|
||||||
|
i_name=${i_name##*/}
|
||||||
|
|
||||||
|
shift
|
||||||
|
|
||||||
|
[ "$p_name" = "$i_name" ] && continue
|
||||||
|
|
||||||
|
set -- "$@" "$pkg"
|
||||||
|
done
|
||||||
|
|
||||||
|
# Use 'grep' to list matching lines between the to
|
||||||
|
# be installed package's manifest and the above filtered
|
||||||
|
# list.
|
||||||
[ -s "$cac_dir/$pid-m" ] &&
|
[ -s "$cac_dir/$pid-m" ] &&
|
||||||
grep -Fxf "$cac_dir/$pid-m" -- "$sys_db"/*/manifest &&
|
grep -Fxf "$cac_dir/$pid-m" -- "$@" &&
|
||||||
die "Package '$2' conflicts with another package"
|
die "Package '$p_name' conflicts with another package"
|
||||||
|
|
||||||
set -ef
|
set -e
|
||||||
}
|
}
|
||||||
|
|
||||||
pkg_remove() {
|
pkg_remove() {
|
||||||
|
Loading…
Reference in New Issue
Block a user