port notes

Ryan Schmidt ryandesign at macports.org
Sat May 1 12:51:46 PDT 2010


On May 1, 2010, at 14:27, Scott Haneda wrote:

> Can "note" only be called once per Portfile?
> 
>    notes "this is a test"
>    port notes
>      pure-ftpd has the following notes:
>      this is a test
> 
>    notes "this is a test"
>    notes "this is a second test"
>    port notes
>      pure-ftpd has the following notes:
>      this is a second test
> 
>    notes "this is a multiline test
>    with this being the second line"
>    notes "a second notes block"
>    port notes
>      pure-ftpd has the following notes:
>      a second notes block

Yes, it looks like "notes" can only be called once. You can however build up the notes in a regular Tcl variable, e.g.:

set my_notes Here are some notes.
append my_notes Here are some more notes.

And then use the notes command with that variable at the end of the portfile.

notes ${my_notes}


> When are notes printed out, only on user instantiation of the `port notes <portname>` command, or do they get printed on `port install <portname>` as well?

Both. Try it out and see.


> Right now, in the pure-ftpd port, I have an entire post-activate phase that is all ui_msg, which I believe could be entirely changed to notes.  Should I do a conditional check to make sure the port is installed, or is that taken care of by MacPorts internals?

port notes can be displayed whether or not the port is installed by typing "port notes <portname>".


> For example, I now have:
>    ui_msg "You can start ${pretty_name} from the command line with:"
>    ui_msg "    sudo ${prefix}/sbin/${name} &"
> 
> That would not make a lot of sense to display via `port notes` if the software is not installed.  So I should wrap those blocks in a condition that checks if the port was installed?

Hm. I'm not sure.


> What is the best way to check if a port is installed?  I was going to do a file exists check on the binary, but there probably is a better way to actually look in the MacPorts registry maybe.

If you want to go this route, I would recommend doing the file exists check you planned. The commands for looking in the registry are not commands that are supposed to be available to portfiles.





More information about the macports-dev mailing list