[MacPorts] #66348: logrotate: doesn't install default startitem

MacPorts noreply at macports.org
Sat Nov 26 01:14:20 UTC 2022


#66348: logrotate: doesn't install default startitem
------------------------+------------------------
  Reporter:  catap      |      Owner:  ctreleaven
      Type:  defect     |     Status:  assigned
  Priority:  Normal     |  Milestone:
 Component:  ports      |    Version:
Resolution:             |   Keywords:
      Port:  logrotate  |
------------------------+------------------------

Comment (by jmroot):

 It's checking `if {[variant_isset startupitem]` but there is no such
 variant in the port. The code for installing the startupitem could be
 greatly simplified with the new `startupitem.custom_file` option in
 MacPorts 2.8. Something like this (untested):
 {{{#!diff
 --- a/sysutils/logrotate/Portfile
 +++ b/sysutils/logrotate/Portfile
 @@ -66,22 +66,16 @@ configure.args-append \

  destroot.keepdirs   ${destroot}${prefix}/etc/logrotate.d \
                      ${destroot}${prefix}/var/run/logrotate
 +
 +startupitem.type    launchd
 +startupitem.create  no
 +startupitem.custom_file
 ${worksrcpath}/org.macports.logrotate.plist.example
 +
  post-destroot {
      xinstall -d ${destroot}${prefix}/share/${name}
         xinstall -m 644 -W ${worksrcpath} ChangeLog.md COPYING \
 -           logrotate.conf.example org.macports.logrotate.plist.example \
 +           logrotate.conf.example \
                 ${destroot}${prefix}/share/${name}
 -
 -    if {[variant_isset startupitem]
 -    && ${startupitem.install} != "no"
 -    && [getuid] == 0} {
 -
 -        xinstall -d
 ${destroot}${prefix}/etc/LaunchDaemons/org.macports.logrotate
 -        xinstall -d ${destroot}/Library/LaunchDaemons
 -        xinstall -m 644
 ${destroot}${prefix}/share/${name}/org.macports.logrotate.plist.example \
 -
 ${destroot}${prefix}/etc/LaunchDaemons/org.macports.logrotate/org.macports.logrotate.plist
 -        ln -sf
 "${prefix}/etc/LaunchDaemons/org.macports.logrotate/org.macports.logrotate.plist"
 "${destroot}/Library/LaunchDaemons/org.macports.logrotate.plist"
 -    }
  }

  post-activate {
 }}}

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


More information about the macports-tickets mailing list