From c8b93078a1050b8b198c9198710258c317cb72de Mon Sep 17 00:00:00 2001 From: Richard Maw Date: Thu, 11 Oct 2012 10:45:36 +0100 Subject: [PATCH] Don't run debootstrap with empty --include= Since the kernel may not be included any more, it is possible to get an empty include list, which debootstrap complains is invalid. To solve this, restructure the runcmd, so that it checks the include list before attempting to add --include to the argument list. --- vmdebootstrap | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/vmdebootstrap b/vmdebootstrap index 2ffe663..37b1b78 100755 --- a/vmdebootstrap +++ b/vmdebootstrap @@ -188,12 +188,11 @@ class VmDebootstrap(cliapp.Application): if self.settings['sudo'] and 'sudo' not in include: include.append('sudo') - self.runcmd(['debootstrap', - '--arch=%s' % self.settings['arch'], - '--include=%s' % ','.join(include), - self.settings['distribution'], - rootdir, - self.settings['mirror']]) + args = ['debootstrap', '--arch=%s' % self.settings['arch']] + if include: args.append('--include=%s' % ','.join(include)) + args += [self.settings['distribution'], + rootdir, self.settings['mirror']] + self.runcmd(args) def set_hostname(self, rootdir): hostname = self.settings['hostname'] -- 2.39.2