diff options
author | dylan.araps@gmail.com <dylan.araps@gmail.com> | 2020-01-28 15:00:29 +0000 |
---|---|---|
committer | dylan.araps@gmail.com <dylan.araps@gmail.com> | 2020-01-28 15:00:29 +0000 |
commit | 32fb9d3f1990059f186d98e597ff4fcc17663230 (patch) | |
tree | 287153e54dab89aae5b4a9687b0d463078d7cb6c /kiss | |
parent | 02c335880dc2b19514af9ca70d6cd05f4b656a6a (diff) | |
download | cpt-32fb9d3f1990059f186d98e597ff4fcc17663230.tar.gz |
kiss: Make alternatives opt in
FossilOrigin-Name: 01828dc7d2aa4bc8a78bc23a35d104953f744258add9011fefae769cf58acbaf
Diffstat (limited to 'kiss')
-rwxr-xr-x | kiss | 14 |
1 files changed, 11 insertions, 3 deletions
@@ -771,15 +771,17 @@ pkg_conflicts() { shift "$(($# ? 1 : 0))" - [ "$p_name" != "$i_name" ] || continue + [ "$p_name" = "$i_name" ] && continue set -- "$@" "$pkg" done + [ -s "$cac_dir/$pid-m" ] || return 0 + # Use 'grep' to list matching lines between the to # be installed package's manifest and the above filtered # list. - [ -s "$cac_dir/$pid-m" ] && { + if [ "$KISS_CHOICE" ]; then "$grep" -Fxf "$cac_dir/$pid-m" -- "$@" | # This is a novel way of offering an "alternatives" system. @@ -826,7 +828,13 @@ pkg_conflicts() { sed -i "s/$sea/$rep/" \ "$tar_dir/$p_name/$pkg_db/$p_name/manifest" done - } + else + if "$grep" -Fxf "$cac_dir/$pid-m" -- "$@"; then + log "Package '$p_name' conflicts with another package" "" "!>" + log "Run 'KISS_CHOICE=1 kiss i $p_name' to add conflicts" "" "!>" + die "as alternatives." + fi + fi } pkg_swap() { |