From 023806d55ca4f83d3a227d1f183310fcd43daa3f Mon Sep 17 00:00:00 2001 From: Oliver Tappe Date: Sun, 17 Feb 2008 15:01:40 +0000 Subject: * added explicit error message about trying to apply actions to the '<<>>' vendor-OS (which is going to be introduced, soon) * slxos-export list-exported now uses the usual export name format (::) * 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 --- installer/slxos-export | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) (limited to 'installer/slxos-export') 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"); -- cgit v1.2.3-55-g7522