[MacPorts] #24786: Mailman -- preserve configuration file after uninstall

MacPorts noreply at macports.org
Tue May 4 13:22:36 PDT 2010


#24786: Mailman -- preserve configuration file after uninstall
---------------------------------+------------------------------------------
 Reporter:  mfisher@…            |       Owner:  macports-tickets@…                   
     Type:  enhancement          |      Status:  new                                  
 Priority:  Normal               |   Milestone:                                       
Component:  ports                |     Version:  1.8.2                                
 Keywords:                       |        Port:  mail/mailman                         
---------------------------------+------------------------------------------
 This is a hack/enhancement based on
 [http://trac.macports.org/wiki/PortfileRecipes#configfiles] that causes
 the mm_cfg.py file to be preserved (the Mailman installer creates it from
 mm_cfg.py.dist) after port uninstall.

 {{{
 --- Portfile    2010-05-04 16:00:20.000000000 -0400
 +++ mailman-portfile    2010-05-04 15:59:59.000000000 -0400
 @@ -91,8 +109,7 @@
         reinplace "s|@DATADIR@|${datadir}|"
 ${destroot}${confdir}/${name}.conf
         reinplace "s|@SHAREDIR@|${sharedir}|"
 ${destroot}${confdir}/${name}.conf
         reinplace "s|@CONFDIR@|${confdir}|" \
 -               ${destroot}${sharedir}/Mailman/mm_cfg.py.dist \
 -               ${destroot}${sharedir}/Mailman/mm_cfg.py
 +               ${destroot}${sharedir}/Mailman/mm_cfg.py.dist

         # Install documentation files
         xinstall -d -m 0755 ${destroot}${docdir}
 @@ -103,6 +120,12 @@
         # Check installation under destroot
         system "cd ${destroot}${sharedir} && \
                 DESTDIR=${destroot} PYTHONPATH=.:./pythonlib
 ./bin/check_perms"
 +
 +       # Don't pull forward the system-built mm_cfg.py because it'd
 +       # be uninstalled, even if modified by the user.
 +       if {[file exists ${destroot}${sharedir}/Mailman/mm_cfg.py]} {
 +               delete ${destroot}${sharedir}/Mailman/mm_cfg.py
 +       }
  }

  post-install {
 @@ -141,3 +164,12 @@
         ui_msg
 "------------------------------------------------------------"
  }

 +post-activate {
 +       # Check for an existing mm_cfg.py and copy the "dist" version
 +       # into place (like the real build does) if there isn't one.
 +       if {![file exists ${sharedir}/Mailman/mm_cfg.py]} {
 +               file copy ${sharedir}/Mailman/mm_cfg.py.dist \
 +                       ${sharedir}/Mailman/mm_cfg.py
 +       }
 +}

 }}}

-- 
Ticket URL: <http://trac.macports.org/ticket/24786>
MacPorts <http://www.macports.org/>
Ports system for Mac OS


More information about the macports-tickets mailing list