[qpid-cpp/f17] Removed colons from conditions in QMF Ruby.

Darryl L. Pierce mcpierce at fedoraproject.org
Fri Jun 29 23:30:49 UTC 2012


commit 458aa640d65abb6a99710f6f389fb48930efb535
Author: Darryl L. Pierce <dpierce at redhat.com>
Date:   Fri Jun 29 17:12:13 2012 -0400

    Removed colons from conditions in QMF Ruby.
    
    - Fixed string encoding for Ruby.

 02-Remove-colons-from-conditionals.patch |   44 +
 03-Fix-string-encoding.patch             |   93 ++
 configure.patch                          |   10 -
 fedora.patch                             | 2497 ------------------------------
 qpid-0.14-size_t.patch                   |   12 -
 qpid-cpp-singleton.patch                 |   22 -
 qpid-cpp.spec                            |   10 +-
 store.patch                              |   10 -
 unistd.patch                             |   64 -
 9 files changed, 146 insertions(+), 2616 deletions(-)
---
diff --git a/02-Remove-colons-from-conditionals.patch b/02-Remove-colons-from-conditionals.patch
new file mode 100644
index 0000000..1ae96c4
--- /dev/null
+++ b/02-Remove-colons-from-conditionals.patch
@@ -0,0 +1,44 @@
+From 38f8e3f8f803a02f20282914be3d245bda330e22 Mon Sep 17 00:00:00 2001
+From: tross <tross at 13f79535-47bb-0310-9956-ffa450edef68>
+Date: Mon, 16 Apr 2012 15:49:48 +0000
+Subject: [PATCH 1/2] QPID-3924 - Remove colons from conditionals that cause
+ problems in Ruby 1.9 Applied patch from Darryl Pierce.
+
+git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1326659 13f79535-47bb-0310-9956-ffa450edef68
+---
+ qpid/cpp/bindings/qmf/ruby/qmf.rb |    5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/qpid/cpp/bindings/qmf/ruby/qmf.rb b/qpid/cpp/bindings/qmf/ruby/qmf.rb
+index 34d3255..2cf7233 100644
+--- a/qpid/cpp/bindings/qmf/ruby/qmf.rb
++++ b/qpid/cpp/bindings/qmf/ruby/qmf.rb
+@@ -26,6 +26,7 @@ module Qmf
+ 
+   # Pull all the TYPE_* constants into Qmf namespace.  Maybe there's an easier way?
+   Qmfengine.constants.each do |c|
++    c = c.to_s
+     if c.index('TYPE_') == 0 or c.index('ACCESS_') == 0 or c.index('DIR_') == 0 or
+         c.index('CLASS_') == 0 or c.index('SEV_') == 0
+       const_set(c, Qmfengine.const_get(c))
+@@ -348,7 +349,7 @@ module Qmf
+       @broker = kwargs[:broker] if kwargs.include?(:broker)
+       @allow_sets = :true
+ 
+-      if cls:
++      if cls
+         @event_class = cls
+         @impl = Qmfengine::Event.new(@event_class.impl)
+       elsif kwargs.include?(:impl)
+@@ -434,7 +435,7 @@ module Qmf
+       @allow_sets = :false
+       @broker = kwargs[:broker] if kwargs.include?(:broker)
+ 
+-      if cls:
++      if cls
+         @object_class = cls
+         @impl = Qmfengine::Object.new(@object_class.impl)
+       elsif kwargs.include?(:impl)
+-- 
+1.7.10.4
+
diff --git a/03-Fix-string-encoding.patch b/03-Fix-string-encoding.patch
new file mode 100644
index 0000000..6cc3010
--- /dev/null
+++ b/03-Fix-string-encoding.patch
@@ -0,0 +1,93 @@
+From 5414fdbd56688522e5a391a930937be1f6eab937 Mon Sep 17 00:00:00 2001
+From: tross <tross at 13f79535-47bb-0310-9956-ffa450edef68>
+Date: Mon, 16 Apr 2012 15:57:03 +0000
+Subject: [PATCH 2/2] QPID-3925 - Fix string encoding support for Ruby 1.9
+ Applied patch from Will Benton/Darryl Pierce
+
+git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1326663 13f79535-47bb-0310-9956-ffa450edef68
+---
+ qpid/cpp/bindings/qmf/ruby/qmf.rb |   21 +++++++++++++++++----
+ 1 file changed, 17 insertions(+), 4 deletions(-)
+
+diff --git a/qpid/cpp/bindings/qmf/ruby/qmf.rb b/qpid/cpp/bindings/qmf/ruby/qmf.rb
+index 2cf7233..9fbd50c 100644
+--- a/qpid/cpp/bindings/qmf/ruby/qmf.rb
++++ b/qpid/cpp/bindings/qmf/ruby/qmf.rb
+@@ -33,12 +33,21 @@ module Qmf
+     end
+   end
+ 
++  module StringHelpers
++    def ensure_encoding(str)
++      enc = (Encoding.default_external.name || "UTF-8" rescue "UTF-8")
++      str.respond_to?(:force_encoding) ? str.force_encoding(enc) : str
++    end
++  end
++
+   class Util
++    include StringHelpers
++
+     def qmf_to_native(val)
+       case val.getType
+       when TYPE_UINT8, TYPE_UINT16, TYPE_UINT32 then val.asUint
+       when TYPE_UINT64                          then val.asUint64
+-      when TYPE_SSTR, TYPE_LSTR                 then val.asString
++      when TYPE_SSTR, TYPE_LSTR                 then ensure_encoding(val.asString)
+       when TYPE_ABSTIME                         then val.asInt64
+       when TYPE_DELTATIME                       then val.asUint64
+       when TYPE_REF                             then ObjectId.new(val.asObjectId)
+@@ -162,6 +171,7 @@ module Qmf
+   ##==============================================================================
+ 
+   class ConnectionSettings
++    include StringHelpers
+     attr_reader :impl
+ 
+     def initialize(url = nil)
+@@ -193,7 +203,7 @@ module Qmf
+     def get_attr(key)
+       _v = @impl.getAttr(key)
+       if _v.isString()
+-        return _v.asString()
++        return ensure_encoding(_v.asString())
+       elsif _v.isUint()
+         return _v.asUint()
+       elsif _v.isBool()
+@@ -708,6 +718,8 @@ module Qmf
+   end
+ 
+   class MethodResponse
++    include StringHelpers
++
+     def initialize(impl)
+       @impl = Qmfengine::MethodResponse.new(impl)
+     end
+@@ -721,7 +733,7 @@ module Qmf
+     end
+ 
+     def text
+-      exception.asString
++      ensure_encoding(exception.asString)
+     end
+ 
+     def args
+@@ -886,6 +898,7 @@ module Qmf
+   end
+ 
+   class SchemaClassKey
++    include StringHelpers
+     attr_reader :impl
+     def initialize(i)
+       @impl = Qmfengine::SchemaClassKey.new(i)
+@@ -900,7 +913,7 @@ module Qmf
+     end
+ 
+     def to_s
+-      @impl.asString
++      ensure_encoding(@impl.asString)
+     end
+   end
+ 
+-- 
+1.7.10.4
+
diff --git a/qpid-cpp.spec b/qpid-cpp.spec
index d91f742..37a18c9 100644
--- a/qpid-cpp.spec
+++ b/qpid-cpp.spec
@@ -30,7 +30,7 @@
 
 Name:           qpid-cpp
 Version:        0.16
-Release:        2%{?dist}
+Release:        3%{?dist}
 Summary:        Libraries for Qpid C++ client applications
 License:        ASL 2.0
 URL:            http://qpid.apache.org
@@ -65,6 +65,8 @@ BuildRequires: db4-devel
 BuildRequires: libaio-devel
 
 Patch0: 01-make-BrokerImportExport.h-public.patch
+Patch1: 02-Remove-colons-from-conditionals.patch
+patch2: 03-Fix-string-encoding.patch
 
 %description
 
@@ -534,6 +536,8 @@ Summary: Perl bindings for Apache Qpid Messaging
 %setup -q -T -D -b 1 -n qpid-%{version}
 
 %patch0 -p2
+%patch1 -p2
+%patch2 -p2
 
 %global perftests "qpid-perftest qpid-topic-listener qpid-topic-publisher qpid-latency-test qpid-client-test qpid-txtest"
 
@@ -704,6 +708,10 @@ rm -rf %{buildroot}
 
 
 %changelog
+* Fri Jun 29 2012 Darryl L. Pierce <dpierce at redhat.com> - 0.16-3
+- Removed colons from conditions in QMF Ruby.
+- Fixed string encoding for Ruby.
+
 * Wed Jun 27 2012 Darryl L. Pierce <dpierce at redhat.com> - 0.16-2
 - Makes qmf/BrokerImportExport.h public.
 


More information about the scm-commits mailing list