metaonly module xdc.tools.path.Main |
 |
Command implementation
This tool displays the packages located along the specified package
repository path. Repositories can be specified by explicitly naming
them via the
-Pr option or implicitly by not passing
-Pr; in
this case, the set of repositories searched corresponds to the set of
repositories defined by the current package path:
[
more ... ]
var Main = xdc.useModule('xdc.tools.path.Main');
module-wide constants & types
module-wide config parameters
'[-n] [-x] [-v] [-H header] [-p] [-c] [-P package_base_dir ...|-Pr repository ...|-PR directory ...]'
];
module-wide functions
per-instance config parameters
per-instance functions
DETAILS
This tool displays the packages located along the specified package
repository path. Repositories can be specified by explicitly naming
them via the -Pr option or implicitly by not passing -Pr; in
this case, the set of repositories searched corresponds to the set of
repositories defined by the current package path:
$XDCPATH;$XDCROOT/packages;^
where $XDCPATH is the value of the the user settable prefix of
the package path, $XDCROOT is the installation directory of the
XDC tools, and ^ is the repository of the package in the current
working directory (if it exists).
EXAMPLES
1. To display information about the packages on the package path
(in this example, the package path is just C:/xdc-o00/packages):
Output:
Package Name: gnu.gdb.jserver
Repository: C:/xdc-o00/packages
Release Name: gnu_gdb_jserver
Label: default
Compatibility Key: 1, 0, 0, 0, 87
Date: 11/20/2006 20:38
Package Name: gnu.targets
Repository: C:/xdc-o00/packages
Release Name: gnu_targets
Label: default
Compatibility Key: 1, 0, 0, 0, 194
Date: 11/20/2006 20:38
2. To display the names of the packages on the package path
(in this example, the package path is just C:/xdc-o00/packages):
Output:
gnu.gdb.jserver
gnu.targets
gnu.targets.rts470MV
gnu.targets.rts470uC
gnu.targets.rts5
3. To simply, echo the current package path:
Output:
4. To display information about the packages "rooted" in the repository
C:/CCStudio_v3.3/bios_5_31/packages:
xs xdc.tools.path -Pr C:/CCStudio_v3.3/bios_5_31/packages
Output:
Package Name: ti.platforms.dsk5402
Repository: C:/CCStudio_v3.3/bios_5_31/packages
Release Name: ti_platforms_dsk5402
Label: default
Compatibility Key: 1, 0, 0, 24
Date: 05/11/2006 19:10
Package Name: ti.platforms.dsk5416
Repository: C:/CCStudio_v3.3/bios_5_31/packages
Release Name: ti_platforms_dsk5416
Label: default
Compatibility Key: 1, 0, 0, 24
Date: 05/11/2006 19:10
Package Name: ti.platforms.dsk5510
Repository: C:/CCStudio_v3.3/bios_5_31/packages
Release Name: ti_platforms_dsk5510
Label: default
Compatibility Key: 1, 0, 0, 24
Date: 05/11/2006 19:10
5. To display the names of all packages in or below the directory
C:/CCStudio_v3.3/bios_5_31/packages:
xs xdc.tools.path -n -PR C:/CCStudio_v3.3/bios_5_31/packages
Output:
ti.platforms.dsk5402
ti.platforms.dsk5416
ti.platforms.dsk5510
ti.platforms.dsk6211
SEE
struct Main.CheckResults |
 |
var obj = new Main.CheckResults;
obj.repository = String ...
obj.warnings = String[] ...
struct Main.DirResults |
 |
return value for xml directory echo
var obj = new Main.DirResults;
obj.header = String ...
// user-specified header
obj.dir = String[] ...
// array of package base directories
struct Main.NameResults |
 |
return value for xml package names
var obj = new Main.NameResults;
obj.header = String ...
// user-specified header
obj.path = String ...
// package path
obj.name = String[] ...
// array of names
struct Main.PathResults |
 |
return value for xml package path
var obj = new Main.PathResults;
obj.header = String ...
// user-specified header
obj.path = String ...
// package path
struct Main.Pkg |
 |
struct used for xml package info
var obj = new Main.Pkg;
obj.name = String ...
obj.repository = String ...
obj.release = String ...
obj.label = String ...
obj.key = String ...
obj.date = String ...
obj.providerId = String ...
obj.originalProviderId = String ...
obj.producerId = String ...
struct Main.Results |
 |
return value for xml package info
var obj = new Main.Results;
obj.header = String ...
// user-specified header
obj.path = String ...
// package path
// array of packages
config Main.usage // module-wide |
 |
Usage for this command
Main.usage = String[] [
'[-n] [-x] [-v] [-H header] [-p] [-c] [-P package_base_dir ...|-Pr repository ...|-PR directory ...]'
];
Main.exec() // module-wide |
 |
xs script entry point
Main.exec(Any args) returns Any
DETAILS
This function is called from within other XDCscript scripts and
performs the same operations as
main() except that,
rather than output the return value of
inst.run(), this value
is simply returned to the caller of
exec().
Main.main() // module-wide |
 |
xs shell entry point
Main.main(Any args) returns Any
DETAILS
This function
- creates a no-arg instance, inst, of the module inheriting
this interface;
- parses command line arguments placing all options in the config
params of the inheriting module;
- creates a xdc.tools.Cmdr instance, cmdr;
- calls inst.run() with the cmdr and any command
line command line arguments not parsed as options; and
- outputs the return result from inst.run()
Instance Config Parameters |
 |
var params = new Main.Params;
// Instance config-params object
params.arrFlag = Bool false;
// Return an array of strings
params.checkFlag = Bool false;
// Check repositories for possible errors
params.directoriesFlag = Bool false;
// Only display information for the package directories
params.header = String null;
// Header label
params.pathFlag = Bool false;
// Echo path
params.recurseFlag = Bool false;
// Recursively find all packages
params.repositoriesFlag = Bool false;
// Use specified directory args instead of xdc.path
params.shortFlag = Bool false;
// Display package names only
params.verboseFlag = Bool false;
// Print informative messages during execution
params.xmlFlag = Bool false;
// Return a Results struct as XML
config Main.Params.arrFlag // instance |
 |
Return an array of strings
var params = new Main.Params;
...
params.arrFlag = Bool false;
config Main.Params.checkFlag // instance |
 |
Check repositories for possible errors
var params = new Main.Params;
...
params.checkFlag = Bool false;
config Main.Params.directoriesFlag // instance |
 |
Only display information for the package directories
var params = new Main.Params;
...
params.directoriesFlag = Bool false;
config Main.Params.header // instance |
 |
Header label
var params = new Main.Params;
...
params.header = String null;
config Main.Params.pathFlag // instance |
 |
Echo path
var params = new Main.Params;
...
params.pathFlag = Bool false;
config Main.Params.recurseFlag // instance |
 |
Recursively find all packages
var params = new Main.Params;
...
params.recurseFlag = Bool false;
DETAILS
Recursively descend into specified directories and find every
package, including packages whose repository is not one of
the specified directories.
config Main.Params.repositoriesFlag // instance |
 |
Use specified directory args instead of xdc.path
var params = new Main.Params;
...
params.repositoriesFlag = Bool false;
config Main.Params.shortFlag // instance |
 |
Display package names only
var params = new Main.Params;
...
params.shortFlag = Bool false;
config Main.Params.verboseFlag // instance |
 |
Print informative messages during execution
var params = new Main.Params;
...
params.verboseFlag = Bool false;
config Main.Params.xmlFlag // instance |
 |
Return a Results struct as XML
var params = new Main.Params;
...
params.xmlFlag = Bool false;
Main.run() // instance |
 |
Underlying implementation of the command
DETAILS
Since this method is used to support both command line tools and
other XDCscript scripts, it is important to avoid explicit
termination of the JVM via java.lang.System.exit(); doing so
precludes callers from handling failures.
Implementations should instead call
generated on Wed, 09 Apr 2014 00:37:51 GMT