Added foreign package logic (for packages not installed by pacman).