Skip to content

Commit

Permalink
Use pkgbuild's --install-location flag when fpm's --prefix is given.
Browse files Browse the repository at this point in the history
A user reported that on macOS Catalina, the default pkgbuild install
location may result in a .pkg file which cannot be installed.

This change makes fpm's `--prefix` option pass through to `pkgbuild`'s
`--install-location` flag

> With macOS Catalina, you can no longer store files or data in the read-only system volume, nor can you write to the "root" directory ( / ) from the command line, such as with Terminal.

References:
* macOS Catalina's new read-only root filesystem: https://support.apple.com/en-us/HT210650

Fixes #1908
  • Loading branch information
jordansissel committed Jun 4, 2022
1 parent 40795d4 commit 8e40ccf
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/fpm/package/osxpkg.rb
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,11 @@ def output(output_path)
write_scripts
args += ["--scripts", scripts_path]
end

if attributes[:prefix]
args += ["--install-location", attributes[:prefix]]
end

args << output_path

safesystem("pkgbuild", *args)
Expand Down

0 comments on commit 8e40ccf

Please sign in to comment.