Merge pull request #1345 from pyllyukko/pkgtools

Added Slackware support for PackageIsInstalled() function
This commit is contained in:
Michael Boelen 2024-05-14 08:20:30 +02:00 committed by GitHub
commit 308106993d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2086,6 +2086,10 @@
elif [ -n "${PKGINFOBINARY}" ]; then
output=$(${PKGINFOBINARY} -q -e ${package} >/dev/null 2>&1)
exit_code=$? # 0=package installed, 1=package not installed
# Slackware also has RPM for some reason and that's why this test precedes the RPMBINARY test
elif [ "${OS_NAME}" = "Slackware Linux" -a -d "${ROOTDIR}/var/lib/pkgtools/packages" ]; then
output=$( ls ${ROOTDIR}/var/lib/pkgtools/packages/ 2> /dev/null | ${GREPBINARY} "^${package}-[^-]\+-[^-]\+-[^-]\+$" )
exit_code=$?
elif [ -n "${RPMBINARY}" ]; then
output=$(${RPMBINARY} --quiet -q ${package} > /dev/null 2>&1)
exit_code=$?