Skip to content

Commit

Permalink
Merge pull request #9 from uptimejp/fix/python27
Browse files Browse the repository at this point in the history
Fix for Ubuntu 14.04 LTS and CentOS 7 with Python 2.7.
  • Loading branch information
snaga committed May 31, 2015
2 parents 9877482 + d7892fa commit 0eea27d
Show file tree
Hide file tree
Showing 40 changed files with 122 additions and 70 deletions.
2 changes: 1 addition & 1 deletion bin/pt-config
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python2.6
#!/usr/bin/env python
# coding: UTF-8

# pt-config
Expand Down
2 changes: 1 addition & 1 deletion bin/pt-index-usage
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python2.6
#!/usr/bin/env python
# coding: UTF-8

# pt-index-usage
Expand Down
2 changes: 1 addition & 1 deletion bin/pt-kill
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python2.6
#!/usr/bin/env python
# coding: UTF-8

# pt-kill
Expand Down
2 changes: 1 addition & 1 deletion bin/pt-proc-stat
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python2.6
#!/usr/bin/env python
# coding: UTF-8

# pt-proc-stat
Expand Down
2 changes: 1 addition & 1 deletion bin/pt-replication-stat
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python2.6
#!/usr/bin/env python
# coding: UTF-8

# pt-replication-stat
Expand Down
2 changes: 1 addition & 1 deletion bin/pt-session-profiler
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python2.6
#!/usr/bin/env python
# coding: UTF-8

# pt-session-profiler
Expand Down
2 changes: 1 addition & 1 deletion bin/pt-set-tablespace
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python2.6
#!/usr/bin/env python
# coding: UTF-8

# pt-set-tablespace
Expand Down
2 changes: 1 addition & 1 deletion bin/pt-snap-statements
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python2.6
#!/usr/bin/env python
# coding: UTF-8

# pt-snap-statements
Expand Down
2 changes: 1 addition & 1 deletion bin/pt-stat-snapshot
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python2.6
#!/usr/bin/env python
# coding: UTF-8

# pt-stat-snapshot
Expand Down
2 changes: 1 addition & 1 deletion bin/pt-table-usage
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python2.6
#!/usr/bin/env python
# coding: UTF-8

# pt-table-usage
Expand Down
2 changes: 1 addition & 1 deletion bin/pt-tablespace-usage
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python2.6
#!/usr/bin/env python
# coding: UTF-8

# pt-tablespace-usage
Expand Down
2 changes: 1 addition & 1 deletion bin/pt-verify-checksum
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python2.6
#!/usr/bin/env python
# coding: UTF-8

# pt-verify-checksum
Expand Down
2 changes: 1 addition & 1 deletion bin/pt-xact-stat
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python2.6
#!/usr/bin/env python
# coding: UTF-8

# pt-xact-stat
Expand Down
52 changes: 46 additions & 6 deletions bin/t/regress.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash

_PATH=$PATH
LANG=C
Expand Down Expand Up @@ -123,27 +123,67 @@ echo "wal_level = 'hot_standby'" >> _postgresql.conf
echo "wal_keep_segments = 8" >> _postgresql.conf
echo "max_wal_senders = 2" >> _postgresql.conf
echo "hot_standby = on" >> _postgresql.conf
testsuite /usr/pgsql-9.0 ./data90 ./out90
if [ -d /usr/pgsql-9.0 ]; then
# RHEL/CentOS
testsuite /usr/pgsql-9.0 ./data90 ./out90
elif [ -d /usr/lib/postgresql/9.0 ]; then
# Ubuntu
testsuite /usr/lib/postgresql/9.0 ./data90 ./out90
else
echo "passing the regression tests for 9.0"
fi

# -------------------------------------------------------
# 9.1
# -------------------------------------------------------
testsuite /usr/pgsql-9.1 ./data91 ./out91
if [ -d /usr/pgsql-9.1 ]; then
# RHEL/CentOS
testsuite /usr/pgsql-9.1 ./data91 ./out91
elif [ -d /usr/lib/postgresql/9.1 ]; then
# Ubuntu
testsuite /usr/lib/postgresql/9.1 ./data91 ./out91
else
echo "passing the regression tests for 9.1"
fi

# -------------------------------------------------------
# 9.2
# -------------------------------------------------------
echo "track_io_timing = on" >> _postgresql.conf
testsuite /usr/pgsql-9.2 ./data92 ./out92
if [ -d /usr/pgsql-9.2 ]; then
# RHEL/CentOS
testsuite /usr/pgsql-9.2 ./data92 ./out92
elif [ -d /usr/lib/postgresql/9.2 ]; then
# Ubuntu
testsuite /usr/lib/postgresql/9.2 ./data92 ./out92
else
echo "passing the regression tests for 9.2"
fi

# -------------------------------------------------------
# 9.3
# -------------------------------------------------------
# Checksum support
_INITDB_OPTS="-k"
testsuite /usr/pgsql-9.3 ./data93 ./out93
if [ -d /usr/pgsql-9.3 ]; then
# RHEL/CentOS
testsuite /usr/pgsql-9.3 ./data93 ./out93
elif [ -d /usr/lib/postgresql/9.3 ]; then
# Ubuntu
testsuite /usr/lib/postgresql/9.3 ./data93 ./out93
else
echo "passing the regression tests for 9.3"
fi

# -------------------------------------------------------
# 9.4
# -------------------------------------------------------
testsuite /usr/pgsql-9.4 ./data94 ./out94
if [ -d /usr/pgsql-9.4 ]; then
# RHEL/CentOS
testsuite /usr/pgsql-9.4 ./data94 ./out94
elif [ -d /usr/lib/postgresql/9.4 ]; then
# Ubuntu
testsuite /usr/lib/postgresql/9.4 ./data94 ./out94
else
echo "passing the regression tests for 9.4"
fi
2 changes: 1 addition & 1 deletion bin/t/test-pt-config.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash

PATH=$PATH:..:../../deps/shunit2-2.1.6/src
export PATH
Expand Down
2 changes: 1 addition & 1 deletion bin/t/test-pt-index-usage.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash

PATH=$PATH:..:../../deps/shunit2-2.1.6/src
export PATH
Expand Down
2 changes: 1 addition & 1 deletion bin/t/test-pt-kill.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash

PATH=$PATH:..:../../deps/shunit2-2.1.6/src
export PATH
Expand Down
2 changes: 1 addition & 1 deletion bin/t/test-pt-proc-stat.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash

PATH=$PATH:..:../../deps/shunit2-2.1.6/src
export PATH
Expand Down
8 changes: 2 additions & 6 deletions bin/t/test-pt-replication-stat.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash

PATH=$PATH:..:../../deps/shunit2-2.1.6/src
export PATH
Expand All @@ -16,11 +16,7 @@ function setUp()

pgbench -i >> setUp.log 2>&1

if [ -f $PGHOME/share/contrib/pg_stat_statements.sql ]; then
psql -f $PGHOME/share/contrib/pg_stat_statements.sql >> setUp.log 2>&1
else
psql -c 'create extension pg_stat_statements' >> setUp.log 2>&1
fi
install_pg_stat_statements >> setUp.log 2>&1
}

function testReplicationStat001()
Expand Down
2 changes: 1 addition & 1 deletion bin/t/test-pt-session-profiler.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash

PATH=$PATH:..:../../deps/shunit2-2.1.6/src
export PATH
Expand Down
2 changes: 1 addition & 1 deletion bin/t/test-pt-set-tablespace.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash

PATH=$PATH:..:../../deps/shunit2-2.1.6/src
export PATH
Expand Down
8 changes: 2 additions & 6 deletions bin/t/test-pt-snap-statements.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash

PATH=$PATH:..:../../deps/shunit2-2.1.6/src
export PATH
Expand All @@ -16,11 +16,7 @@ function setUp()

pgbench -i >> setUp.log 2>&1

if [ -f $PGHOME/share/contrib/pg_stat_statements.sql ]; then
psql -f $PGHOME/share/contrib/pg_stat_statements.sql >> setUp.log 2>&1
else
psql -c 'create extension pg_stat_statements' >> setUp.log 2>&1
fi
install_pg_stat_statements >> setUp.log 2>&1

psql -c 'select pg_stat_statements_reset()' >> setUp.log 2>&1
}
Expand Down
15 changes: 4 additions & 11 deletions bin/t/test-pt-stat-snapshot.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash

PATH=$PATH:..:../../deps/shunit2-2.1.6/src
export PATH
Expand All @@ -12,16 +12,9 @@ function setUp()
# echo "PATH=$PATH"
# echo "PGHOME=$PGHOME"
# echo "PGDATA=$PGDATA"
if [ -f $PGHOME/share/contrib/pg_stat_statements.sql ]; then
psql -f $PGHOME/share/contrib/pg_stat_statements.sql >> setUp.log 2>&1
else
psql -c 'create extension pg_stat_statements' >> setUp.log 2>&1
fi
if [ -f $PGHOME/share/contrib/pgstattuple.sql ]; then
psql -f $PGHOME/share/contrib/pgstattuple.sql >> setUp.log 2>&1
else
psql -c 'create extension pgstattuple' >> setUp.log 2>&1
fi

install_pg_stat_statements >> setUp.log 2>&1
install_pgstattuple >> setUp.log 2>&1

ps auxx > setUp.log
}
Expand Down
2 changes: 1 addition & 1 deletion bin/t/test-pt-table-usage.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash

PATH=$PATH:..:../../deps/shunit2-2.1.6/src
export PATH
Expand Down
2 changes: 1 addition & 1 deletion bin/t/test-pt-tablespace-usage.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash

PATH=$PATH:..:../../deps/shunit2-2.1.6/src
export PATH
Expand Down
2 changes: 1 addition & 1 deletion bin/t/test-pt-verify-checksum.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash

PATH=$PATH:..:../../deps/shunit2-2.1.6/src
export PATH
Expand Down
2 changes: 1 addition & 1 deletion bin/t/test-pt-xact-stat.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash

PATH=$PATH:..:../../deps/shunit2-2.1.6/src
export PATH
Expand Down
23 changes: 23 additions & 0 deletions bin/t/test_common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,26 @@ function contains()
fi
}

function install_pg_stat_statements()
{
_SHARE_DIR=`$PGHOME/bin/pg_config --sharedir`

if [ -f $_SHARE_DIR/contrib/pg_stat_statements.sql ]; then
psql -f $_SHARE_DIR/contrib/pg_stat_statements.sql
else
psql -c 'create extension pg_stat_statements'
fi
}

function install_pgstattuple()
{
_SHARE_DIR=`$PGHOME/bin/pg_config --sharedir`

if [ -f $_SHARE_DIR/contrib/pgstattuple.sql ]; then
psql -f $_SHARE_DIR/contrib/pgstattuple.sql
else
psql -c 'create extension pgstattuple'
fi
}


7 changes: 4 additions & 3 deletions docs/en/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@ Supported OS

For a list of Operating System supported.

* Red Hat Enterprise Linux 6
* CentOS 6
* Red Hat Enterprise Linux 6 / CentOS 6
* Red Hat Enterprise Linux 7 / CentOS 7
* Ubuntu 14.04 LTS

Make sure you have Python2.6 is installed.
Make sure you have Python2.6 or Python2.7 is installed.


PostgreSQL Version
Expand Down
7 changes: 4 additions & 3 deletions docs/ja/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@

サポートされているOSとそのバージョンは以下の通りです。

* Red Hat Enterprise Linux 6
* CentOS 6
* Red Hat Enterprise Linux 6 / CentOS 6
* Red Hat Enterprise Linux 7 / CentOS 7
* Ubuntu 14.04 LTS

なお、Python2.6がインストールされている必要があります
なお、Python2.6またはPython2.7がインストールされている必要があります


PostgreSQLバージョン
Expand Down
2 changes: 1 addition & 1 deletion lib/DirectoryTree.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python2.6
#!/usr/bin/env python
# coding: UTF-8

# DirectoryTree
Expand Down
2 changes: 1 addition & 1 deletion lib/PsqlWrapper.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/env python2.6
#!/bin/env python
# coding: UTF-8

# PsqlWrapper
Expand Down
2 changes: 1 addition & 1 deletion lib/TcpdumpWrapper.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python2.6
#!/usr/bin/env python
# coding: UTF-8

# TcpdumpWrapper
Expand Down
2 changes: 1 addition & 1 deletion lib/log.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/env python2.6
#!/bin/env python
# coding: UTF-8

# log
Expand Down
2 changes: 1 addition & 1 deletion lib/testDirectoryTree.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/env python2.6
#!/usr/bin/env python
# coding: UTF-8

# testDirectoryTree
Expand Down
2 changes: 1 addition & 1 deletion lib/testLog.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/env python2.6
#!/usr/bin/env python
# coding: UTF-8

# testLog
Expand Down
2 changes: 1 addition & 1 deletion lib/testPsqlWrapper.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/env python2.6
#!/usr/bin/env python
# coding: UTF-8

# testPsqlWrapper
Expand Down

0 comments on commit 0eea27d

Please sign in to comment.