2

I would like to use the path to the certificate file installed as package ca-certificates via Homebrew in various configuration files (e.g. for isync/mbsync). The cert file is placed in a release-specific directory (currently homebrew/Cellar/ca-certificates/2024-07-02/share/ca-certificates/cacert.pem), though. Is there any way to modify the formula config locally, so a persistent symlink is added in the package directory with each update (or another workaround to achieve the goal stated above)?

0

1 Answer 1

4

When installed locally, use the --prefix option to determine the installation location:

% brew --prefix ca-certificates
/opt/homebrew/opt/ca-certificates

The structure of this folder has no versioned folders

% tree .
.
├── INSTALL_RECEIPT.json
└── share
    └── ca-certificates
        └── cacert.pem

3 directories, 2 files

So to reference the cacert.pem you want to use "$(brew --prefix ca-certificates)/share/ca-certificates/cacert.pem" like so:

% more "$(brew --prefix ca-certificates)/share/ca-certificates/cacert.pem"

##
## Bundle of CA Root Certificates
##
## Certificate data from Mozilla as of: Mon Mar 11 15:25:27 2024 GMT
##
...
2
  • 1
    Exactly, didn't know about the --prefix formula option. $(brew --prefix)/opt is maintained by brew and containts symlinks to the most recent version of each formula in Cellar.
    – nohillside
    Commented Jul 5 at 14:59
  • Thank you, that is exactly what I was looking for!
    – janeden
    Commented Jul 6 at 20:41

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .