diff options
author | Lars Wirzenius <liw@liw.fi> | 2016-09-11 14:52:05 +0300 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2016-09-11 14:52:05 +0300 |
commit | c14959377eb6e24680e9b532bbae84c9bca68cce (patch) | |
tree | 4607ee97f312355acd77353ee2eef252a17c51b9 /bin/vmdebootstrap | |
parent | 7f76ffc840b9317b0c696cd8699558fb50f5d687 (diff) | |
parent | 509c9fa7943954285c632057b09d782b6c59a328 (diff) | |
download | vmdebootstrap-liw/wdutch.tar.gz |
Merge commit '509c9fa7943954285c632057b09d782b6c59a328' into liw/wdutchliw/wdutch
Diffstat (limited to 'bin/vmdebootstrap')
-rwxr-xr-x | bin/vmdebootstrap | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/bin/vmdebootstrap b/bin/vmdebootstrap index cc1efe1..d9a697d 100755 --- a/bin/vmdebootstrap +++ b/bin/vmdebootstrap @@ -137,6 +137,8 @@ class VmDebootstrap(cliapp.Application): # pylint: disable=too-many-public-meth self.settings.boolean(['systemd-networkd'], 'Use Predictable Network ' 'Interface Names', default=True) self.settings.boolean(['dry-run'], 'do not build, just test the options', default=False) + self.settings.string(['debootstrap-scripts'], 'Directory containing debootstrap scripts', + default='/usr/share/debootstrap/scripts') def process_args(self, args): # pylint: disable=too-many-branches,too-many-statements @@ -159,11 +161,12 @@ class VmDebootstrap(cliapp.Application): # pylint: disable=too-many-public-meth if self.settings['image'] and not self.settings['size']: raise cliapp.AppException( 'If disk image is specified, you must give image size.') - if not distro.debian_info.valid(self.settings['distribution']): - if not distro.ubuntu_info.valid(self.settings['distribution']): - raise cliapp.AppException( - '%s is not a valid Debian or Ubuntu suite or codename.' - % self.settings['distribution']) + if not os.path.isfile(os.path.join( + self.settings['debootstrap-scripts'], + self.settings['distribution'])): + raise cliapp.AppException( + '%s is not a valid debootstrap codename.' + % self.settings['distribution']) if self.settings['apt-mirror'] and not self.settings['configure-apt']: raise cliapp.AppException( '--apt-mirror requires --configure-apt as well.') |