Add pkg_info to PackageIsInstalled

The `pkg_info` command is used on a system using NetBSD pkgsrc to
determine which packages are installed.
This commit is contained in:
Brian Ginsbach 2020-03-30 14:12:36 -05:00
parent 2b1d5fa46f
commit eb7dbab1ee
1 changed files with 3 additions and 0 deletions

View File

@ -2041,6 +2041,9 @@
elif [ -n "${PKG_BINARY}" ]; then elif [ -n "${PKG_BINARY}" ]; then
output=$(${PKG_BINARY} -N info ${package} >/dev/null 2>&1) output=$(${PKG_BINARY} -N info ${package} >/dev/null 2>&1)
exit_code=$? # 0=package installed, 70=invalid package exit_code=$? # 0=package installed, 70=invalid package
elif [ -n "${PKGINFOBINARY}" ]; then
output=$(${PKGINFOBINARY} -q -e ${package} >/dev/null 2>&1)
exit_code=$? # 0=package installed, 1=package not installed
elif [ -n "${RPMBINARY}" ]; then elif [ -n "${RPMBINARY}" ]; then
output=$(${RPMBINARY} --quiet -q ${package} > /dev/null 2>&1) output=$(${RPMBINARY} --quiet -q ${package} > /dev/null 2>&1)
exit_code=$? exit_code=$?