Commit 433cde2c authored by unknown's avatar unknown
Browse files

Merge bk-internal:/home/bk/mysql-4.1

into mysql.com:/home/jimw/my/mysql-4.1-clean

parents cb1b4980 83eada81
Loading
Loading
Loading
Loading
+85 −0
Original line number Diff line number Diff line
#!/usr/bin/perl

#
# By Matt Wagner <matt@mysql.com> 2005
#
# This script generates HP Depot packages for MySQL Server.
# It basically repackages a binary tarball as a depot.
#
# Usage: ./Do-hpux-depot <untarred-binary-tarball>
#

$fullname = shift @ARGV;
$fullname or die "No package name was specified";
-d $fullname or die "That directory is not present!";

$fullname =~ s,/+$,,;             # Remove ending slash if any

chomp($pwd= `pwd`);

%title= (
  "mysql-standard" => "MySQL Community Edition - Standard (GPL)",
  "mysql-debug" => "MySQL Community Edition - Debug (GPL)",
  "mysql-max" => "MySQL Community Edition - Experimental (GPL)",
  "mysql-pro" => "MySQL Pro (Commercial)",
  "mysql-classic" => "MySQL Classic (Commercial)",
  "mysql-cluster" => "MySQL Cluster (Commercial)",
);

%architecture= (
  "hpux11.23" => "HP-UX_B.11.23",
  "hpux11.11" => "HP-UX_B.11.11",
  "hpux11.00" => "HP-UX_B.11.00",
);

%os_release= (
  "hpux11.23" => "?.11.2?",
  "hpux11.11" => "?.11.1?",
  "hpux11.00" => "?.11.0?",
);

%machine_type= (
  "ia64" => "ia64*",
  "hppa2.0w" => "9000/*",
);

$fullname =~ m/^(mysql-\w+)-([\d\.]+)-hp-(hpux11\.\d\d)-(hppa2\.0w|(ia64))-?(64bit)?$/;

# print "title: $1\n";
# print "version: $2\n";
# print "os: $3\n";
# print "cpu: $4\n";
# print "64: $6\n";

$cpu64= ($6 ne "") ? "_64" : "";

open (PSF,">${fullname}.psf") or die "Unable to write PSF file ($!)\n";

print PSF <<EOF;
product
        tag $1 
        vendor_tag "MySQL_AB"
        title "$title{$1}"
        description "MySQL Database Server and Clients"
        revision $2

        architecture $architecture{$3}$cpu64
        machine_type $machine_type{$4}
        os_name HP-UX
        os_release $os_release{$3}
        directory /usr/local

        fileset
                tag all
                revision $2
		directory $fullname=/usr/local/$fullname
                file_permissions -u 222 -g bin -o bin
                file *
        end
end
EOF

close(PSF);

system("/usr/sbin/swpackage -v -d \"|gzip -c > $fullname.depot.gz\" -x target_type=tape -s ${pwd}/${fullname}.psf");
+441 −25

File changed.

Preview size limit exceeded, changes collapsed.

+28 −5
Original line number Diff line number Diff line
@@ -123,6 +123,17 @@ sub spawn_impl ($$$$$$$) {

      $SIG{INT}= 'DEFAULT';         # Parent do some stuff, we don't

      if ( $::glob_cygwin_shell and $mode eq 'test' )
      {
        # Programs started from mysqltest under Cygwin, are to
        # execute them within Cygwin. Else simple things in test
        # files like
        # --system "echo 1 > file"
        # will fail.
        # FIXME not working :-(
#       $ENV{'COMSPEC'}= "$::glob_cygwin_shell -c";
      }

      if ( $output )
      {
        if ( ! open(STDOUT,">",$output) )
@@ -130,6 +141,7 @@ sub spawn_impl ($$$$$$$) {
          mtr_error("can't redirect STDOUT to \"$output\": $!");
        }
      }

      if ( $error )
      {
        if ( $output eq $error )
@@ -147,6 +159,7 @@ sub spawn_impl ($$$$$$$) {
          }
        }
      }

      if ( $input )
      {
        if ( ! open(STDIN,"<",$input) )
@@ -154,7 +167,11 @@ sub spawn_impl ($$$$$$$) {
          mtr_error("can't redirect STDIN to \"$input\": $!");
        }
      }
      exec($path,@$arg_list_t);

      if ( ! exec($path,@$arg_list_t) )
      {
        mtr_error("failed to execute \"$path\": $!");
      }
    }
  }
}
@@ -569,7 +586,7 @@ sub mtr_stop_mysqld_servers ($) {
sub mtr_mysqladmin_shutdown () {
  my $spec= shift;

  my @mysql_admin_pids;
  my %mysql_admin_pids;
  my @to_kill_specs;

  foreach my $srv ( @$spec )
@@ -611,13 +628,19 @@ sub mtr_mysqladmin_shutdown () {
    # We don't wait for termination of mysqladmin
    my $pid= mtr_spawn($::exe_mysqladmin, $args,
                       "", $::path_manager_log, $::path_manager_log, "");
    push(@mysql_admin_pids, $pid);
    $mysql_admin_pids{$pid}= 1;
  }

  # We wait blocking, we wait for the last one anyway
  foreach my $pid (@mysql_admin_pids)
  while (keys %mysql_admin_pids)
  {
    foreach my $pid (keys %mysql_admin_pids)
    {
    waitpid($pid,0);                    # FIXME no need to check -1 or 0?
      if ( waitpid($pid,0) > 0 )
      {
        delete $mysql_admin_pids{$pid};
      }
    }
  }

  # If we trusted "mysqladmin --shutdown_timeout= ..." we could just
+3 −1
Original line number Diff line number Diff line
@@ -50,12 +50,14 @@ sub mtr_show_failed_diff ($) {
    $result_file=  "$result_file$::opt_result_ext";
  }

  my $diffopts= $::opt_udiff ? "-u" : "-c";

  if ( -f $reject_file )
  {
    print "Below are the diffs between actual and expected results:\n";
    print "-------------------------------------------------------\n";
    # FIXME check result code?!
    mtr_run("diff",["-c",$result_file,$reject_file], "", "", "", "");
    mtr_run("diff",[$diffopts,$result_file,$reject_file], "", "", "", "");
    print "-------------------------------------------------------\n";
    print "Please follow the instructions outlined at\n";
    print "http://www.mysql.com/doc/en/Reporting_mysqltest_bugs.html\n";
+81 −50
Original line number Diff line number Diff line
@@ -156,13 +156,13 @@ our @mysqld_src_dirs=
our $glob_win32=                  0; # OS and native Win32 executables
our $glob_win32_perl=             0; # ActiveState Win32 Perl
our $glob_cygwin_perl=            0; # Cygwin Perl
our $glob_cygwin_shell=           undef;
our $glob_mysql_test_dir=         undef;
our $glob_mysql_bench_dir=        undef;
our $glob_hostname=               undef;
our $glob_scriptname=             undef;
our $glob_use_running_server=     0;
our $glob_use_running_ndbcluster= 0;
our $glob_user=                   'test';
our $glob_use_embedded_server=    0;

our $glob_basedir;
@@ -281,6 +281,8 @@ our $opt_wait_timeout= 10;

our $opt_warnings;

our $opt_udiff;

our $opt_with_ndbcluster;
our $opt_with_openssl;

@@ -358,6 +360,10 @@ sub main () {

  if ( $opt_start_and_exit )
  {
    if ( ndbcluster_start() )
    {
      mtr_error("Can't start ndbcluster");
    }
    if ( mysqld_start('master',0,[],[]) )
    {
      mtr_report("Servers started, exiting");
@@ -422,7 +428,9 @@ sub initial_setup () {
  {
    # Windows programs like 'mysqld' needs Windows paths
    $glob_mysql_test_dir= `cygpath -m $glob_mysql_test_dir`;
    $glob_cygwin_shell=   `cygpath -w $ENV{'SHELL'}`; # The Windows path c:\...
    chomp($glob_mysql_test_dir);
    chomp($glob_cygwin_shell);
  }
  $glob_basedir=         dirname($glob_mysql_test_dir);
  $glob_mysql_bench_dir= "$glob_basedir/mysql-bench"; # FIXME make configurable
@@ -524,6 +532,7 @@ sub command_line_setup () {
             'start-from=s'             => \$opt_start_from,
             'timer'                    => \$opt_timer,
             'tmpdir=s'                 => \$opt_tmpdir,
             'unified-diff|udiff'       => \$opt_udiff,
             'user-test=s'              => \$opt_user_test,
             'user=s'                   => \$opt_user,
             'verbose'                  => \$opt_verbose,
@@ -712,17 +721,16 @@ sub command_line_setup () {
  #  }
  #}

  if ( $opt_user )
  if ( ! $opt_user )
  {
    $glob_user=  $opt_user;
  }
  elsif ( $glob_use_running_server )
    if ( $glob_use_running_server )
    {
    $glob_user=  "test";
      $opt_user= "test";
    }
    else
    {
    $glob_user=  "root"; # We want to do FLUSH xxx commands
      $opt_user= "root"; # We want to do FLUSH xxx commands
    }
  }

}
@@ -837,7 +845,7 @@ sub executable_setup () {
      }
      else
      {
        error("Cannot find embedded server 'mysqltest_embedded'");
        mtr_error("Cannot find embedded server 'mysqltest_embedded'");
      }
      if ( -d "$path_tests_bindir/mysql_client_test_embedded" )
      {
@@ -860,9 +868,6 @@ sub executable_setup () {
    $exe_ndb_mgm=         "$glob_basedir/bin/ndb_mgm";
  }

  # FIXME special $exe_master_mysqld and $exe_slave_mysqld
  # are not used that much....

  if ( ! $exe_master_mysqld )
  {
    $exe_master_mysqld=  $exe_mysqld;
@@ -1054,7 +1059,7 @@ sub ndbcluster_start () {
		"--data-dir=$glob_mysql_test_dir/var"],
	       "", "/dev/null", "", "") )
  {
    mtr_error("Error ndbcluster_install");
    mtr_error("Error ndbcluster_start");
    return 1;
  }

@@ -1102,7 +1107,7 @@ sub run_benchmarks ($) {
  mtr_init_args(\$args);

  mtr_add_arg($args, "--socket=%s", $master->[0]->{'path_mysock'});
  mtr_add_arg($args, "--user=root");
  mtr_add_arg($args, "--user=%s", $opt_user);

  if ( $opt_small_bench )
  {
@@ -1226,15 +1231,41 @@ sub install_db ($$) {
  my $type=      shift;
  my $data_dir=  shift;

  my $init_db_sql=  "lib/init_db.sql"; # FIXME this is too simple maybe
  my $init_db_sql=     "lib/init_db.sql";
  my $init_db_sql_tmp= "/tmp/init_db.sql$$";
  my $args;

  mtr_report("Installing \u$type Databases");

  open(IN, $init_db_sql)
    or error("Can't open $init_db_sql: $!");
  open(OUT, ">", $init_db_sql_tmp)
    or error("Can't write to $init_db_sql_tmp: $!");
  while (<IN>)
  {
    chomp;
    s/\@HOSTNAME\@/$glob_hostname/;
    if ( /^\s*$/ )
    {
      print OUT "\n";
    }
    elsif (/;$/)
    {
      print OUT "$_\n";
    }
    else
    {
      print OUT "$_ ";
    }
  }
  close OUT;
  close IN;

  mtr_init_args(\$args);

  mtr_add_arg($args, "--no-defaults");
  mtr_add_arg($args, "--bootstrap");
  mtr_add_arg($args, "--console");
  mtr_add_arg($args, "--skip-grant-tables");
  mtr_add_arg($args, "--basedir=%s", $path_my_basedir);
  mtr_add_arg($args, "--datadir=%s", $data_dir);
@@ -1248,12 +1279,14 @@ sub install_db ($$) {
    mtr_add_arg($args, "--character-sets-dir=%s", $path_charsetsdir);
  }

  if ( mtr_run($exe_mysqld, $args, $init_db_sql,
  if ( mtr_run($exe_mysqld, $args, $init_db_sql_tmp,
               $path_manager_log, $path_manager_log, "") != 0 )
  {
    unlink($init_db_sql_tmp);
    mtr_error("Error executing mysqld --bootstrap\n" .
              "Could not install $type test DBs");
  }
  unlink($init_db_sql_tmp);
}


@@ -1492,7 +1525,7 @@ sub report_failure_and_restart ($) {

sub do_before_start_master ($$) {
  my $tname=       shift;
  my $master_init_script=  shift;
  my $init_script= shift;

  # FIXME what about second master.....

@@ -1502,8 +1535,8 @@ sub do_before_start_master ($$) {
       $tname ne "rpl_crash_binlog_ib_3b")
  {
    # FIXME we really want separate dir for binlogs
    `rm -fr $glob_mysql_test_dir/var/log/master-bin.*`;
#    unlink("$glob_mysql_test_dir/var/log/master-bin.*");
    `rm -f $glob_mysql_test_dir/var/log/master-bin*`;
#    unlink("$glob_mysql_test_dir/var/log/master-bin*");
  }

  # Remove old master.info and relay-log.info files
@@ -1512,12 +1545,11 @@ sub do_before_start_master ($$) {
  unlink("$glob_mysql_test_dir/var/master1-data/master.info");
  unlink("$glob_mysql_test_dir/var/master1-data/relay-log.info");

  #run master initialization shell script if one exists

  if ( $master_init_script and
       mtr_run($master_init_script, [], "", "", "", "") != 0 )
  # Run master initialization shell script if one exists
  if ( $init_script )
  {
    mtr_error("Can't run $master_init_script");
    # We ignore the return code
    mtr_run("/bin/sh", ["-c",$init_script], "", "", "", "");
  }
  # for gcov  FIXME needed? If so we need more absolute paths
# chdir($glob_basedir);
@@ -1525,10 +1557,7 @@ sub do_before_start_master ($$) {

sub do_before_start_slave ($$) {
  my $tname=       shift;
  my $slave_init_script=  shift;

  # When testing fail-safe replication, we will have more than one slave
  # in this case, we start secondary slaves with an argument
  my $init_script= shift;

  # Remove stale binary logs and old master.info files
  # except for too tests which need them
@@ -1544,14 +1573,15 @@ sub do_before_start_slave ($$) {
    unlink("$glob_mysql_test_dir/var/slave-data/relay-log.info");
  }

  #run slave initialization shell script if one exists
  if ( $slave_init_script and
       mtr_run($slave_init_script, [], "", "", "", "") != 0 )
  # Run slave initialization shell script if one exists
  if ( $init_script )
  {
    mtr_error("Can't run $slave_init_script");
    # We ignore the return code
    mtr_run("/bin/sh", ["-c",$init_script], "", "", "", "");
  }

  unlink("$glob_mysql_test_dir/var/slave-data/log.*");
  `rm -f $glob_mysql_test_dir/var/slave-data/log.*`;
#  unlink("$glob_mysql_test_dir/var/slave-data/log.*");
}

sub mysqld_arguments ($$$$$) {
@@ -1579,6 +1609,7 @@ sub mysqld_arguments ($$$$$) {
    mtr_add_arg($args, "%s--no-defaults", $prefix);
  }

  mtr_add_arg($args, "%s--console", $prefix);
  mtr_add_arg($args, "%s--basedir=%s", $prefix, $path_my_basedir);
  mtr_add_arg($args, "%s--character-sets-dir=%s", $prefix, $path_charsetsdir);
  mtr_add_arg($args, "%s--core", $prefix);
@@ -1669,12 +1700,12 @@ sub mysqld_arguments ($$$$$) {
  {
    if ( $type eq 'master' )
    {
      mtr_add_arg($args, "--debug=d:t:i:A,%s/var/log/master%s.trace",
      mtr_add_arg($args, "%s--debug=d:t:i:A,%s/var/log/master%s.trace",
                  $prefix, $glob_mysql_test_dir, $sidx);
    }
    if ( $type eq 'slave' )
    {
      mtr_add_arg($args, "--debug=d:t:i:A,%s/var/log/slave%s.trace",
      mtr_add_arg($args, "%s--debug=d:t:i:A,%s/var/log/slave%s.trace",
                  $prefix, $glob_mysql_test_dir, $sidx);
    }
  }
@@ -1789,18 +1820,17 @@ sub mysqld_start ($$$$) {
  my $exe;
  my $pid;

  # FIXME code duplication, make up your mind....
  if ( $opt_source_dist )
  if ( $type eq 'master' )
  {
    $exe= "$glob_basedir/sql/mysqld";
    $exe= $exe_master_mysqld;
  }
  else
  elsif ( $type eq 'slave' )
  {
    $exe ="$glob_basedir/libexec/mysqld";
    if ( ! -x $exe )
    {
      $exe ="$glob_basedir/bin/mysqld";
    $exe= $exe_slave_mysqld;
  }
  else
  {
    $exe= $exe_mysqld;
  }

  mtr_init_args(\$args);
@@ -1983,7 +2013,7 @@ sub run_mysqltest ($$) {
  mtr_add_arg($args, "--no-defaults");
  mtr_add_arg($args, "--socket=%s", $master->[0]->{'path_mysock'});
  mtr_add_arg($args, "--database=test");
  mtr_add_arg($args, "--user=%s", $glob_user);
  mtr_add_arg($args, "--user=%s", $opt_user);
  mtr_add_arg($args, "--password=");
  mtr_add_arg($args, "--silent");
  mtr_add_arg($args, "-v");
@@ -2054,7 +2084,7 @@ sub run_mysqltest ($$) {
    mysqld_arguments($args,'master',0,$tinfo->{'master_opt'},[]);
  }

  return mtr_run($exe_mysqltest,$args,$tinfo->{'path'},"",$path_timefile,"");
  return mtr_run_test($exe_mysqltest,$args,$tinfo->{'path'},"",$path_timefile,"");
}

##############################################################################
@@ -2136,6 +2166,7 @@ Misc options
  start-and-exit        Only initiate and start the "mysqld" servers
  fast                  Don't try to cleanup from earlier runs
  help                  Get this help text
  unified-diff | udiff  When presenting differences, use unified diff

Options not yet described, or that I want to look into more

Loading