my $commands = {
'init' => '',
- 'bootstrap' => '[--exim] [--include <a[,b..]]>] --exclude [<a[,b..]]>] [--minimal]',
+ 'bootstrap' => '[--exim] [--include <a[,b..]]>] --exclude [<a[,b..]]>] [--minimal] [--device-skelleton]',
'finalize' => '[--keepmycnf] [--compressor <gz[ip] (default)|zst[d]|zstd-max>]',
'veid' => '',
'basedir' => '',
'packagefile' => '',
+ 'targetname' => '',
'list' => '[--verbose]',
'task' => '<postgres|mysql|php> [--version] [--password] [--memlimit]',
'install' => '<package or *.pkglist file> ...',
}
my $dab;
-sub dab() {
+sub dab :prototype() { # make it a directly as `dab->foo()` callable singleton
$dab = PVE::DAB->new() if !$dab;
return $dab;
}
} elsif ($cmd eq 'bootstrap') {
my $opts = {};
- if (!GetOptions ($opts, 'exim', 'minimal', 'include=s', 'exclude=s')) {
+ if (!GetOptions ($opts, 'exim', 'minimal', 'device-skelleton', 'include=s', 'exclude=s')) {
fatal_usage();
}
die "command 'bootstrap' expects no arguments.\n" if scalar (@ARGV) != 0;
die "command '$cmd' expects no arguments.\n" if scalar (@ARGV) != 0;
print $dab->{rootfs} . "\n";
+ } elsif ($cmd eq 'targetname') {
+ die "command '$cmd' expects no arguments.\n" if scalar (@ARGV) != 0;
+ print $dab->{targetname} . "\n";
} elsif ($cmd eq 'packagefile') {
die "command '$cmd' expects no arguments.\n" if scalar (@ARGV) != 0;
-
+ # FIXME: either drop this or make it compressor aware, not all end with .gz...
print "$dab->{targetname}.tar.gz\n";
} elsif ($cmd eq 'list') {