[emt] r244 committed - Squashed some newer php 5 warnings. Changed the spec file buildroot pa...

2 views
Skip to first unread message

e...@googlecode.com

unread,
Jul 9, 2013, 6:29:50 PM7/9/13
to emt...@googlegroups.com
Revision: 244
Author: eric....@gmail.com
Date: Tue Jul 9 15:29:29 2013
Log: Squashed some newer php 5 warnings. Changed the spec file
buildroot path to work with newer rpmbuild. Updated tests to redirect
stderr into log files so php warnings will break the test.
http://code.google.com/p/emt/source/detail?r=244

Modified:
/trunk/base/field.php
/trunk/base/io_base.php
/trunk/base/view.php
/trunk/bin/emt_view
/trunk/emt.spec.template
/trunk/etc/cron.d/emt.cron
/trunk/scripts/build_rpm.sh
/trunk/test/test.sh

=======================================
--- /trunk/base/field.php Fri Apr 13 09:26:31 2012
+++ /trunk/base/field.php Tue Jul 9 15:29:29 2013
@@ -80,18 +80,18 @@
* field type and precision but feel free to
* override it.
*/
- function display_format($value)
+ function display_format()
{
if ($this->type == 'tag')
- return $value;
+ return $this->value;

- if ($value == 'NULL')
+ if ($this->value == 'NULL')
return '';

if ($this->display_format == DISPLAY_INT)
{

- return round($value, $this->precision);
+ return round($this->value, $this->precision);
}

if ($this->display_format == DISPLAY_BYTES)
@@ -99,19 +99,19 @@
/**
* Human readable form should go here
*/
- if ($value > 1024 * 1024 * 1024)
- return round($value / 1024 / 1024 / 1024,
$this->precision) . 'G';
+ if ($this->value > 1024 * 1024 * 1024)
+ return round($this->value / 1024 / 1024 / 1024,
$this->precision) . 'G';

- if ($value > 1024 * 1024)
- return round($value / 1024 / 1024, $this->precision) . 'M';
+ if ($this->value > 1024 * 1024)
+ return round($this->value / 1024 / 1024,
$this->precision) . 'M';

- if ($value > 1024)
- return round($value / 1024, $this->precision) . 'K';
+ if ($this->value > 1024)
+ return round($this->value / 1024, $this->precision) . 'K';

- return round($value, $this->precision) . 'B';
+ return round($this->value, $this->precision) . 'B';
}

- return $value;
+ return $this->value;
}

function split_lines()
@@ -181,9 +181,9 @@
$this->value = date('Y-m-d H:i:s');
}

- function display_format($value)
+ function display_format()
{
- return substr($value, 0, 16);
+ return substr($this->value, 0, 16);
}
}

=======================================
--- /trunk/base/io_base.php Fri Apr 13 09:26:31 2012
+++ /trunk/base/io_base.php Tue Jul 9 15:29:29 2013
@@ -56,7 +56,7 @@
* Optional if your i/o handler supports reading data
*/

- function read_last_records($count, $view)
+ function read_last_records($count)
{
die("Output handler does not support read method
read_last_records\n");
}
=======================================
--- /trunk/base/view.php Mon May 21 18:10:37 2012
+++ /trunk/base/view.php Tue Jul 9 15:29:29 2013
@@ -109,7 +109,7 @@

function display_format()
{
- return parent::display_format($this->value);
+ return parent::display_format();
}
}

=======================================
--- /trunk/bin/emt_view Fri Apr 13 09:26:31 2012
+++ /trunk/bin/emt_view Tue Jul 9 15:29:29 2013
@@ -151,8 +151,8 @@
else
{
//print "2 namespace len: $namespace_len\n";
- $namespace_len += $disp_f[$i]->display_len;
- //print "3 namespace len: $namespace_len\n";
+ $namespace_len += $disp_f[$i]->display_len;
+ //print "3 namespace len: $namespace_len\n";

$header = str_repeat('-', $namespace_len) . ' ';
$header{0} = '[';
@@ -160,7 +160,7 @@

$namespace = $disp_f[$i]->$property;

- $j = floor((strlen($header) / 2) - (strlen($namespace) / 2));
+ $j = (int)floor((strlen($header) / 2) - (strlen($namespace) /
2));

for ($c = 0; $c < strlen($namespace); $c++) {
$header{$j++} = $namespace{$c};
=======================================
--- /trunk/emt.spec.template Fri Apr 13 09:26:31 2012
+++ /trunk/emt.spec.template Tue Jul 9 15:29:29 2013
@@ -8,6 +8,7 @@
Packager: Eric Bergen <er...@provenscaling.com>
BuildArch: noarch
Requires: gmp >= 4.1.4 sysstat >= 5.0.5
+Requires: php-process
Requires: /usr/bin/php

%files
=======================================
--- /trunk/etc/cron.d/emt.cron Sun Sep 7 20:07:03 2008
+++ /trunk/etc/cron.d/emt.cron Tue Jul 9 15:29:29 2013
@@ -1,2 +1,2 @@
-* * * * * emt /opt/emt/bin/emt_gather 60 2>&1 > /dev/null
+* * * * * emt /opt/emt/bin/emt_gather 60 2>&1

=======================================
--- /trunk/scripts/build_rpm.sh Mon Feb 6 13:38:39 2012
+++ /trunk/scripts/build_rpm.sh Tue Jul 9 15:29:29 2013
@@ -5,7 +5,7 @@
fi

echo "Recreating buildroot"
-BUILDROOT=/tmp/emt_buildroot
+BUILDROOT=/tmp/emt_buildroot/rpmbuild/BUILDROOT/emt-0.2-243.x86_64/

rm -fr $BUILDROOT

=======================================
--- /trunk/test/test.sh Mon Jan 9 20:49:04 2012
+++ /trunk/test/test.sh Tue Jul 9 15:29:29 2013
@@ -8,29 +8,29 @@
../bin/emt_dump_conf

echo "Testing gather"
-../bin/emt_gather
+../bin/emt_gather 2> run/emt_gather
sed -r "$SED_CMD" < run/gather > /tmp/t;
mv /tmp/t run/gather;

echo "Testing emt_view output from local_text"
-../bin/emt_view -f test_single,test_multiple | sed -r "$SED_CMD" >
run/emt_view
+../bin/emt_view -f test_single,test_multiple 2>&1 | sed -r "$SED_CMD" >
run/emt_view

echo "Testing single field emt_view -l -f test_single from local_text"
-../bin/emt_view -l -f test_single | sed -r "$SED_CMD" >
run/emt_view_single
+../bin/emt_view -l -f test_single 2>&1 | sed -r "$SED_CMD" >
run/emt_view_single

echo "Testing multiple field emt_view -l -f test_multiple from local_text"
-../bin/emt_view -l -f test_multiple | sed -r "$SED_CMD" >
run/emt_view_multiple
+../bin/emt_view -l -f test_multiple 2>&1 | sed -r "$SED_CMD" >
run/emt_view_multiple

export EMT_CNF=./etc/emt_sqlite_input.cnf

echo "Testing emt_view output from sqlite3"
-../bin/emt_view -f test_single,test_multiple | sed -r "$SED_CMD" >
run/emt_view.sqlite
+../bin/emt_view -f test_single,test_multiple 2>&1 | sed -r "$SED_CMD" >
run/emt_view.sqlite

echo "Testing single field emt_view -l -f test_single from sqlite3"
-../bin/emt_view -l -f test_single | sed -r "$SED_CMD" >
run/emt_view_single.sqlite
+../bin/emt_view -l -f test_single 2>&1 | sed -r "$SED_CMD" >
run/emt_view_single.sqlite

echo "Testing multiple field emt_view -l -f test_multiple from sqlite3"
-../bin/emt_view -l -f test_multiple | sed -r "$SED_CMD" >
run/emt_view_multiple.sqlite
+../bin/emt_view -l -f test_multiple 2>&1 | sed -r "$SED_CMD" >
run/emt_view_multiple.sqlite

diff -u golden/ run/
if [ $? != 0 ]; then
Reply all
Reply to author
Forward
0 new messages