[DRE-commits] [berkshelf] 02/03: Better version of patch for data root

Hleb Valoshka tsfgnu-guest at moszumanska.debian.org
Tue Oct 18 20:56:39 UTC 2016


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

tsfgnu-guest pushed a commit to branch master
in repository berkshelf.

commit 8e5ac73687836296c69dc701386c061c3c82fdc0
Author: Hleb Valoshka <375gnu at gmail.com>
Date:   Tue Oct 18 23:41:00 2016 +0300

    Better version of patch for data root
---
 ...0003-Use-usr-share-berkshelf-as-data-root.patch | 63 ++++++++++++++++++----
 .../0009-Use-better-temporary-path-in-tests.patch  | 18 ++++++-
 2 files changed, 68 insertions(+), 13 deletions(-)

diff --git a/debian/patches/0003-Use-usr-share-berkshelf-as-data-root.patch b/debian/patches/0003-Use-usr-share-berkshelf-as-data-root.patch
index 0a65aea..3110c48 100644
--- a/debian/patches/0003-Use-usr-share-berkshelf-as-data-root.patch
+++ b/debian/patches/0003-Use-usr-share-berkshelf-as-data-root.patch
@@ -3,27 +3,68 @@ Date: Fri, 8 Apr 2016 18:26:03 +0300
 Subject: Use /usr/share/berkshelf as data root
 
 ---
- lib/berkshelf.rb | 10 +++++++++-
- 1 file changed, 9 insertions(+), 1 deletion(-)
+ lib/berkshelf.rb             | 6 +++++-
+ spec/spec_helper.rb          | 7 +++++++
+ spec/support/path_helpers.rb | 8 ++++++--
+ 3 files changed, 18 insertions(+), 3 deletions(-)
 
 diff --git a/lib/berkshelf.rb b/lib/berkshelf.rb
-index f0f4cfc..441e77c 100644
+index f0f4cfc..6ce1740 100644
 --- a/lib/berkshelf.rb
 +++ b/lib/berkshelf.rb
-@@ -51,7 +51,15 @@ module Berkshelf
+@@ -51,7 +51,11 @@ module Berkshelf
  
      # @return [Pathname]
      def root
 -      @root ||= Pathname.new(File.expand_path('../', File.dirname(__FILE__)))
 +      @root ||= Pathname.new(
 +        Dir[
-+          File.expand_path(
-+            File.join(File.dirname(__FILE__), %w[.. .. .. share berkshelf])
-+          ),
-+          File.expand_path('../', File.dirname(__FILE__)),
-+          '/usr/share/berkshelf'
-+        ].first
-+      )
++          '/usr/share/berkshelf',
++          File.expand_path('../', File.dirname(__FILE__)))
++        ].first)
      end
  
      # @return [Berkshelf::Shell]
+diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
+index 8dbaa4c..f5454bb 100644
+--- a/spec/spec_helper.rb
++++ b/spec/spec_helper.rb
+@@ -67,6 +67,13 @@ end
+   require 'berkshelf'
+ 
+   module Berkshelf
++    class BaseGenerator
++      class << self
++        def source_root
++          Pathname.new(File.expand_path(File.join(File.dirname(__FILE__), %w[.. generator_files])))
++        end
++      end
++    end
+     class GitLocation
+       include Berkshelf::RSpec::Git
+ 
+diff --git a/spec/support/path_helpers.rb b/spec/support/path_helpers.rb
+index 59a03e0..3d21e22 100644
+--- a/spec/support/path_helpers.rb
++++ b/spec/support/path_helpers.rb
+@@ -26,14 +26,18 @@ module Berkshelf
+       #
+       # @return [Pathname]
+       def fixtures_path
+-        Berkshelf.root.join('spec/fixtures')
++        Pathname.new(
++          File.expand_path(
++            File.join(File.dirname(__FILE__), %w[.. fixtures])))
+       end
+ 
+       # The path to the Chef config fixture
+       #
+       # @return [String]
+       def chef_config_path
+-        Berkshelf.root.join('spec/config/knife.rb').to_s
++        Pathname.new(
++          File.expand_path(
++            File.join(File.dirname(__FILE__), %w[.. config/knife.rb]))).to_s
+       end
+ 
+       # The actual Chef config object
diff --git a/debian/patches/0009-Use-better-temporary-path-in-tests.patch b/debian/patches/0009-Use-better-temporary-path-in-tests.patch
index 60b2f15..1e06e8c 100644
--- a/debian/patches/0009-Use-better-temporary-path-in-tests.patch
+++ b/debian/patches/0009-Use-better-temporary-path-in-tests.patch
@@ -1,12 +1,26 @@
 From: Hleb Valoshka <375gnu at gmail.com>
-Date: Tue, 18 Oct 2016 23:24:12 +0300
+Date: Tue, 18 Oct 2016 23:40:48 +0300
 Subject: Use better temporary path in tests
 
 This should fix 'gem2deb-test-runner --autopkgtest' run
 ---
+ lib/berkshelf.rb             | 2 +-
  spec/support/path_helpers.rb | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
+ 2 files changed, 2 insertions(+), 2 deletions(-)
 
+diff --git a/lib/berkshelf.rb b/lib/berkshelf.rb
+index 6ce1740..456248d 100644
+--- a/lib/berkshelf.rb
++++ b/lib/berkshelf.rb
+@@ -54,7 +54,7 @@ module Berkshelf
+       @root ||= Pathname.new(
+         Dir[
+           '/usr/share/berkshelf',
+-          File.expand_path('../', File.dirname(__FILE__)))
++          File.expand_path('../', File.dirname(__FILE__))
+         ].first)
+     end
+ 
 diff --git a/spec/support/path_helpers.rb b/spec/support/path_helpers.rb
 index 3d21e22..a07d20b 100644
 --- a/spec/support/path_helpers.rb

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



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