MPPort


A representation of a port.

Superclass: MPMutableDictionary
Declared In: MPPort.h



Methods

-init
Initializes this port with a MPPortStateUnkown state
-initWithCapacity:
Initializes this port with a MPPortStateUnkown state
-initWithTclListAsString:
Initializes this port with an NSString derived from a Tcl list
-name
Returns the name of this port
-version
Returns the version of this port
-depends
Returns an array of NSString port names of dependencies of this port
-uninstallWithOptions:withVersion:
Deactivates and uninstalls this MPPort from the MacPorts system
-activateWithOptions:withVersion:
Activates an installed MPPort.
-deactivateWithOptions:withVersion:
Deactivates an installed MPPort.
-exec:withOptions:withVariants:
Executes the specified target for this MPPort
-configureWithOptions:withVariants:
Runs a configure process for this port.
-buildWithOptions:withVariants:
Builds this port.
-testWithOptions:withVariants:
Tests this port.
-destrootWithOptions:withVariants:
Installs this port to a temporary directory
-installWithOptions:withVariants:
Installs this port.
-archiveWithOptions:withVariants:
Archives port for later unarchving.
-createDmgWithOptions:withVariants:
Creates an internet-enabled disk image containing OS X package of this
-createMdmgWithOptions:withVariants:
Create an internet-enabled disk image containing an OS X metapackage of this
-createPkgWithOptions:withVariants:
Creates an OS X installer package of this port
-createMpkgWithOptions:withVariants:
Creates an OS X installer metapackage of this this port and
-createRpmWithOptions:withVariants:
Creates and RPM binary package of this port. This is similar to a
-createDpkgWithOptions:withVariants:
Creates a DEB binary package of this port.
-createSrpmWithOptions:withVariants:
Creates an SRPM source package of this port, similar to a xar "portpkg".
-setPortWithTclListAsString:
Sets the attributes of this MPPort using the given string
-addDependencyAsPortName:
Adds the name of an MPPort to the list of this MPPort's dependencies
-setState:
Sets the state of this MPPort object
-setStateFromReceipts:
Sets the state of this MPPort object from its receipts

init


Initializes this port with a MPPortStateUnkown state

- (id)init;
Discussion

Calls [self initWithCapacity:15]


initWithCapacity:


Initializes this port with a MPPortStateUnkown state

- (id)initWithCapacity:(unsigned)numItems; 
Parameters
numItems
The number of items to be stored with this port


initWithTclListAsString:


Initializes this port with an NSString derived from a Tcl list

- (id)initWithTclListAsString:(NSString *)string; 
Parameters
string
The NSString object used to initialize this MPPort object
Discussion

The Tcl list is usually obtained from doing a search query for some particular port.

IS THIS METHOD JUST FOR INTERNAL USE? IT LOOKS LIKE IT ... ASK RANDALL ABOUT THAT


name


Returns the name of this port

- (NSString *)name; 


version


Returns the version of this port

- (NSString *)version; 


depends


Returns an array of NSString port names of dependencies of this port

- (NSArray *)depends; 
Discussion

The MPPort object has internal dictionary lists of MPPort names for the following dependency types: depend_libs, depend_run and depend_build. The NSArray returned contains all of these dependencies in a single Array.

ISN'T INFORMATION LOST BY JUST CREATING A SINGLE ARAY WITH ALL OF THESE DEPENDENCIES? PERHAPS A DIFFERENT DATA STRUCTURE CAN BE USED THAT LETS US REMEMBER WHAT TYPE OF DEPENDENCY EACH DEPENDENCY IS?


uninstallWithOptions:withVersion:


Deactivates and uninstalls this MPPort from the MacPorts system

- (void)uninstallWithOptions:(NSArray *)options withVersion:(NSString *)version; 
Parameters
options
An NSArray of NSStrings of options for this uninstallation execution
version
An NSString indicating which version of this port to uninstall
Discussion

version should NOT be nil


activateWithOptions:withVersion:


Activates an installed MPPort.

- (void)activateWithOptions:(NSArray *)options withVersion:(NSString *)version; 
Parameters
options
An NSArray of NSStrings of options for port activation
version
An NSString indicating which version of this port to activate
Discussion

version should NOT be nil. The activated port should have been already installed. This happens automatically during a default installation of a port. This means activation of a port should occur only if the port had been previously deactivated after a default installation.


deactivateWithOptions:withVersion:


Deactivates an installed MPPort.

- (void)deactivateWithOptions:(NSArray *)options withVersion:(NSString *)version; 
Parameters
options
An NSArray of NSStrings of options for port deactivation
version
An NSString indicating which version of this port to deactivate
Discussion

version should NOT be nil. Only installed and active ports should be deactivated


exec:withOptions:withVariants:


Executes the specified target for this MPPort

-(void)exec:(NSString *)target withOptions:(NSArray *)options 
        withVariants:(NSArray *)variants; 
Parameters
target
NSString target to be executed for this MPPort
options
An NSArray of NSStrings for the various options for this target
variants
An NSArray of NSStrings for the various variants for this target
Discussion

The various options for target are: configure, build, test, destroot, install, archive, dmg, mdmg, pkg, mpkg, rpm, dpkg, srpm. Users of -exec are responsible for ensuring that execution happens in an authorized environment for various targets.

ADD SOMETHING HERE ABOUT VARIANTS AND OPTIONS


configureWithOptions:withVariants:


Runs a configure process for this port.

-(void)configureWithOptions:(NSArray *)options withVariants:(NSArray *)variants; 
Parameters
options
An NSArray of NSStrings of the various options for this target
variants
An NSArray of NSStrings of the various variants for this target


buildWithOptions:withVariants:


Builds this port.

-(void)buildWithOptions:(NSArray *)options withVariants:(NSArray *)variants; 
Parameters
options
An NSArray of NSStrings of the various options for this target
variants
An NSArray of NSStrings of the various variants for this target


testWithOptions:withVariants:


Tests this port.

-(void)testWithOptions:(NSArray *)options withVariants:(NSArray *)variants; 
Parameters
options
An NSArray of NSStrings of the various options for this target
variants
An NSArray of NSStrings of the various variants for this target


destrootWithOptions:withVariants:


Installs this port to a temporary directory

-(void)destrootWithOptions:(NSArray *)options withVariants:(NSArray *)variants; 
Parameters
options
An NSArray of NSStrings of the various options for this target
variants
An NSArray of NSStrings of the various variants for this target


installWithOptions:withVariants:


Installs this port.

-(void)installWithOptions:(NSArray *)options withVariants:(NSArray *)variants; 
Parameters
options
An NSArray of NSStrings of the various options for this target
variants
An NSArray of NSStrings of the various variants for this target
Discussion

Installing a port automatically activates it.


archiveWithOptions:withVariants:


Archives port for later unarchving.

-(void)archiveWithOptions:(NSArray *)options withVariants:(NSArray *)variants; 
Discussion

Archive mode must be enabled for this command to work. This is done by setting portarchivemode to yes in the macports.conf file located in ${prefix}/etc/macports/macports.conf. With archive mode enabled, binary archives are created automatically whenever an install is performed.


createDmgWithOptions:withVariants:


Creates an internet-enabled disk image containing OS X package of this

-(void)createDmgWithOptions:(NSArray *)options withVariants:(NSArray *)variants; 
Parameters
options
An NSArray of NSStrings of the various options for this target
variants
An NSArray of NSStrings of the various variants for this target
Discussion

port


createMdmgWithOptions:withVariants:


Create an internet-enabled disk image containing an OS X metapackage of this

-(void)createMdmgWithOptions:(NSArray *)options withVariants:(NSArray *)variants; 
Parameters
options
An NSArray of NSStrings of the various options for this target
variants
An NSArray of NSStrings of the various variants for this target
Discussion

port


createPkgWithOptions:withVariants:


Creates an OS X installer package of this port

-(void)createPkgWithOptions:(NSArray *)options withVariants:(NSArray *)variants; 
Parameters
options
An NSArray of NSStrings of the various options for this target
variants
An NSArray of NSStrings of the various variants for this target


createMpkgWithOptions:withVariants:


Creates an OS X installer metapackage of this this port and

-(void)createMpkgWithOptions:(NSArray *)options withVariants:(NSArray *)variants; 
Parameters
options
An NSArray of NSStrings of the various options for this target
variants
An NSArray of NSStrings of the various variants for this target
Discussion

its dependencies


createRpmWithOptions:withVariants:


Creates and RPM binary package of this port. This is similar to a

-(void)createRpmWithOptions:(NSArray *)options withVariants:(NSArray *)variants; 
Parameters
options
An NSArray of NSStrings of the various options for this target
variants
An NSArray of NSStrings of the various variants for this target
Discussion

tgz "archive".


createDpkgWithOptions:withVariants:


Creates a DEB binary package of this port.

-(void)createDpkgWithOptions:(NSArray *)options withVariants:(NSArray *)variants; 
Parameters
options
An NSArray of NSStrings of the various options for this target
variants
An NSArray of NSStrings of the various variants for this target


createSrpmWithOptions:withVariants:


Creates an SRPM source package of this port, similar to a xar "portpkg".

-(void)createSrpmWithOptions:(NSArray *)options withVariants:(NSArray *)variants; 
Parameters
options
An NSArray of NSStrings of the various options for this target
variants
An NSArray of NSStrings of the various variants for this target


setPortWithTclListAsString:


Sets the attributes of this MPPort using the given string

- (void) setPortWithTclListAsString:(NSString *)string; 
Parameters
string
An NSString object derived from a Tcl list containing this port's attributes
Discussion

The Tcl list is obtained from the PortIndex which contains a list of serialized Tcl key-value lists, one list per line. This list is then broken up into a dictionary of attributes for the MPPort.


addDependencyAsPortName:


Adds the name of an MPPort to the list of this MPPort's dependencies

- (void) addDependencyAsPortName:(NSString *)dependency; 
Parameters
dependency
The NSString name of the MPPort to be added
Discussion

This MPPort object contains an internal list of port names for MPPorts which it depends on. This list is returned by the depends method and is populated by this method.


setState:


Sets the state of this MPPort object

- (void)setState:(int)state; 
Discussion

Possible values are MPPortStateUnknown, MPPortStateLearnState, MPPortStateActive, MPPortStateInstalled, MPPortStateOutdated, MPPortStateNotInstalled.


setStateFromReceipts:


Sets the state of this MPPort object from its receipts

- (void)setStateFromReceipts:(NSArray *)receipts; 
Parameters
receipts
An NSArray of receipts for this port
Discussion

It is possible for an installed port to have more than one receipt if the MacPorts system uses hardlinks to activate the port.

Last Updated: Sunday, July 13, 2008