[MacPorts] #55671: burp @2.0.54: unversioned turd file in etc

MacPorts noreply at macports.org
Thu Jan 11 10:44:24 UTC 2018


#55671: burp @2.0.54: unversioned turd file in etc
------------------------+------------------
 Reporter:  ryandesign  |      Owner:  drkp
     Type:  defect      |     Status:  new
 Priority:  Normal      |  Milestone:
Component:  ports       |    Version:
 Keywords:              |       Port:  burp
------------------------+------------------
 The port installs an unversioned turd file into its etc directory. Ports
 should not install unversioned files, except for config files and other
 files the user is expected to edit.

 The portfile says:

 {{{
 destroot.keepdirs ${prefix}/etc/burp/CA-client
 }}}

 This instructs MacPorts to install the file `${prefix}/etc/burp/CA-
 client/.turd_burp` directly, bypassing the destroot. This file is not
 registered to the port and remains when the port is deactivated. This is
 not desired.

 The purpose of `destroot.keepdirs` is to prevent MacPorts from deleting
 what would otherwise be an empty directory during the cleanup that happens
 after the destroot phase. The cleanup only affects the contents of
 `${destroot}` so there's no need to use `destroot.keepdirs` for anything
 that's outside of `${destroot}`.

 Most everything done in the destroot phase should happen inside
 `${destroot}` so that it is registered to the port. So the above needs to
 be changed to:

 {{{
 destroot.keepdirs ${destroot}${prefix}/etc/burp/CA-client
 }}}

 This changes the files registered to the port, so its revision should be
 increased.

 After this change, the port will fail to activate for any user who had
 previously installed the port and therefore has the unversioned turd file
 on their system. (This coincidentally includes our buildbot workers.) To
 fix this, a `pre-activate` block should be added to the port to prevent
 the activation failure:

 {{{
 pre-activate {
     # Prevent activation failure for upgrades. This can be removed after
 January 2019.
     foreach filepath "${prefix}/etc/burp/CA-client/.turd_${subport}" {
         if {[file exists ${filepath}] && [registry_file_registered
 ${filepath}] == "0"} {
             if {[catch {delete ${filepath}}]} {
                 ui_warn "Cannot delete ${filepath}; please remove it
 manually"
             }
         }
     }
 }
 }}}

 This block can be removed after everyone has upgraded to the new version.
 To give everyone time to do that, I'd leave the block in place for one
 year at least.

--
Ticket URL: <https://trac.macports.org/ticket/55671>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list