From 82b1594543b7cb140542508e0f0a3e138c8b15a6 Mon Sep 17 00:00:00 2001 From: merakor Date: Sat, 2 May 2020 00:28:32 +0000 Subject: kiss: fix pkg_conflicts for rare cases This fixes pkg_conflicts where there are no packages or only one packages in the system FossilOrigin-Name: b94f9ace5332320d00b255b7b34093885c3c6d4f06da7ea6dc7d56b24c3a2b71 --- kiss | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/kiss b/kiss index 34e6a1e..e59a202 100755 --- a/kiss +++ b/kiss @@ -743,6 +743,17 @@ pkg_conflicts() { [ -s "$cac_dir/$pid-m" ] || return 0 + # In rare cases where the system only has one package installed + # and you are reinstalling that package, grep will try to read from + # standard input if we continue here. + # + # Also, if we don't have any packages installed grep will give an + # error. This will not cause the installation to fail, but we don't + # need to check for conflicts if that's the case anyway. If we have + # only zero packages or one package, just stop wasting time and continue + # with the installation. + [ "$1" ] && [ -f "$1" ] || return 0 + # Enable alternatives automatically if it is safe to do so. # This checks to see that the package that is about to be installed # doesn't overwrite anything it shouldn't in '/var/db/kiss/installed'. -- cgit v1.2.3