Properly check if a package is installed or not.
dpkg-query -s <pkg> returns 0 even when status is "deinstall ok config-files".
Instead, check if the full "Status" string starts with either "install" or "hold".
Replace virtual package names by actual ones.
Remove package with remove instead of autoremove. Run autoremove at the end of post-common.
autoremove is not supposed to take parameters in the first place, and fails to remove uneeded dependencies of the specified packages when --purge is set.
Leverage on autoremove to remove packages that are only needed for building.
This makes the installation faster as we do not need to constantly install/uninstall packages.
Use dpkg-query -l instead of dpkg-query -W.
Fixes after review.
install_mirror_package function for Ubuntu/Debian: fetch package from a different release.
Move package removal/cleanup before user creation.
install_mirror_package: Improve HTML parsing
install_mirror_package: Detect mirror from sources.list.
Merge branch 'install_newer_package' of git://github.com/drinkcat/chroagh
Merge branch 'improve-package-removal' of git://github.com/drinkcat/chroagh

Conflicts:
	targets/post-common
Remove old xdotool dependency.