configure: Refactor main function to make testing easier

Signed-off-by: Euan Harris <euan.harris@citrix.com>
configure: Extract build steps from main to aid testing

Signed-off-by: Euan Harris <euan.harris@citrix.com>
configure: Handle packages with multiple sources

Signed-off-by: Euan Harris <euan.harris@citrix.com>
configure: Add last resort paths in locate_repo

If repo cannot be found in the mirror directories,
try the provided path and the current directory.

Signed-off-by: Euan Harris <euan.harris@citrix.com>
configure: CentOS 6.5's git-archive cannot create a tar.gz

Signed-off-by: Euan Harris <euan.harris@citrix.com>
configure: Use the correct path when clearing out SOURCES

Signed-off-by: Euan Harris <euan.harris@citrix.com>
configure: Use number of commits as repository version if no tags are found

Signed-off-by: Euan Harris <euan.harris@citrix.com>
Merge pull request #46 from euanh/patchqueue

Handle multiple sources and patch queues