summaryrefslogtreecommitdiffstats
path: root/installer/slxos-export
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/slxos-export
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/slxos-export')
-rwxr-xr-xinstaller/slxos-export24
1 files changed, 13 insertions, 11 deletions
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");