Commit 203a062f authored by TotallyNotElite's avatar TotallyNotElite

Make optrem dependencies get marked --asdeps, make installed deps get marked as --asexplicit

Fixes some edge cases, allows the user to decide on their own accord if they still need an OPTREM dependency when they remove orphans
parent 8e5b886f
......@@ -305,6 +305,11 @@ if [ "${INSTALL}" == "true" ]; then
echo "Error: pacman failed!"
exit 1
fi
${PACMAN} -D --asexplicit ${PACKAGES}
if [ "$?" -ne "0" ]; then
echo "Error: pacman failed!"
exit 1
fi
fi
# Run postinstall function
......@@ -372,14 +377,13 @@ if [ "${REMOVE}" == "true" ]; then
fi
fi
for PKG in "${OPTREMPACKAGES}"
do
# Check if package is needed anywhere, otherwise remove packages
# Usage of -Rsu is not enough, since pacman doesn't consider optional dependencies
if [ "$(pacman -Qi ${PKG} | egrep "Required By|Optional For" | awk '{ print $4}' | grep -v 'None')" == "" ]; then
PACKAGES="${PACKAGES} ${PKG}"
if [ "${OPTREMPACKAGES}" != "" ]; then
${PACMAN} -D --asdeps ${OPTREMPACKAGES}
if [ "$?" -ne "0" ]; then
echo "Error: pacman failed!"
exit 1
fi
done
fi
# Check if packages are installed
MHWD_CHECK_PKGS
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment