Skip to content

Commit

Permalink
Don't use unzip -u modifier; fix for sous-chefs#93
Browse files Browse the repository at this point in the history
  • Loading branch information
what do you want? committed Dec 16, 2014
1 parent 1f7c092 commit 0e63aff
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions libraries/unzip_command_builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ def unpack
if resource.strip_components > 0
unzip_with_strip_components
else
"unzip -q -u -o #{resource.release_file} -d #{resource.path}"
"unzip -q -o #{resource.release_file} -d #{resource.path}"
end
end

def dump
"unzip -j -q -u -o \"#{resource.release_file}\" -d \"#{resource.path}\""
"unzip -j -q -o \"#{resource.release_file}\" -d \"#{resource.path}\""
end

def cherry_pick
Expand All @@ -34,7 +34,7 @@ def initialize(resource)
def unzip_with_strip_components
tmpdir = make_temp_directory
strip_dir = '*/' * resource.strip_components
cmd = "unzip -q -u -o #{resource.release_file} -d #{tmpdir}"
cmd = "unzip -q -o #{resource.release_file} -d #{tmpdir}"
cmd += " && rsync -a #{tmpdir}/#{strip_dir} #{resource.path}"
cmd += " && rm -rf #{tmpdir}"
cmd
Expand Down
2 changes: 1 addition & 1 deletion spec/libraries/default_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@
release_file: "/resource/release_file",
path: "/resource/path")

expect(dump_command).to eq("unzip -j -q -u -o \"/resource/release_file\" -d \"/resource/path\"")
expect(dump_command).to eq("unzip -j -q -o \"/resource/release_file\" -d \"/resource/path\"")
end
end
end
Expand Down
6 changes: 3 additions & 3 deletions spec/libraries/unzip_command_builder_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
context 'when the resource does not strip components' do

it "generates the correct command" do
expected_command = "unzip -q -u -o release_file -d path"
expected_command = "unzip -q -o release_file -d path"
expect(subject.unpack).to eq(expected_command)
end
end
Expand All @@ -32,7 +32,7 @@
end

it "generates the correct command" do
expected_command = "unzip -q -u -o release_file -d temp_directory && rsync -a temp_directory/*/ path && rm -rf temp_directory"
expected_command = "unzip -q -o release_file -d temp_directory && rsync -a temp_directory/*/ path && rm -rf temp_directory"
allow(subject).to receive(:make_temp_directory) { "temp_directory" }
expect(subject.unpack).to eq(expected_command)
end
Expand All @@ -41,7 +41,7 @@

describe "#dump" do
it "generates the correct command" do
expected_command = "unzip -j -q -u -o \"release_file\" -d \"path\""
expected_command = "unzip -j -q -o \"release_file\" -d \"path\""
expect(subject.dump).to eq(expected_command)
end
end
Expand Down

0 comments on commit 0e63aff

Please sign in to comment.