def check_binaries(args): """Check specs (either a single spec from --spec, or else the full set of release specs) against remote binary mirror(s) to see if any need to be rebuilt. This command uses the process exit code to indicate its result, specifically, if the exit code is non-zero, then at least one of the indicated specs needs to be rebuilt. """ if args.spec or args.spec_yaml: specs = [get_concrete_spec(args)] else: env = spack.cmd.require_active_env(cmd_name='buildcache') env.concretize() specs = env.all_specs() if not specs: tty.msg('No specs provided, exiting.') sys.exit(0) for spec in specs: spec.concretize() # Next see if there are any configured binary mirrors configured_mirrors = spack.config.get('mirrors', scope=args.scope) if args.mirror_url: configured_mirrors = {'additionalMirrorUrl': args.mirror_url} if not configured_mirrors: tty.msg('No mirrors provided, exiting.') sys.exit(0) sys.exit( bindist.check_specs_against_mirrors(configured_mirrors, specs, args.output_file, args.rebuild_on_error))
def check_binaries(args): """Check specs (either a single spec from --spec, or else the full set of release specs) against remote binary mirror(s) to see if any need to be rebuilt. This command uses the process exit code to indicate its result, specifically, if the exit code is non-zero, then at least one of the indicated specs needs to be rebuilt. """ if args.spec or args.spec_yaml: specs = [get_concrete_spec(args)] else: release_specs_path = os.path.join(etc_path, 'spack', 'defaults', 'release.yaml') spec_set = CombinatorialSpecSet.from_file(release_specs_path) specs = [spec for spec in spec_set] if not specs: tty.msg('No specs provided, exiting.') sys.exit(0) for spec in specs: spec.concretize() # Next see if there are any configured binary mirrors configured_mirrors = spack.config.get('mirrors', scope=args.scope) if args.mirror_url: configured_mirrors = {'additionalMirrorUrl': args.mirror_url} if not configured_mirrors: tty.msg('No mirrors provided, exiting.') sys.exit(0) sys.exit( bindist.check_specs_against_mirrors(configured_mirrors, specs, args.output_file, args.rebuild_on_error))