[57854] trunk/dports/www/phpmyadmin/Portfile

Ryan Schmidt ryandesign at macports.org
Thu Sep 17 08:44:29 PDT 2009


On Sep 17, 2009, at 10:36, alakazam at macports.org wrote:

> Revision: 57854
>          http://trac.macports.org/changeset/57854
> Author:   alakazam at macports.org
> Date:     2009-09-17 08:36:12 -0700 (Thu, 17 Sep 2009)
> Log Message:
> -----------
> Upgrade phpMyAdmin to 3.2.2 and correctly create a configuration  
> file in ${prefix}/etc/ so that upgrading won't destroy previous  
> configuration files. Closes tickets #21437 and #20769.

> Modified: trunk/dports/www/phpmyadmin/Portfile

> destroot {
> -    xinstall -d -m 0755 ${docpath}/phpmyadmin
> -    eval copy [glob ${worksrcpath}/*] ${docpath}/phpmyadmin
> +    xinstall -d -m 0755 ${docroot}
> +    eval copy [glob ${worksrcpath}/*] ${docroot}
> +
> +    ln -s ${configfile} ${docroot}/config.inc.php
> +
> +    if {![file exists ${configfile}]} {
> +        xinstall -m 644 ${worksrcpath}/config.sample.inc.php $ 
> {configfile}
> +
> +        ui_msg "A new configuration file has been created at $ 
> {configfile}."
> +        ui_msg "Please refer to the ${my_name} documentation when  
> editing this file,"
> +        ui_msg "an online version of which can be found at $ 
> {homepage}documentation/Documentation.html#config"
> +        ui_msg ""
> +    }
> }

If you need to create files (like config files) outside of the  
destroot, you should do so in the post-activate phase, not in the  
destroot phase.




More information about the macports-dev mailing list