* Don't trust that the user doesn't have a "test" binary in their
PATH somewhere, and instead use the official golang library to
determine whether or not we're running in a terminal
This moves the config parsing from out of alpm and into the
go-pacmanconf libary plus some boilerplate code to get it into our alpm
config.
This makes sense as many config options such as UseColor and CleanMethod
have nothing to do with alpm and only relate to pacman.
pacman-conf is used instead of direct config parsing. This tool resolves
defaults and includes for us, so we don't need to handle it.
It is now safe to drop all the config parsing from go-alpm.
Normaly we only pass --config to pacman if the user specifies it on the
command line. Otherwise we let pacman use it's default config location.
If the user has changed pacmanconf in Yay's config file then this could
cause a miss match between the config we use to init alpm and the config
pacman is using.
As it turns out, the times you need root also tend to be the time you
need to manipulate the database. So the needWait() function can be
removed and repllaced by needRoot()
* Wait for db.lck to become available before starting a db operation
* Fix err!=nil issues and avoid spamming users
* Remove redundant cases
* Remove return