[MacPorts] #69854: `port` instructs users to start LaunchAgents with `sudo port load`

MacPorts noreply at macports.org
Mon Apr 29 11:53:04 UTC 2024


#69854: `port` instructs users to start LaunchAgents with `sudo port load`
---------------------+--------------------
  Reporter:  RJVB    |      Owner:  (none)
      Type:  defect  |     Status:  new
  Priority:  Normal  |  Milestone:
 Component:  base    |    Version:
Resolution:          |   Keywords:
      Port:          |
---------------------+--------------------

Comment (by RJVB):

 Hmmm, it looks like that requires `SUDO_USER` to be set, which I'll assume
 is the case with a normally configured set-up.

 The message remains a bit misleading IMHO as it suggests (incorrectly)
 that non-admin users can't use the feature. I know they wouldn't normally
 see the message at all (and admin users also discover only after install a
 port that provides the feature), but I still think the message could be
 improved ... and added to `long_description`, maybe?

 The easiest solution here would probably be to add something like
 `startupitem.note` so ports can override the standard message with a
 tailored one.
 (I'm thinking a port like `port:dbus` could benefit from that to summarise
 when to use which kind of bus.)

 FWIW, I did find a way to override the note and remove the "sudo"
 instruction, but it looks like a bit of a hack:
 {{{
     # startup item stuff that presumably triggers the installation of the
 add_notes callback

     proc modify_notes {} {
         global notes
         notes {*}[string map {"sudo " ""} ${notes}]
     }
     port::register_callback modify_notes
 }}}

 For some reasons neither `notes.delete` nor `notes.replace` worked here.

-- 
Ticket URL: <https://trac.macports.org/ticket/69854#comment:2>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list