summaryrefslogtreecommitdiffstats
path: root/installer
diff options
context:
space:
mode:
authorOliver Tappe2008-02-17 16:01:40 +0100
committerOliver Tappe2008-02-17 16:01:40 +0100
commit023806d55ca4f83d3a227d1f183310fcd43daa3f (patch)
tree1c405ed0e0c35a16341bd0bd99df9359140b19d1 /installer
parent* deleted debug lines (diff)
downloadcore-023806d55ca4f83d3a227d1f183310fcd43daa3f.tar.gz
core-023806d55ca4f83d3a227d1f183310fcd43daa3f.tar.xz
core-023806d55ca4f83d3a227d1f183310fcd43daa3f.zip
* added explicit error message about trying to apply actions to the
'<<<default>>>' vendor-OS (which is going to be introduced, soon) * slxos-export list-exported now uses the usual export name format (<vendor-OS-name>::<export-type>) * when listing the installed vendor-OSes, plain files are now filtered out (only directories can contain a vendor-OS) git-svn-id: http://svn.openslx.org/svn/openslx/trunk@1555 95ad53e4-c205-0410-b2fa-d234c58c8868
Diffstat (limited to 'installer')
-rw-r--r--installer/OpenSLX/OSExport/Engine.pm3
-rw-r--r--installer/OpenSLX/OSSetup/Engine.pm3
-rwxr-xr-xinstaller/slxos-export24
-rwxr-xr-xinstaller/slxos-setup1
4 files changed, 20 insertions, 11 deletions
diff --git a/installer/OpenSLX/OSExport/Engine.pm b/installer/OpenSLX/OSExport/Engine.pm
index c8b384d3..12d4b862 100644
--- a/installer/OpenSLX/OSExport/Engine.pm
+++ b/installer/OpenSLX/OSExport/Engine.pm
@@ -184,6 +184,9 @@ sub _initialize
my $exportName = shift;
my $exportType = lc(shift);
+ if ($vendorOSName eq '<<<default>>>') {
+ die _tr("you can't do that with the default vendor-OS!\n");
+ }
if (!grep { $_ eq $exportType } @supportedExportTypes) {
vlog(0,
_tr("Sorry, export type '%s' is unsupported.\n", $exportType)
diff --git a/installer/OpenSLX/OSSetup/Engine.pm b/installer/OpenSLX/OSSetup/Engine.pm
index 9b2c6aba..914045fc 100644
--- a/installer/OpenSLX/OSSetup/Engine.pm
+++ b/installer/OpenSLX/OSSetup/Engine.pm
@@ -144,6 +144,9 @@ sub initialize
my $vendorOSName = shift;
my $actionType = shift;
+ if ($vendorOSName eq '<<<default>>>') {
+ die _tr("you can't do that with the default vendor-OS!\n");
+ }
if ($vendorOSName !~ m[^([^\-]+\-[^\-]+)(?:\-(.+))?]) {
die _tr(
"Given vendor-OS has unknown format, expected '<name>-<release>[-<selection>]'\n"
diff --git a/installer/slxos-export b/installer/slxos-export
index 6ca7d7cc..a801077d 100755
--- a/installer/slxos-export
+++ b/installer/slxos-export
@@ -60,14 +60,15 @@ openslxInit();
my $action = shift @ARGV || '';
if ($action =~ m[^list-ex]i) {
- print _tr("List of exported vendor-OSes:\n");
+ print _tr("List of exported vendor-OSes (exports):\n");
foreach my $type (sort keys %supportedExportFileSystems) {
# list all image files, followed by the block devices using it:
my @files = map {
my $image = decode('utf8', $_);
$image =~ s[^.+/][];
$image;
- } sort glob("$openslxConfig{'public-path'}/export/$type/*");
+ }
+ sort glob("$openslxConfig{'public-path'}/export/$type/*");
my %imageFiles;
foreach my $file (@files) {
if ($file =~ m[^(.+)@(.+)$]) {
@@ -83,22 +84,23 @@ if ($action =~ m[^list-ex]i) {
'',
map {
my $devices = join(',', @{$imageFiles{$_}});
+ my $name = "${_}::$type";
if (length($devices)) {
- my $name = "$type/$_";
"\t$name".substr(' ' x 30, length($name))."($devices)\n";
} else {
- "\t$type/$_\n";
+ "\t$name\n";
}
- }
- grep {
+ }
+ grep {
# filter out RSYNC_TMP folders:
$_ !~ m[###];
- }
- sort keys %imageFiles
+ }
+ sort keys %imageFiles
);
}
} elsif ($action =~ m[^list-in]i) {
- my @files = glob("$openslxConfig{'private-path'}/stage1/*");
+ my @vendorOSDirs
+ = grep { -d $_ } glob("$openslxConfig{'private-path'}/stage1/*");
print _tr("List of installed vendor-OSes:\n");
print join(
'',
@@ -106,8 +108,8 @@ if ($action =~ m[^list-ex]i) {
my $vendorOS = decode('utf8', $_);
$vendorOS =~ s[^.+/][];
"\t$vendorOS\n";
- }
- sort @files
+ }
+ sort @vendorOSDirs
);
} elsif ($action =~ m[^list-ty]i) {
print _tr("List of supported export types:\n\t");
diff --git a/installer/slxos-setup b/installer/slxos-setup
index 6ee88c60..0e2aa2a1 100755
--- a/installer/slxos-setup
+++ b/installer/slxos-setup
@@ -159,6 +159,7 @@ if ($action =~ m[^import]i) {
$vendorOS =~ s[^.+/][];
"\t$vendorOS\n";
}
+ grep { -d $_ }
sort glob("$openslxConfig{'private-path'}/stage1/*")
);
} else {