Exemplo n.º 1
0
def execute(args, parser):
    import sys

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


    prefix = common.get_prefix(args)

    if args.which:
        from conda.misc import which_package

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

    if args.ls_files:
        if list_package_files(args.ls_files) == 1:
            sys.exit(1)
        else:
            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

    make_tarbz2(prefix,
                name = args.pkg_name.lower(),
                version = args.pkg_version,
                build_number = int(args.pkg_build))
Exemplo n.º 2
0
def execute(args, parser):
    import sys

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

    prefix = common.get_prefix(args)

    if args.which:
        from conda.misc import which_package

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

    if args.ls_files:
        if list_package_files(args.ls_files) == 1:
            sys.exit(1)
        else:
            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

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