|
99 | 99 | """
|
100 | 100 |
|
101 | 101 |
|
| 102 | +epilog_dependencies = \ |
| 103 | +""" |
| 104 | +Print the list of packages that are dependencies of given package. |
| 105 | +By default, list the build, order-only, and runtime dependencies. |
| 106 | +
|
| 107 | +EXAMPLE: |
| 108 | +
|
| 109 | + $ sage --package dependencies maxima --runtime |
| 110 | + ecl |
| 111 | + $ sage --package dependencies maxima --order-only |
| 112 | + info |
| 113 | +""" |
| 114 | + |
| 115 | + |
102 | 116 | epilog_name = \
|
103 | 117 | """
|
104 | 118 | Find the package name given a tarball filename
|
@@ -286,6 +300,31 @@ def make_parser():
|
286 | 300 | '--format', type=str, default='plain',
|
287 | 301 | help='output format (one of plain and shell; default: plain)')
|
288 | 302 |
|
| 303 | + parser_dependencies = subparsers.add_parser( |
| 304 | + 'dependencies', epilog=epilog_dependencies, |
| 305 | + formatter_class=argparse.RawDescriptionHelpFormatter, |
| 306 | + help='Print the list of packages that are dependencies of given packages') |
| 307 | + parser_dependencies.add_argument( |
| 308 | + 'package_class', metavar='[package_name|:package_type:]', |
| 309 | + type=str, nargs='+', |
| 310 | + help=('package name or designator for all packages of a given type ' |
| 311 | + '(one of :all:, :standard:, :optional:, and :experimental:)')) |
| 312 | + parser_dependencies.add_argument( |
| 313 | + '--order-only', action='store_true', |
| 314 | + help='list the order-only build dependencies') |
| 315 | + parser_dependencies.add_argument( |
| 316 | + '--optional', action='store_true', |
| 317 | + help='list the optional build dependencies') |
| 318 | + parser_dependencies.add_argument( |
| 319 | + '--runtime', action='store_true', |
| 320 | + help='list the runtime dependencies') |
| 321 | + parser_dependencies.add_argument( |
| 322 | + '--check', action='store_true', |
| 323 | + help='list the check dependencies') |
| 324 | + parser_dependencies.add_argument( |
| 325 | + '--format', type=str, default='plain', |
| 326 | + help='output format (one of plain and shell; default: plain)') |
| 327 | + |
289 | 328 | parser_name = subparsers.add_parser(
|
290 | 329 | 'name', epilog=epilog_name,
|
291 | 330 | formatter_class=argparse.RawDescriptionHelpFormatter,
|
@@ -435,6 +474,19 @@ def run():
|
435 | 474 | exclude_dependencies=args.exclude_dependencies)
|
436 | 475 | elif args.subcommand == 'properties':
|
437 | 476 | app.properties(*args.package_class, format=args.format)
|
| 477 | + elif args.subcommand == 'dependencies': |
| 478 | + types = [] |
| 479 | + if args.order_only: |
| 480 | + types.append('order_only') |
| 481 | + if args.optional: |
| 482 | + types.append('optional') |
| 483 | + if args.runtime: |
| 484 | + types.append('runtime') |
| 485 | + if args.check: |
| 486 | + types.append('check') |
| 487 | + if not types: |
| 488 | + types = None |
| 489 | + app.dependencies(*args.package_class, types=types, format=args.format) |
438 | 490 | elif args.subcommand == 'name':
|
439 | 491 | app.name(args.tarball_filename)
|
440 | 492 | elif args.subcommand == 'tarball':
|
|
0 commit comments