From ec0965e2672899d25a5a3a8c072de3ea734076a2 Mon Sep 17 00:00:00 2001 From: V Date: Wed, 9 Jun 2021 15:43:16 +0200 Subject: fleet: init Co-authored-by: edef Change-Id: I36d2c4cca542ed91630b1b832f3c7a7b97b33c65 --- .../permission-warnings-only-when-necessary.patch | 50 ++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 fleet/pkgs/permission-warnings-only-when-necessary.patch (limited to 'fleet/pkgs/permission-warnings-only-when-necessary.patch') diff --git a/fleet/pkgs/permission-warnings-only-when-necessary.patch b/fleet/pkgs/permission-warnings-only-when-necessary.patch new file mode 100644 index 0000000..4a557a5 --- /dev/null +++ b/fleet/pkgs/permission-warnings-only-when-necessary.patch @@ -0,0 +1,50 @@ +SPDX-FileCopyrightText: David Rodríguez +SPDX-License-Identifier: MIT +--- a/lib/bundler.rb ++++ b/lib/bundler.rb +@@ -236,8 +236,9 @@ def user_home + end + + if warning +- user_home = tmp_home_path(warning) +- Bundler.ui.warn "#{warning}\nBundler will use `#{user_home}' as your home directory temporarily.\n" ++ Bundler.ui.warn "#{warning}\n" ++ user_home = tmp_home_path ++ Bundler.ui.warn "Bundler will use `#{user_home}' as your home directory temporarily.\n" + user_home + else + Pathname.new(home) +@@ -684,15 +685,13 @@ def configure_gem_home + Bundler.rubygems.clear_paths + end + +- def tmp_home_path(warning) ++ def tmp_home_path + Kernel.send(:require, "tmpdir") + SharedHelpers.filesystem_access(Dir.tmpdir) do + path = Bundler.tmp + at_exit { Bundler.rm_rf(path) } + path + end +- rescue RuntimeError => e +- raise e.exception("#{warning}\nBundler also failed to create a temporary home directory':\n#{e}") + end + + # @param env [Hash] + +--- a/lib/bundler/settings.rb ++++ b/lib/bundler/settings.rb +@@ -428,12 +428,8 @@ def printable_value(value, key) + def global_config_file + if ENV["BUNDLE_CONFIG"] && !ENV["BUNDLE_CONFIG"].empty? + Pathname.new(ENV["BUNDLE_CONFIG"]) +- else +- begin +- Bundler.user_bundle_path("config") +- rescue PermissionError, GenericSystemCallError +- nil +- end ++ elsif Bundler.rubygems.user_home && !Bundler.rubygems.user_home.empty? ++ Pathname.new(Bundler.rubygems.user_home).join(".bundle/config") + end + end -- cgit 1.4.1