GSoC 2014 - Interactive Port Command and

Joshua Root jmr at macports.org
Thu Mar 20 02:51:08 PDT 2014


On 2014-3-20 12:29 , Marcus Santos wrote:
> 
> Can you help me with some questions I have about base/src/port/port.tcl and base/src/macports1.0.tcl?
> 
> First of all I need to understand how they work together and what is the role of each one. I have been around the code of the progress bar to understand how it works and trying to realize how can I do the interaction between the user and macports, and where to assess the input from the user. Second, how can I use the interface of macports1.0 to allow asking user questions?

port.tcl is the port(1) command. It also contains a fair bit of code
that could be factored out and used by multiple front ends (if we had
them). This script is responsible for parsing and evaluating the command
line arguments and running the appropriate actions. UI stuff, basically.

macports.tcl provides an API (but no UI) for running targets on ports,
as well as some other stuff like selfupdate. First you mportinit, then
you mportlookup to find the port you want, then you mportopen it, then
you mportexec one or more targets on it, then when you're done you
mportclose it.

You wouldn't really use macports1.0 to ask the user questions, that
would be the role of the new interactive UI that you're going to write.
You would attempt to do things using the macports1.0 API, then if they
don't succeed, you would examine the error code and offer the user
appropriate choices depending on the situation.

You may or may not need to modify macports1.0 to give the front end more
information to support this.

- Josh


More information about the macports-dev mailing list