Commit f549df66 authored by Scott Hain's avatar Scott Hain

Merge pull request #553 from chef/shain/fix_bff_regression

Fixed regression with AIX package ownership in staging directory
parents 825096bb 3efce740
......@@ -173,7 +173,7 @@ module Omnibus
# This implies that if we are in /tmp/staging/project/dir/things,
# we will chown from 'project' on, rather than 'project/dir', which leaves
# project owned by the build user (which is incorrect)
shellout!("sudo chown -R 0:0 #{File.join(staging_dir, project.install_dir)}")
shellout!("sudo chown -R 0:0 #{File.join(staging_dir, project.install_dir.match(/^\/?(\w+)/).to_s)}") { "Creating .bff file" }
# Since we want the owner to be root, we need to sudo the mkinstallp
......@@ -163,6 +163,15 @@ module Omnibus
allow(Dir).to receive(:chdir) { |_, &b| }
it 'chowns the directory' do
# A note - the /opt/ here is essentially project.install_dir one level up.
# There is nothing magical about 'opt' as a directory.
expect(subject).to receive(:shellout!)
.with(/chown -R 0:0 #{staging_dir}\/opt$/)
it 'logs a message' do
output = capture_logging { subject.create_bff_file }
expect(output).to include('Creating .bff file')
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment