From 0da021ecc1344f0b01052c958c89b504b9406e50 Mon Sep 17 00:00:00 2001 From: Oliver Tappe Date: Mon, 23 Apr 2007 18:35:11 +0000 Subject: * changed semantics of slxos-export (back) to add/update/remove in order to seperate the creation of new exports from the updating of existing ones. This has become necessary with the new naming scheme. * introduced new naming scheme that names exports like the vendor-OS, but adds one letter to it to differentiate several exports of the same vendor-OS and type. git-svn-id: http://svn.openslx.org/svn/openslx/trunk@922 95ad53e4-c205-0410-b2fa-d234c58c8868 --- installer/slxos-export | 44 +++++++++++++++++++++++++++++++++++--------- 1 file changed, 35 insertions(+), 9 deletions(-) (limited to 'installer/slxos-export') diff --git a/installer/slxos-export b/installer/slxos-export index 7890166e..81e8157d 100755 --- a/installer/slxos-export +++ b/installer/slxos-export @@ -99,19 +99,38 @@ if ($action =~ m[^list-ex]i) { # create OSExport-engine for given export type and start it: my $engine = OpenSLX::OSExport::Engine->new; - $engine->initialize($vendorOSName, $exportType); + $engine->initializeForNew($vendorOSName, $exportType); if (!-e $engine->{'vendor-os-path'}) { die _tr("vendor-OS '%s' doesn't exist, giving up!\n", $engine->{'vendor-os-path'}); } $engine->exportVendorOS(); +} elsif ($action =~ m[^(update)]i) { + if (scalar(@ARGV) != 1) { + print STDERR _tr("You need to specify exactly one export-name!\n"); + pod2usage(2); + } + my $exportName = shift @ARGV; + + # we chdir into the script's folder such that all relative paths have + # a known starting point: + chdir($FindBin::RealBin) + or die _tr("can't chdir to script-path <%> (%s)", $FindBin::RealBin, $!); + + # create OSExport-engine for given export type and start it: + my $engine = OpenSLX::OSExport::Engine->new; + $engine->initializeFromExisting($exportName); + if (!-e $engine->{'vendor-os-path'}) { + die _tr("vendor-OS '%s' doesn't exist, giving up!\n", + $engine->{'vendor-os-path'}); + } + $engine->updateExportedVendorOS(); } elsif ($action =~ m[^remove]i) { - if (scalar(@ARGV) != 2) { + if (scalar(@ARGV) != 1) { print STDERR _tr("You need to specify exactly one export-name and one export-type!\n"); pod2usage(2); } my $exportName = shift @ARGV; - my $exportType = shift @ARGV; # we chdir into the script's folder such that all relative paths have # a known starting point: @@ -120,7 +139,7 @@ if ($action =~ m[^list-ex]i) { # create OSExport-engine for given export type and start it: my $engine = OpenSLX::OSExport::Engine->new; - $engine->initialize($exportName, $exportType); + $engine->initializeFromExisting($exportName); $engine->purgeExport(); } else { print STDERR _tr("You need to specify exactly one action: @@ -128,6 +147,7 @@ if ($action =~ m[^list-ex]i) { list-exported list-installed list-types + update remove Try '%s --help' for more info.\n", $0); } @@ -153,10 +173,12 @@ slxos-export [options] =over 8 -=item B<< export >> +=item B<< add >> exports the vendor-OS with the given name using the given export type and -adds it to the config-DB, too +adds it to the config-DB, too. The export will be named as the vendor-OS, +but with an additional '-' appended to it (where will be replaced +by the letter A,B,C ...). =item B<< list-exported >> @@ -170,10 +192,14 @@ list all installed vendor-OSes list all supported export types -=item B<< remove >> +=item B<< update >> + +updates the export with the given name, i.e. the contents of the vendor-OS +is synced to the export + +=item B<< remove >> -removes the export with the given name and export type from disk and -config-DB +removes the export with the given name from disk and config-DB =back -- cgit v1.2.3-55-g7522