'Fix up broken EXTRAVERSION in xen-ified Linux kernel Makefile'

def fix_up_xen_kernel_makefile(self, kernel_dir):

    xenguest = ''
    makefile = (kernel_dir + '/Makefile')
    for line in open(makefile, 'r').readlines():
        if line.startswith('XENGUEST'):
            start = (line.index('=') + 1)
            xenguest = line[start:].strip()
            break
    utils.system(('sed    -i.old    "s,\\$(XENGUEST),%s,"    %s' % (xenguest, makefile)))
