]> git.siccegge.de Git - forks/vmdebootstrap.git/commitdiff
Don't run debootstrap with empty --include=
authorRichard Maw <richard.maw@codethink.co.uk>
Thu, 11 Oct 2012 09:45:36 +0000 (10:45 +0100)
committerRichard Maw <richard.maw@codethink.co.uk>
Thu, 11 Oct 2012 09:45:36 +0000 (10:45 +0100)
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

index 2ffe6634bb58303aa13241f9f9736e0bb600d149..37b1b78972117d4f90eafed3dc750c0ac9b20ed8 100755 (executable)
@@ -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']