[DRE-commits] [ruby-aws-sdk] 01/04: Refactor bundled file patchs

David Suárez deiv-guest at moszumanska.debian.org
Mon Sep 22 19:08:30 UTC 2014


This is an automated email from the git hooks/post-receive script.

deiv-guest pushed a commit to branch master
in repository ruby-aws-sdk.

commit 13db83f0f4d975ec94c4d859005f8a641b7b9f24
Author: David Suárez <david.sephirot at gmail.com>
Date:   Mon Sep 22 20:39:54 2014 +0200

    Refactor bundled file patchs
---
 debian/patches/series                              |  3 +-
 .../use-correct-path-for-bundled-certificate       | 16 ------
 .../patches/use-correct-path-for-bundled-enpoints  | 17 ------
 debian/patches/use-correct-path-for-bundled-files  | 60 ++++++++++++++++++++++
 4 files changed, 61 insertions(+), 35 deletions(-)

diff --git a/debian/patches/series b/debian/patches/series
index f217548..fad9abb 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,3 +1,2 @@
 use-correct-path-for-autoload
-use-correct-path-for-bundled-certificate
-use-correct-path-for-bundled-enpoints
+use-correct-path-for-bundled-files
diff --git a/debian/patches/use-correct-path-for-bundled-certificate b/debian/patches/use-correct-path-for-bundled-certificate
deleted file mode 100644
index 0076824..0000000
--- a/debian/patches/use-correct-path-for-bundled-certificate
+++ /dev/null
@@ -1,16 +0,0 @@
-Description: Use the correct path to load the blunded certificate
-
-Author: David Suárez <david.sephirot at gmail.com>
-Last-Update: 2014-09-08
-
---- a/lib/aws/core/configuration.rb
-+++ b/lib/aws/core/configuration.rb
-@@ -525,7 +525,7 @@ module AWS
-       add_option :ssl_verify_peer, true, :boolean => true
- 
-       add_option :ssl_ca_file,
--        File.expand_path(File.dirname(__FILE__) + "/../../../ca-bundle.crt")
-+        File.expand_path("/usr/share/ruby-aws-sdk/ca-bundle.crt")
- 
-       add_option :ssl_ca_path
- 
diff --git a/debian/patches/use-correct-path-for-bundled-enpoints b/debian/patches/use-correct-path-for-bundled-enpoints
deleted file mode 100644
index 0837414..0000000
--- a/debian/patches/use-correct-path-for-bundled-enpoints
+++ /dev/null
@@ -1,17 +0,0 @@
-Description: Use the correct path to load the blunded endpoints file
-
-Author: David Suárez <david.sephirot at gmail.com>
-Last-Update: 2014-09-08
-
---- ruby-aws-sdk-1.52.0.orig/lib/aws/core/endpoints.rb
-+++ ruby-aws-sdk-1.52.0/lib/aws/core/endpoints.rb
-@@ -27,7 +27,7 @@ module AWS
- 
-       def endpoints
-         @endpoints ||= begin
--          JSON.parse(File.read(File.join(AWS::ROOT, 'endpoints.json')))
-+          JSON.parse(File.read(File.join('/usr/share/ruby-aws-sdk', 'endpoints.json')))
-         end
-       end
-       module_function :endpoints
-
diff --git a/debian/patches/use-correct-path-for-bundled-files b/debian/patches/use-correct-path-for-bundled-files
new file mode 100644
index 0000000..7e82e64
--- /dev/null
+++ b/debian/patches/use-correct-path-for-bundled-files
@@ -0,0 +1,60 @@
+Description: Use the correct path to load the blunded files
+
+Author: David Suárez <david.sephirot at gmail.com>
+Last-Update: 2014-09-22
+
+--- a/lib/aws/core.rb
++++ b/lib/aws/core.rb
+@@ -151,6 +151,8 @@ module AWS
+ 
+   SRC = ROOT #+ '/vendor_ruby/aws'
+ 
++  SHARE = '/usr/share/ruby-aws-sdk'
++
+   autoload :Errors, "#{SRC}/errors"
+   autoload :Record, "#{SRC}/record"
+   autoload :VERSION, "#{SRC}/version"
+@@ -676,7 +678,7 @@ module AWS
+       @versions ||= begin
+         # get a list of support services/apis from disk
+         versions = {}
+-        pattern = File.join(File.dirname(__FILE__), 'api_config', '*.yml')
++        pattern = File.join(AWS::SHARE, 'api_config', '*.yml')
+         Dir.glob(pattern).each do |path|
+           matches = path.match(/(\w+)-(\d{4}-\d{2}-\d{2})/)
+           svc = SERVICES[$1].full_name
+--- a/lib/aws/core/client.rb
++++ b/lib/aws/core/client.rb
+@@ -688,8 +688,8 @@ module AWS
+         #   (e.g. '2012-01-05').
+         # @return [Hash]
+         def load_api_config api_version
+-          lib = File.dirname(File.dirname(__FILE__))
+-          path = "#{lib}/api_config/#{service_name}-#{api_version}.yml"
++          #lib = File.dirname(File.dirname(__FILE__))
++          path = File.join(AWS::SHARE, "api_config/#{service_name}-#{api_version}.yml")
+           YAML.load(File.read(path))
+         end
+ 
+--- a/lib/aws/core/configuration.rb
++++ b/lib/aws/core/configuration.rb
+@@ -525,7 +525,7 @@ module AWS
+       add_option :ssl_verify_peer, true, :boolean => true
+ 
+       add_option :ssl_ca_file,
+-        File.expand_path(File.dirname(__FILE__) + "/../../../ca-bundle.crt")
++        File.join(AWS::SHARE, 'ca-bundle.crt')
+ 
+       add_option :ssl_ca_path
+ 
+--- a/lib/aws/core/endpoints.rb
++++ b/lib/aws/core/endpoints.rb
+@@ -27,7 +27,7 @@ module AWS
+ 
+       def endpoints
+         @endpoints ||= begin
+-          JSON.parse(File.read(File.join(AWS::ROOT, 'endpoints.json')))
++          JSON.parse(File.read(File.join(AWS::SHARE, 'endpoints.json')))
+         end
+       end
+       module_function :endpoints

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/ruby-aws-sdk.git



More information about the Pkg-ruby-extras-commits mailing list