summaryrefslogtreecommitdiffstats
path: root/installer/slxos-export
diff options
context:
space:
mode:
authorOliver Tappe2007-04-23 20:35:11 +0200
committerOliver Tappe2007-04-23 20:35:11 +0200
commit0da021ecc1344f0b01052c958c89b504b9406e50 (patch)
treea2afb6436da0c995f1c4c49058b309c488f7ed1e /installer/slxos-export
parent* switch default database type from 'CSV' to 'SQLite', as we no (diff)
downloadcore-0da021ecc1344f0b01052c958c89b504b9406e50.tar.gz
core-0da021ecc1344f0b01052c958c89b504b9406e50.tar.xz
core-0da021ecc1344f0b01052c958c89b504b9406e50.zip
* 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
Diffstat (limited to 'installer/slxos-export')
-rwxr-xr-xinstaller/slxos-export44
1 files changed, 35 insertions, 9 deletions
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] <action>
=over 8
-=item B<< export <vendor-OS-name> <export-type> >>
+=item B<< add <vendor-OS-name> <export-type> >>
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 '-<X>' appended to it (where <X> 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 <export-name> <export-type> >>
+=item B<< update <export-name> >>
+
+updates the export with the given name, i.e. the contents of the vendor-OS
+is synced to the export
+
+=item B<< remove <export-name> >>
-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