diff options
author | The Bundler Bot <bot@bundler.io> | 2018-03-16 11:56:31 +0000 |
---|---|---|
committer | Colby Swandale <me@colby.fyi> | 2018-04-20 10:27:32 +1000 |
commit | e43d3deac9a2e0d620be7d56bc00d403b2601aa8 (patch) | |
tree | 63979b6bd8d932276fac8aaf5ceba100b32b3119 | |
parent | c47fc5d568eabf92c6e25e86c9fe964003dd1c5b (diff) | |
download | bundler-e43d3deac9a2e0d620be7d56bc00d403b2601aa8.tar.gz |
Auto merge of #6336 - bundler:segiddins/updater-use-more-filesystem-access, r=colby-swandale
[CompactIndexClient::Updater] Use filesystem_access when copying files
### What was the end-user problem that led to this PR?
The problem was users could see the error template when they do not have write permissions to their temporary directory.
Closes https://github.com/bundler/bundler/issues/6289
### What was your diagnosis of the problem?
My diagnosis was we need to use `SharedHelpers.filesystem_access` when writing files.
### What is your fix for the problem, implemented in this PR?
My fix wraps usage of `cp`
(cherry picked from commit b7b847fe734dc8d95782d2e6510c8bc9a6631374)
-rw-r--r-- | lib/bundler/compact_index_client/updater.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/bundler/compact_index_client/updater.rb b/lib/bundler/compact_index_client/updater.rb index 950306fee5..4d6eb80044 100644 --- a/lib/bundler/compact_index_client/updater.rb +++ b/lib/bundler/compact_index_client/updater.rb @@ -33,7 +33,9 @@ module Bundler # first try to fetch any new bytes on the existing file if retrying.nil? && local_path.file? - FileUtils.cp local_path, local_temp_path + SharedHelpers.filesystem_access(local_temp_path) do + FileUtils.cp local_path, local_temp_path + end headers["If-None-Match"] = etag_for(local_temp_path) headers["Range"] = if local_temp_path.size.nonzero? |