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 ... ]
Configuration settings sourced in xdc/tools/path/Main.xdc
var Main = xdc.useModule('xdc.tools.path.Main');
module-wide constants & types
    var obj = new Main.CheckResults// ;
        obj.repository = String  ...
        obj.warnings = String[]  ...
 
        obj.header// user-specified header = String  ...
        obj.dir// array of package base directories = String[]  ...
        obj.checkResults = Main.CheckResults[]  ...
 
        obj.header// user-specified header = String  ...
        obj.path// package path = String  ...
        obj.name// array of names = String[]  ...
        obj.checkResults = Main.CheckResults[]  ...
 
        obj.header// user-specified header = String  ...
        obj.path// package path = String  ...
        obj.checkResults = Main.CheckResults[]  ...
 
        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  ...
 
        obj.header// user-specified header = String  ...
        obj.path// package path = String  ...
        obj.pkg// array of packages = Main.Pkg[]  ...
        obj.checkResults = Main.CheckResults[]  ...
module-wide config parameters
        '[-n] [-x] [-v] [-H header] [-p] [-c] [-P package_base_dir ...|-Pr repository ...|-PR directory ...]'
    ];
module-wide functions
    Main.exec// xs script entry point(Any args) returns Any
    Main.main// xs shell entry point(Any args) returns Any
per-instance config parameters
    var params = new Main.Params// Instance config-params object;
        params.arrFlag// Return an array of strings = Bool false;
        params.checkFlag// Check repositories for possible errors = Bool false;
        params.header// Header label = String null;
        params.pathFlag// Echo path = Bool false;
        params.recurseFlag// Recursively find all packages = Bool false;
        params.shortFlag// Display package names only = Bool false;
        params.verboseFlag// Print informative messages during execution = Bool false;
        params.xmlFlag// Return a Results struct as XML = Bool false;
per-instance functions
    inst.run// Underlying implementation of the command(Cmdr.Instance cmdr, String[] args) returns Any
 
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):
    xs xdc.tools.path
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):
    xs xdc.tools.path -n
Output:
    gnu.gdb.jserver
    gnu.targets
    gnu.targets.rts470MV
    gnu.targets.rts470uC
    gnu.targets.rts5
     
3. To simply, echo the current package path:
    xs xdc.tools.path -p
Output:
    C:/xdc-o00/packages
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
Configuration settings
var obj = new Main.CheckResults;
 
    obj.repository = String  ...
    obj.warnings = String[]  ...
 
 
struct Main.DirResults

return value for xml directory echo

Configuration settings
var obj = new Main.DirResults;
 
    obj.header = String  ...
    // user-specified header
    obj.dir = String[]  ...
    // array of package base directories
    obj.checkResults = Main.CheckResults[]  ...
 
 
struct Main.NameResults

return value for xml package names

Configuration settings
var obj = new Main.NameResults;
 
    obj.header = String  ...
    // user-specified header
    obj.path = String  ...
    // package path
    obj.name = String[]  ...
    // array of names
    obj.checkResults = Main.CheckResults[]  ...
 
 
struct Main.PathResults

return value for xml package path

Configuration settings
var obj = new Main.PathResults;
 
    obj.header = String  ...
    // user-specified header
    obj.path = String  ...
    // package path
    obj.checkResults = Main.CheckResults[]  ...
 
 
struct Main.Pkg

struct used for xml package info

Configuration settings
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

Configuration settings
var obj = new Main.Results;
 
    obj.header = String  ...
    // user-specified header
    obj.path = String  ...
    // package path
    obj.pkg = Main.Pkg[]  ...
    // array of packages
    obj.checkResults = Main.CheckResults[]  ...
 
 
config Main.usage  // module-wide

Usage for this command

Configuration settings
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

Configuration settings
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

Configuration settings
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

Configuration settings
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

Configuration settings
var params = new Main.Params;
  ...
params.arrFlag = Bool false;
 
 
config Main.Params.checkFlag  // instance

Check repositories for possible errors

Configuration settings
var params = new Main.Params;
  ...
params.checkFlag = Bool false;
 
 
config Main.Params.directoriesFlag  // instance

Only display information for the package directories

Configuration settings
var params = new Main.Params;
  ...
params.directoriesFlag = Bool false;
 
 
config Main.Params.header  // instance

Header label

Configuration settings
var params = new Main.Params;
  ...
params.header = String null;
 
 
config Main.Params.pathFlag  // instance

Echo path

Configuration settings
var params = new Main.Params;
  ...
params.pathFlag = Bool false;
 
 
config Main.Params.recurseFlag  // instance

Recursively find all packages

Configuration settings
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

Configuration settings
var params = new Main.Params;
  ...
params.repositoriesFlag = Bool false;
 
 
config Main.Params.shortFlag  // instance

Display package names only

Configuration settings
var params = new Main.Params;
  ...
params.shortFlag = Bool false;
 
 
config Main.Params.verboseFlag  // instance

Print informative messages during execution

Configuration settings
var params = new Main.Params;
  ...
params.verboseFlag = Bool false;
 
 
config Main.Params.xmlFlag  // instance

Return a Results struct as XML

Configuration settings
var params = new Main.Params;
  ...
params.xmlFlag = Bool false;
 
 
Main.run()  // instance

Underlying implementation of the command

Configuration settings
inst.run(Cmdr.Instance cmdr, String[] args) returns Any
 
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 Fri, 22 Feb 2019 01:33:17 GMT