Publicizing MacPorts [installation]
Joshua Root
jmr at macports.org
Sat May 22 18:31:26 UTC 2021
On 2021-5-23 03:12 , Bjarne D Mathiesen wrote:
>
>
> Artem Loenko wrote:
>> Yes, thanks for the tips! I am pretty sure that it is possible to automate it one way or another. But my point is that it would be helpful to have a one-liner to install MacPorts and maintain it as a part of the main repository.
>>
>
> I'm 90% there there with this :
> /usr/bin/env bash -c $( curl -fsSL --url
> 'https://trac.macports.org/raw-attachment/wiki/howto/AdvancedDailyAdm/macports.bash'
> ) install
>
> When I'm running this as my normal un-privileged user,
> it executes 🤓👍🏻 (and fails because it's un-privileged)
>
> !!! but !!! if I try this as my admin user, nothing happens 🤔🤓👎🏻
> There's some obscure security setting I presently can't fathom, because
> I can run the script locally (without curl) without any issues. And it
> does download - it just doesn't execute 👎🏻🤔🤓🤔👎🏻
That's probably Gatekeeper and/or the Quarantine attribute doing its
thing and stopping you from running arbitrary code straight from the
web. curl | sh or the equivalent should be considered an antipattern (at
one point there was even a tumblr hall of shame for it.)
I think the best thing we could do to facilitate one-liner command line
installation is set up a redirect so you can download the latest binary
installer for your OS version without having to construct its
not-so-easy-to-derive name yourself. It would then be simple to download
the .pkg and feed it to installer(8).
- Josh
More information about the macports-dev
mailing list