From 4c229f003631c46946cb721a9050c7b6e8a86da9 Mon Sep 17 00:00:00 2001 From: Oliver Tappe Date: Wed, 18 Jul 2007 18:35:03 +0000 Subject: * some cleanup - we now make use of here-docs where feasible git-svn-id: http://svn.openslx.org/svn/openslx/trunk@1252 95ad53e4-c205-0410-b2fa-d234c58c8868 --- config-db/slxconfig | 35 +++++++++++++++++++---------------- installer/slxos-export | 19 ++++++++++--------- installer/slxos-setup | 38 ++++++++++++++++++++++---------------- os-plugins/slxos-plugin | 15 ++++++++------- 4 files changed, 59 insertions(+), 48 deletions(-) diff --git a/config-db/slxconfig b/config-db/slxconfig index 5d586a41..50c8d8cd 100755 --- a/config-db/slxconfig +++ b/config-db/slxconfig @@ -36,6 +36,7 @@ use OpenSLX::Basics; use OpenSLX::ConfigDB; use OpenSLX::ConfigFolder; use OpenSLX::DBSchema; +use OpenSLX::Utils; my ( $helpReq, @@ -105,22 +106,24 @@ if ($action =~ m[^add-system$]i) { } elsif ($action =~ m[^remove-system$]i) { removeSystemFromConfigDB(@ARGV); } else { - print STDERR _tr("You need to specify exactly one of these actions: - add-client - add-system - change-client - change-system - list-client - list-export - list-system - list-vendoros - remove-client - remove-system - search-client - search-export - search-system - search-vendoros -Try '%s --help' for more info.\n", $0); + vlog(0, _tr(unshiftHereDoc(<<' END-OF-HERE'), $0)); + You need to specify exactly one of these actions: + add-client + add-system + change-client + change-system + list-client + list-export + list-system + list-vendoros + remove-client + remove-system + search-client + search-export + search-system + search-vendoros + Try '%s --help' for more info. + END-OF-HERE } $openslxDB->disconnect(); diff --git a/installer/slxos-export b/installer/slxos-export index ee1555ec..8f763185 100755 --- a/installer/slxos-export +++ b/installer/slxos-export @@ -32,6 +32,7 @@ use lib "$FindBin::RealBin/../config-db"; use OpenSLX::Basics; use OpenSLX::OSExport::Engine; +use OpenSLX::Utils; my ($helpReq, $manReq, $verbose, $versionReq,); @@ -151,15 +152,15 @@ if ($action =~ m[^list-ex]i) { $engine->initializeFromExisting($exportName); $engine->purgeExport(); } else { - print STDERR _tr( - "You need to specify exactly one action: - export - list-exported - list-installed - list-types - remove -Try '%s --help' for more info.\n", $0 - ); + vlog(0, _tr(unshiftHereDoc(<<' END-OF-HERE'), $0)); + You need to specify exactly one action: + export + list-exported + list-installed + list-types + remove + Try '%s --help' for more info. + END-OF-HERE } =head1 NAME diff --git a/installer/slxos-setup b/installer/slxos-setup index 98685646..0ef0fc2e 100755 --- a/installer/slxos-setup +++ b/installer/slxos-setup @@ -33,6 +33,7 @@ use lib "$FindBin::RealBin/../config-db"; use OpenSLX::Basics; use OpenSLX::OSSetup::Engine; +use OpenSLX::Utils; my ( $helpReq, @@ -155,23 +156,28 @@ if ($action =~ m[^import]i) { sort keys %supportedDistros); } elsif ($action =~ m[^list-in]i) { print _tr("List of installed vendor-OSes:\n"); - print join('', map { - my $vendorOS = $_; - $vendorOS =~ s[^.+/][]; - "\t$vendorOS\n"; - } - sort <$openslxConfig{'private-path'}/stage1/*>); + print join( + '', + map { + my $vendorOS = $_; + $vendorOS =~ s[^.+/][]; + "\t$vendorOS\n"; + } + sort glob("$openslxConfig{'private-path'}/stage1/*") + ); } else { - print STDERR _tr("You need to specify exactly one action: - clone - import-into-db - install - list-supported - list-installed - remove - shell - update -Try '%s --help' for more info.\n", $0); + vlog(0, _tr(unshiftHereDoc(<<' END-OF-HERE'), $0)); + You need to specify exactly one action: + clone + import-into-db + install + list-supported + list-installed + remove + shell + update + Try '%s --help' for more info. + END-OF-HERE } diff --git a/os-plugins/slxos-plugin b/os-plugins/slxos-plugin index e72b9b72..ad203383 100644 --- a/os-plugins/slxos-plugin +++ b/os-plugins/slxos-plugin @@ -32,6 +32,7 @@ use Pod::Usage; use OpenSLX::Basics; use OpenSLX::OSPlugin::Engine; +use OpenSLX::Utils; my ($helpReq, $manReq, $verbose, $versionReq,); @@ -120,13 +121,13 @@ if ($action =~ m[^list-av]i) { } $engine->removePlugin(); } else { - print STDERR _tr( - "You need to specify exactly one action: - install - list-available - remove -Try '%s --help' for more info.\n", $0 - ); + vlog(0, _tr(unshiftHereDoc(<<' END-OF-HERE'), $0)); + You need to specify exactly one action: + install + list-available + remove + Try '%s --help' for more info. + END-OF-HERE } =head1 NAME -- cgit v1.2.3-55-g7522