autotest: bring kernelexpand into a python library

The kernel object allows the user to specify a human name for releases.
The kernel object applied kernelexpand to that name and uses the list
of tarballs and patches to form the kernel source directory.

The current kernelexpand has a number of issues:

1) its a lump of perl in python world,
2) some patches are available from different locations over time and
   once they move we cannot get them,
3) although it allows a mirror to be specified it will not fall back
   to the origin if the mirror fails, and
4) it only can handle a single source and mirror for that source, which
   with things like -rt living elsewhere will be a problem.

This change brings a replacement kernelexpand, as a python library.
Internally it converts the kernel into a sequence of components, for each
there is an ordered list of alternative urls to try in order to locate
it, typically one or two.  A list of local mirror locations is then used
to augment the list for each component with any possible local copies.
Finally, this list is then validated, the first valid entry from each
component is then used.  This means that we will try all locations on any
mirror, then all locations on the master until the component is found.
This means that even if a local mirror is specified, if it is not available
at the time the job runs we will fall back to the master.

This change introduces a new job configuration option mirror.mirrors
which is a list of mirror mappings and the prefix to local image:

	[
	  [ 'http://www.kernel.org/pub/linux/kernel/v2.4',
	    'http://www.example.com/mirror/v2.4' ],
	  [ 'http://www.kernel.org/pub/linux/kernel/v2.6',
	  'http://www.example.com/mirror/v2.6' ],
	  [ 'http://www.kernel.org/pub/linux/kernel/people/akpm/patches',
	  'http://www.example.com/mirror/akpm' ],
	]

For backwards compatibility, if the mirror.ftp_kernel_org is specified this
is used to generate the mirror mappings based on the "current" flattened
mirror.

Signed-off-by: Andy Whitcroft <apw@shadowen.org>
Acked-by: Gustavo Rahal <grahal@br.ibm.com>
Acked-by: Tiago Santos <tsantos@br.ibm.com>


git-svn-id: http://test.kernel.org/svn/autotest/trunk@1296 592f7852-d20e-0410-864c-8624ca9c26a4
4 files changed