Bug 8745: General whitespace and tab tidy

http://bugs.koha-community.org/show_bug.cgi?id=8745
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
1) Runs not with root.
2) Runs with root and -run-as-root.
3) Runs using the normal koha user.

Note: Maybe the message should be clear about why
running as root is bad and which user you should
be running the script with?
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
This commit is contained in:
Mason James 2013-04-02 22:36:16 +13:00 committed by Jared Camins-Esakov
parent ef86a77801
commit 2eefd1f3a5

View file

@ -57,7 +57,7 @@ my $result = GetOptions(
'munge-config' => \$do_munge, 'munge-config' => \$do_munge,
'a' => \$authorities, 'a' => \$authorities,
'h|help' => \$want_help, 'h|help' => \$want_help,
'x' => \$as_xml, 'x' => \$as_xml,
'y' => \$do_not_clear_zebraqueue, 'y' => \$do_not_clear_zebraqueue,
'z' => \$process_zebraqueue, 'z' => \$process_zebraqueue,
'where:s' => \$where, 'where:s' => \$where,
@ -195,19 +195,19 @@ if ($keep_export) {
# If they don't, then zebra is likely to spit the dummy. This returns true # If they don't, then zebra is likely to spit the dummy. This returns true
# if the directories had to be created, false otherwise. # if the directories had to be created, false otherwise.
sub check_zebra_dirs { sub check_zebra_dirs {
my ($base) = shift() . '/'; my ($base) = shift() . '/';
my $needed_repairing = 0; my $needed_repairing = 0;
my @dirs = ( '', 'key', 'register', 'shadow', 'tmp' ); my @dirs = ( '', 'key', 'register', 'shadow', 'tmp' );
foreach my $dir (@dirs) { foreach my $dir (@dirs) {
my $bdir = $base . $dir; my $bdir = $base . $dir;
if (! -d $bdir) { if (! -d $bdir) {
$needed_repairing = 1; $needed_repairing = 1;
mkdir $bdir || die "Unable to create '$bdir': $!\n"; mkdir $bdir || die "Unable to create '$bdir': $!\n";
print "$0: needed to create '$bdir'\n"; print "$0: needed to create '$bdir'\n";
} }
} }
return $needed_repairing; return $needed_repairing;
} # ---------- end of subroutine check_zebra_dirs ---------- } # ---------- end of subroutine check_zebra_dirs ----------
sub index_records { sub index_records {
my ($record_type, $directory, $skip_export, $skip_index, $process_zebraqueue, $as_xml, $noxml, $nosanitize, $do_not_clear_zebraqueue, $verbose_logging, $zebraidx_log_opt, $server_dir) = @_; my ($record_type, $directory, $skip_export, $skip_index, $process_zebraqueue, $as_xml, $noxml, $nosanitize, $do_not_clear_zebraqueue, $verbose_logging, $zebraidx_log_opt, $server_dir) = @_;
@ -216,8 +216,8 @@ sub index_records {
my $records_deleted; my $records_deleted;
my $need_reset = check_zebra_dirs($server_dir); my $need_reset = check_zebra_dirs($server_dir);
if ($need_reset) { if ($need_reset) {
print "$0: found broken zebra server directories: forcing a rebuild\n"; print "$0: found broken zebra server directories: forcing a rebuild\n";
$reset = 1; $reset = 1;
} }
if ($skip_export && $verbose_logging) { if ($skip_export && $verbose_logging) {
print "====================\n"; print "====================\n";