summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Maw <richard.maw@codethink.co.uk>2012-10-11 10:45:36 +0100
committerRichard Maw <richard.maw@codethink.co.uk>2012-10-11 10:45:36 +0100
commitc8b93078a1050b8b198c9198710258c317cb72de (patch)
treec251b83a216d74667c845a72b59c74bee0dd0247
parent1f23b06cbc7c3e20284ed7d1b0a66a5665ecf1e2 (diff)
downloadvmdebootstrap-c8b93078a1050b8b198c9198710258c317cb72de.tar.gz
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.
-rwxr-xr-xvmdebootstrap11
1 files 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']