more on trunk/dports/www/wikkawiki/Portfile

Ryan Schmidt ryandesign at macports.org
Wed Feb 11 08:49:29 PST 2009


On Feb 11, 2009, at 09:02, Jeremy Lavergne wrote:

> I've got a few more questions relevant to wikkawiki's portfile.
>
> There's a post-activate section to show a ui_msg, should that just  
> be post-destroot?

Messages usually should get shown at post-activate or maybe post- 
install time. I think the idea is that you get to see the messages  
even if you are just activating a previously deactivated port, though  
that appears to be broken at the moment:

http://trac.macports.org/ticket/18273


> Also, can xinstall replace the following line from the destroot phase?
> #file attributes ${wikkapath}/wikka.config.php -permissions 0666
> xinstall -m 0666 {$wikkapath}/wikka.config.php

"file attributes" sets the attributes of a file. It's like "chmod" on  
the command line.

"xinstall" copies a file from one place to another, and if you use  
the "-m" switch, also sets the permissions of the copy.


So if you were copying a file into the destroot and wanted to set its  
permissions in some way, then xinstall can do both of those things in  
one command.


In this case I see the port does:

     touch ${wikkapath}/wikka.config.php
     file attributes ${wikkapath}/wikka.config.php -permissions 0666

So it looks like it's creating an empty file and making sure it's  
writable.

Is wikka.config.php a file the user is expected to edit? If so, the  
port should not provide it. Otherwise, the user would edit it, and at  
the next upgrade of the port, the user's edits will be destroyed.  
Instead, the port should provide a sample config file in a file of  
another name (e.g. wikka.config.php.sample) and advise the user to  
copy this to wikka.config.php and edit it.




More information about the macports-dev mailing list