From: Richard Maw Date: Thu, 11 Oct 2012 09:45:36 +0000 (+0100) Subject: Don't run debootstrap with empty --include= X-Git-Url: https://git.siccegge.de//index.cgi?a=commitdiff_plain;h=c8b93078a1050b8b198c9198710258c317cb72de;p=forks%2Fvmdebootstrap.git 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. --- 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']