~ubuntu-branches/ubuntu/trusty/mysql-5.6/trusty

« back to all changes in this revision

Viewing changes to .pc/kfreebsd_tests.patch/mysql-test/lib/My/Platform.pm

  • Committer: Package Import Robot
  • Author(s): James Page, Akhil Mohan, Bjoern Boschman
  • Date: 2014-02-12 11:54:27 UTC
  • Revision ID: package-import@ubuntu.com-20140212115427-0vst0nnto99pc2su
Tags: 5.6.15-0ubuntu1
[ Akhil Mohan ]
* added libmysqlclient.so link to libmysqlclient18.1-dev package
* revisited patches in d/patches/series; removed extra patches not needed
* some patches were modified to handle 5.6 issues
* mysql-server-5.6 and mysql-client-5.6 now depend on mysql-common (>= 5.5)
* mysql-server-5.6 now provides only virtual-mysql-server
* mysql-client-5.6 now provides only virtual-mysql-client
* MySQL 5.6 now contains mysql-common-5.6 which is only suggested
* moved mysql-common/etc/mysql/my.cnf to
    mysql-common-5.6/usr/share/mysql/my.cnf
* MySQL 5.6 now gives libmysqlclient18.1, libmysqlclient18.1-dev,
    libmysqld-5.6-dev and libmysqld-5.6-pic
* libmysqlclient18.1-dev, libmysqld-5.6-dev and libmysqld-5.6-pic packages
    conflict with their respective counterparts from MySQL 5.5
* link traversal for libmysqlclient is
    libmysqlclient.so (contained in libmysqclient18.1-dev)  ->
    libmysqlclient.so.18 (contained in libmysqclient18.1)   ->
    libmysqlclient.so.18.1 (contained in libmysqclient18.1) ->
    libmysqlclient.so.18.1.0 (contained in libmysqclient18.1)
* Placeholder packages mysql-server, mysql-client, mysql-testsuite 
  have been discontinued
* d/rules, d/control removed gcc-4.4 dependency and disable X86 assembly in
  taocrypt.
  - Cherry-pick from Debian svn r2231 with thanks to Clint Byrum.
* changed mirror to download source tar
* replaced mysql_install_db script with small shell script to create
  root accounts. This avoids creating anonymous users which were
  security concern.
* Docs/mysql.info has been removed in the mysql 5.6.15 source
* removed debian/repack.* and 'DFSG and repacking' section in
  debian/README.source because repack not needed
* dropped '+dfsg' from version in changelog since there is no repack
* simplified debian/watch since there is no repack
* removed redundant *_r* links to mysql client library in libmysqlclient18
  and libmysqlclient-dev packages
* updated debian/control to allow mysql-*-5.6 packages upgrade/ replace
  an existing installation of mysql-*-5.5 packages
* modified debian/rules to use system zlib library, install additional
  man pages and remove execute bit on few test and result files
* added patches to fix link path in man page mysql_client_test_embedded.1
  and mysqltest_embedded.1
* added man page for mysql_config_pic at debian/additions/mysql_config_pic.1
* added man page for mysql_embedded at debian/additions/mysql_embedded.1
* moved libmysqlcient.so link from libmysqlclient18 to libmysqlclient-dev
  based on lintian warning non-dev-pkg-with-shlib-symlink
* moved mysql_client_test_embedded binary from mysql-testsuite-5.6 
  package to mysql-client-5.6 package
* moved mysql_config_editor.1 man page to mysql-client-5.6 package
* moved mysql_embedded from mysql-testsuite-5.6 package to mysql-client-5.6
  package
* moved mysqltest_embedded binary from mysql-testsuite-5.6
  package to mysql-server-5.6 package
* removed absolute path for mysql_install_db script in mysql-server-5.6
  postinst script based on lintian warning

[ Bjoern Boschman ]
* Initial release of mysql-5.6 package.
* mysql_install_db is now a perl script. Do not run it with bash.
* added innodb_data_file_path to my.cnf for mysql-5.1 => mysql-5.6 upgrade
  path.
* added multiarch support 
* do not include .a files within libmysqlclient18

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# -*- cperl -*-
 
2
# Copyright (c) 2008 MySQL AB, 2008, 2009 Sun Microsystems, Inc.
 
3
# Use is subject to license terms.
 
4
#
 
5
# This program is free software; you can redistribute it and/or modify
 
6
# it under the terms of the GNU General Public License as published by
 
7
# the Free Software Foundation; version 2 of the License.
 
8
#
 
9
# This program is distributed in the hope that it will be useful,
 
10
# but WITHOUT ANY WARRANTY; without even the implied warranty of
 
11
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
12
# GNU General Public License for more details.
 
13
#
 
14
# You should have received a copy of the GNU General Public License
 
15
# along with this program; if not, write to the Free Software
 
16
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
17
 
 
18
package My::Platform;
 
19
 
 
20
use strict;
 
21
use File::Basename;
 
22
use File::Path;
 
23
 
 
24
use base qw(Exporter);
 
25
our @EXPORT= qw(IS_CYGWIN IS_WINDOWS IS_WIN32PERL
 
26
                native_path posix_path mixed_path
 
27
                check_socket_path_length process_alive);
 
28
 
 
29
BEGIN {
 
30
  if ($^O eq "cygwin") {
 
31
    # Make sure cygpath works
 
32
    if ((system("cygpath > /dev/null 2>&1") >> 8) != 1){
 
33
      die "Could not execute 'cygpath': $!";
 
34
    }
 
35
    eval 'sub IS_CYGWIN { 1 }';
 
36
  }
 
37
  else {
 
38
    eval 'sub IS_CYGWIN { 0 }';
 
39
  }
 
40
  if ($^O eq "MSWin32") {
 
41
    eval 'sub IS_WIN32PERL { 1 }';
 
42
  }
 
43
  else {
 
44
    eval 'sub IS_WIN32PERL { 0 }';
 
45
  }
 
46
}
 
47
 
 
48
BEGIN {
 
49
  if (IS_CYGWIN or IS_WIN32PERL) {
 
50
    eval 'sub IS_WINDOWS { 1 }';
 
51
  }
 
52
  else {
 
53
    eval 'sub IS_WINDOWS { 0 }';
 
54
  }
 
55
}
 
56
 
 
57
 
 
58
#
 
59
# native_path
 
60
# Convert from path format used by perl to the underlying
 
61
# operating systems format
 
62
#
 
63
# NOTE
 
64
#  Used when running windows binaries (that expect windows paths)
 
65
#  in cygwin perl (that uses unix paths)
 
66
#
 
67
 
 
68
use Memoize;
 
69
if (!IS_WIN32PERL){
 
70
  memoize('mixed_path');
 
71
  memoize('native_path');
 
72
  memoize('posix_path');
 
73
}
 
74
 
 
75
sub mixed_path {
 
76
  my ($path)= @_;
 
77
  if (IS_CYGWIN){
 
78
    return unless defined $path;
 
79
    my $cmd= "cygpath -m $path";
 
80
    $path= `$cmd` or
 
81
      print "Failed to run: '$cmd', $!\n";
 
82
    chomp $path;
 
83
  }
 
84
  return $path;
 
85
}
 
86
 
 
87
sub native_path {
 
88
  my ($path)= @_;
 
89
  $path=~ s/\//\\/g
 
90
    if (IS_CYGWIN or IS_WIN32PERL);
 
91
  return $path;
 
92
}
 
93
 
 
94
sub posix_path {
 
95
  my ($path)= @_;
 
96
  if (IS_CYGWIN){
 
97
    return unless defined $path;
 
98
    $path= `cygpath $path`;
 
99
    chomp $path;
 
100
  }
 
101
  return $path;
 
102
}
 
103
 
 
104
use File::Temp qw /tempdir/;
 
105
 
 
106
sub check_socket_path_length {
 
107
  my ($path)= @_;
 
108
 
 
109
  return 0 if IS_WINDOWS;
 
110
  # This may not be true, but we can't test for it on AIX due to Perl bug
 
111
  # See Bug #45771
 
112
  return 0 if ($^O eq 'aix');
 
113
  # Similarly the path length is hidden.
 
114
  # See Debian bug #651002
 
115
  return 0 if ($^O eq 'gnu');
 
116
 
 
117
  require IO::Socket::UNIX;
 
118
 
 
119
  my $truncated= undef;
 
120
 
 
121
  # Create a tempfile name with same length as "path"
 
122
  my $tmpdir = tempdir( CLEANUP => 0);
 
123
  my $len = length($path) - length($tmpdir) - 1;
 
124
  my $testfile = $tmpdir . "/" . "x" x ($len  > 0 ? $len : 1);
 
125
  my $sock;
 
126
  eval {
 
127
    $sock= new IO::Socket::UNIX
 
128
      (
 
129
       Local => $testfile,
 
130
       Listen => 1,
 
131
      );
 
132
    $truncated= 1; # Be negatvie
 
133
 
 
134
    die "Could not create UNIX domain socket: $!"
 
135
      unless defined $sock;
 
136
 
 
137
    die "UNIX domain socket path was truncated"
 
138
      unless ($testfile eq $sock->hostpath());
 
139
 
 
140
    $truncated= 0; # Yes, it worked!
 
141
 
 
142
  };
 
143
 
 
144
  die "Unexpected failure when checking socket path length: $@"
 
145
    if $@ and not defined $truncated;
 
146
 
 
147
  $sock= undef;  # Close socket
 
148
  rmtree($tmpdir); # Remove the tempdir and any socket file created
 
149
  return $truncated;
 
150
}
 
151
 
 
152
 
 
153
sub process_alive {
 
154
  my ($pid)= @_;
 
155
  die "usage: process_alive(pid)" unless $pid;
 
156
 
 
157
  return kill(0, $pid) unless IS_WINDOWS;
 
158
 
 
159
  my @list= split(/,/, `tasklist /FI "PID eq $pid" /NH /FO CSV`);
 
160
  my $ret_pid= eval($list[1]);
 
161
  return ($ret_pid == $pid);
 
162
}
 
163
 
 
164
 
 
165
1;