diff options
author | unknown <monty@mysql.com> | 2004-05-25 22:00:14 +0300 |
---|---|---|
committer | unknown <monty@mysql.com> | 2004-05-25 22:00:14 +0300 |
commit | b3851363ba8df0b3f55ecb358849a212db4b12a8 (patch) | |
tree | 2c56473da947b9807f0d1668171870a8e3dbc736 /scripts/mysqlhotcopy.sh | |
parent | 699cbc02cc3eac51524a56fc106d013633f336f6 (diff) | |
download | mariadb-git-b3851363ba8df0b3f55ecb358849a212db4b12a8.tar.gz |
Added patches from Novell
Build-tools/Do-compile:
Fixed indentation
configure.in:
Added patches from Novell
Added C_EXTRA_FLAGS as an easy way to pass flags to both CFLAGS and CXXFLAGS
extra/perror.c:
Fixed error number reporting to not report 'Unknown error'
include/my_global.h:
Defines to make NETWARE patches cleaner
include/thr_alarm.h:
Fixed wrong macro
netware/mysql_install_db.c:
Indentation fix
Diffstat (limited to 'scripts/mysqlhotcopy.sh')
-rw-r--r-- | scripts/mysqlhotcopy.sh | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/scripts/mysqlhotcopy.sh b/scripts/mysqlhotcopy.sh index ab06215c3ac..6388855eaa6 100644 --- a/scripts/mysqlhotcopy.sh +++ b/scripts/mysqlhotcopy.sh @@ -7,6 +7,7 @@ use File::Basename; use File::Path; use DBI; use Sys::Hostname; +use File::Copy; =head1 NAME @@ -230,6 +231,10 @@ elsif (defined($tgt_name) && ($tgt_name =~ m:/: || $tgt_name eq '.')) { elsif ( $opt{suffix} ) { print "Using copy suffix '$opt{suffix}'\n" unless $opt{quiet}; } +elsif ( ($^O =~ m/^(NetWare)$/) && defined($tgt_name) && ($tgt_name =~ m:\\: || $tgt_name eq '.')) +{ + $tgt_dirname = $tgt_name; +} else { $tgt_name="" if (!defined($tgt_name)); @@ -421,8 +426,11 @@ foreach my $rdb ( @db_desc ) { else { mkdir($tgt_dirpath, 0750) or die "Can't create '$tgt_dirpath': $!\n" unless -d $tgt_dirpath; + if ($^O !~ m/^(NetWare)$/) + { my @f_info= stat "$datadir/$rdb->{src}"; chown $f_info[4], $f_info[5], $tgt_dirpath; + } } } } @@ -578,7 +586,15 @@ sub copy_files { my @cmd; print "Copying ".@$files." files...\n" unless $opt{quiet}; - if ($method =~ /^s?cp\b/) { # cp or scp with optional flags + if ($^O =~ m/^(NetWare)$/) # on NetWare call PERL copy (slower) + { + foreach my $file ( @$files ) + { + copy($file, $target."/".basename($file)); + } + } + elsif ($method =~ /^s?cp\b/) # cp or scp with optional flags + { my $cp = $method; # add option to preserve mod time etc of copied files # not critical, but nice to have @@ -717,7 +733,7 @@ sub retire_directory { if ( -d $tgt_oldpath ) { print "Deleting previous 'old' hotcopy directory ('$tgt_oldpath')\n" unless $opt{quiet}; - rmtree([$tgt_oldpath]) + rmtree([$tgt_oldpath],0,1); } rename($dir, $tgt_oldpath) or die "Can't rename $dir=>$tgt_oldpath: $!\n"; |