[packages/ruby-ohai] fix builddate in php version

glen glen at pld-linux.org
Thu Sep 12 21:04:45 CEST 2013


commit 38a0d4455eaa0c4820fa4949f10f78a6cd4bfe78
Author: Elan Ruusamäe <glen at delfi.ee>
Date:   Thu Sep 12 22:04:27 2013 +0300

    fix builddate in php version

 php-builddate.patch | 23 +++++++++++++++++++++++
 ruby-ohai.spec      |  4 +++-
 2 files changed, 26 insertions(+), 1 deletion(-)
---
diff --git a/ruby-ohai.spec b/ruby-ohai.spec
index f02bdb1..5a08d54 100644
--- a/ruby-ohai.spec
+++ b/ruby-ohai.spec
@@ -6,12 +6,13 @@
 Summary:	Profiles your system and emits JSON
 Name:		ruby-%{pkgname}
 Version:	6.16.0
-Release:	4
+Release:	5
 License:	Apache v2.0
 Group:		Development/Languages
 Source0:	https://github.com/opscode/ohai/archive/%{version}.tar.gz
 # Source0-md5:	5c00b0ba4c313bedfec62cd5e1525551
 Patch0:		virtualization-vserver.patch
+Patch1:		php-builddate.patch
 URL:		http://docs.opscode.com/ohai.html
 BuildRequires:	rpm-rubyprov
 BuildRequires:	rpmbuild(macros) >= 1.665
@@ -53,6 +54,7 @@ This package contains documentation for %{name}.
 %prep
 %setup -q -n ohai-%{version}
 %patch0 -p1
+%patch1 -p1
 %{__sed} -i -e '1 s,#!.*ruby,#!%{__ruby},' bin/*
 
 # no plist and not darwin so don't care
diff --git a/php-builddate.patch b/php-builddate.patch
new file mode 100644
index 0000000..091c534
--- /dev/null
+++ b/php-builddate.patch
@@ -0,0 +1,23 @@
+fix build date parsing from php if php patched with suhosin:
+
+$ php -v
+PHP 5.3.27 with Suhosin-Patch (cli) (built: Aug 30 2013 04:30:30) 
+Copyright (c) 1997-2013 The PHP Group
+Zend Engine v2.3.0, Copyright (c) 1998-2013 Zend Technologies
+
+--- ohai-6.16.0/lib/ohai/plugins/php.rb	2013-01-17 21:03:16.000000000 +0200
++++ ohai-6.16.0/lib/ohai/plugins/php.rb	2013-09-11 15:26:11.000000000 +0300
+@@ -26,10 +26,10 @@
+ 
+ status, stdout, stderr = run_command(:no_status_check => true, :command => "php -v")
+ if status == 0
+-  output = stdout.split
+-  if output.length >= 6
++  output = /PHP (\S+).+built: ([^)]+)/.match(stdout)
++  if output
+     php[:version] = output[1]
+-    php[:builddate] = "%s %s %s" % [output[4],output[5],output[6]]
++    php[:builddate] = output[2]
+   end
+   languages[:php] = php if php[:version]
+ end
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/ruby-ohai.git/commitdiff/38a0d4455eaa0c4820fa4949f10f78a6cd4bfe78



More information about the pld-cvs-commit mailing list