Beispiel #1
0
def execute(args, parser):
    import sys
    from os.path import basename

    from conda.misc import untracked
    from conda.builder.packup import make_tarbz2, remove


    prefix = common.get_prefix(args)

    if args.check:
        from conda.builder.tarcheck import check_all

        for path in args.path:
            try:
                check_all(path)
                print('%s OK' % basename(path))
            except Exception as e:
                print(e)
                print('%s FAILED' % basename(path))
        return

    if args.which:
        from conda.builder.packup import which_package

        for path in args.path:
            for dist in  which_package(path):
                print('%-50s  %s' % (path, dist))
        return

    if args.path:
        sys.exit("Error: no positional arguments expected.")

    print('# prefix:', prefix)

    if args.reset:
        remove(prefix, untracked(prefix))
        return

    if args.untracked:
        files = sorted(untracked(prefix))
        print('# untracked files: %d' % len(files))
        for fn in files:
            print(fn)
        return

    if args.share:
        from conda.builder.share import create_bundle

        path, warnings = create_bundle(prefix)
        for w in warnings:
            print("Warning:", w)
        print(path)
        return

    make_tarbz2(prefix,
                name = args.pkg_name,
                version = args.pkg_version,
                build_number = int(args.pkg_build))
Beispiel #2
0
def execute(args, parser):
    from os.path import basename

    from conda.builder.packup import make_tarbz2, untracked, remove


    prefix = common.get_prefix(args)

    if args.check:
        from conda.builder.tarcheck import check_all

        try:
            check_all(args.check)
            print '%s OK' % basename(args.check)
        except Exception as e:
            print e
            print '%s FAILED' % basename(args.check)
        return

    print '# prefix:', prefix

    if args.reset:
        remove(prefix, untracked(prefix))
        return

    if args.untracked:
        files = sorted(untracked(prefix))
        print '# untracked files: %d' % len(files)
        for fn in files:
            print fn
        return

    make_tarbz2(prefix,
                name = args.pkg_name,
                version = args.pkg_version,
                build_number = int(args.pkg_build))