and removed yum case from list_package, which was redundant.
and fixed the screensaver setup script to use seek_package, so it's an exact check now. sweet.
exit $?
fi
-yum_available="$(whichable yum)"
-if [ ! -z "$yum_available" ]; then
- yum list | eval $SEEK_PIECE
- exit $?
-fi
+# yum should never be available if rpm was not!
+#yum_available="$(whichable yum)"
+#if [ ! -z "$yum_available" ]; then
+# yum list | eval $SEEK_PIECE
+# exit $?
+#fi
echo "Could not deduce what type of OS this is; missing package listing commands."
exit 1
+
--- /dev/null
+#!/usr/bin/env bash
+
+source "$FEISTY_MEOW_SCRIPTS/core/functions.sh"
+
+if [ -z "$*" ]; then
+ echo This script requires a package name to find in the installed list of packages.
+ exit 1
+fi
+
+if debian_like; then
+ apt -qq list "$1" 2>/dev/null | grep -q '[installed]'
+ret=$?
+echo ret from seeking actual is $ret
+exit $ret
+
+ exit $?
+fi
+
+rpm_available="$(whichable rpm)"
+if [ ! -z "$rpm_available" ]; then
+ rpm -q --queryformat %{NAME} -p "$1"
+#hmmm: this is probably noisy, but we need an rpm system to test on.
+ exit $?
+fi
+
+# yum should never be available if rpm was not!
+#yum_available="$(whichable yum)"
+#if [ ! -z "$yum_available" ]; then
+# yum list | eval $SEEK_PIECE
+# exit $?
+#fi
+
+echo "Could not deduce what type of OS this is; missing package listing commands."
+exit 1
+
# tests whether the package name provided as a parameter is already installed on the host.
function check_installed()
{
- bash $FEISTY_MEOW_SCRIPTS/system/list_packages.sh "$1" &>/dev/null
+ bash $FEISTY_MEOW_SCRIPTS/system/seek_package.sh "$1" &>/dev/null
+out=$?
+echo out is $out on the seek
+return $out
+
+ return $?
}
# checks whether the provided package is already present, and if not, installs it.
-#hmmm: only works with apt based systems currently!
-#hmmm: list_packages is an inexact check! it will match xscreensaver-data for xscreensaver as pattern!!!
+#hmmm: the below code only works with apt based systems currently!
function install_if_missing()
{
packname="$1"; shift