Exemple #1
0
    def run(self, ctx):
        argv = ctx.command_argv
        p = ctx.options_context.parser
        o, a = p.parse_args(argv)
        if o.help:
            p.print_help()
            return

        n = ctx.build_node.make_node(BUILD_MANIFEST_PATH)
        build_manifest = BuildManifest.from_file(n.abspath())
        scheme = ctx.retrieve_configured_scheme()
        build_manifest.update_paths(scheme)
        node_sections = build_manifest.resolve_paths_with_destdir(ctx.build_node)

        if o.list_files:
            # XXX: this won't take into account action in post install scripts.
            # A better way would be to log install steps and display those, but
            # this will do for now.
            for kind, source, target in iter_files(node_sections):
                print(target.abspath())
            return

        if o.transaction:
            trans = TransactionLog("transaction.log")
            try:
                for kind, source, target in iter_files(node_sections):
                    trans.copy(source.abspath(), target.abspath(), kind)
            finally:
                trans.close()
        else:
            for kind, source, target in iter_files(node_sections):
                copy_installer(source.abspath(), target.abspath(), kind)
Exemple #2
0
    def run(self, ctx):
        argv = ctx.command_argv
        p = ctx.options_context.parser
        o, a = p.parse_args(argv)
        if o.help:
            p.print_help()
            return

        n = ctx.build_node.make_node(BUILD_MANIFEST_PATH)
        build_manifest = BuildManifest.from_file(n.abspath())
        scheme = ctx.retrieve_configured_scheme()
        build_manifest.update_paths(scheme)
        node_sections = build_manifest.resolve_paths_with_destdir(
            ctx.build_node)

        if o.list_files:
            # XXX: this won't take into account action in post install scripts.
            # A better way would be to log install steps and display those, but
            # this will do for now.
            for kind, source, target in iter_files(node_sections):
                print(target.abspath())
            return

        if o.transaction:
            trans = TransactionLog("transaction.log")
            try:
                for kind, source, target in iter_files(node_sections):
                    trans.copy(source.abspath(), target.abspath(), kind)
            finally:
                trans.close()
        else:
            for kind, source, target in iter_files(node_sections):
                copy_installer(source.abspath(), target.abspath(), kind)
Exemple #3
0
    def write_record(self):
        dist = self.distribution

        options_context = dist.global_context.retrieve_options_context(self.cmd_name)
        cmd_context_klass = dist.global_context.retrieve_command_context(self.cmd_name)
        context = cmd_context_klass(dist.global_context, [], options_context, dist.pkg, dist.run_node)

        n = context.build_node.make_node(BUILD_MANIFEST_PATH)
        build_manifest = BuildManifest.from_file(n.abspath())
        scheme = context.retrieve_configured_scheme()
        build_manifest.update_paths(scheme)
        file_sections = build_manifest.resolve_paths_with_destdir(src_root_node=context.build_node)

        # copy egg info to install directory
        meta = build_manifest.meta
        src = op.join('pip-egg-info', meta['name'] + '.egg-info')
        dest = op.abspath(build_manifest.resolve_path(op.join('$sitedir',
                meta['name'] + '-' + meta['version'] +
                '-py$py_version_short.egg-info')))
        shutil.copytree(src, dest)

        def writer(fid):
            for kind, source, target in iter_files(file_sections):
                fid.write("%s\n" % target.abspath())
            fid.write("%s\n" % dest)
        bento.utils.io2.safe_write(self.record, writer, "w")
Exemple #4
0
    def run(self, ctx):
        argv = ctx.command_argv
        p = ctx.options_context.parser
        o, a = p.parse_args(argv)
        if o.help:
            p.print_help()
            return

        n = ctx.build_node.make_node(IPKG_PATH)
        ipkg = BuildManifest.from_file(n.abspath())
        create_wininst(ipkg, src_root_node=ctx.build_node, build_node=ctx.build_node,
                       wininst=o.output_file,
                       output_dir=o.output_dir)
Exemple #5
0
    def run(self, ctx):
        argv = ctx.command_argv
        p = ctx.options_context.parser
        o, a = p.parse_args(argv)
        if o.help:
            p.print_help()
            return
        output_dir = o.output_dir
        output_file = o.output_file

        n = ctx.build_node.make_node(IPKG_PATH)
        build_manifest = BuildManifest.from_file(n.abspath())
        build_egg(build_manifest, ctx.build_node, ctx.build_node, output_dir, output_file)
Exemple #6
0
    def run(self, ctx):
        argv = ctx.command_argv
        p = ctx.options_context.parser
        o, a = p.parse_args(argv)
        if o.help:
            p.print_help()
            return

        n = ctx.build_node.make_node(IPKG_PATH)
        ipkg = BuildManifest.from_file(n.abspath())
        create_wininst(ipkg,
                       src_root_node=ctx.build_node,
                       build_node=ctx.build_node,
                       wininst=o.output_file,
                       output_dir=o.output_dir)
Exemple #7
0
    def run(self, context):
        o, a = context.get_parsed_arguments()
        if o.help:
            p.print_help()
            return
        output_dir = o.output_dir
        output_file = o.output_file

        n = context.build_node.find_node(IPKG_PATH)
        manifest = BuildManifest.from_file(n.abspath())
        msi_root = context.build_node.make_node("msi")

        build_msi_tree(manifest, context.build_node, msi_root)

        create_msi_installer(context.pkg, context.run_node, msi_root, o.output_file, o.output_dir)
Exemple #8
0
    def run(self):
        self.run_command("build")
        dist = self.distribution

        n = dist.build_node.make_node(IPKG_PATH)
        ipkg = BuildManifest.from_file(n.abspath())

        egg_info = EggInfo.from_ipkg(ipkg, dist.build_node)

        egg_info_dir = op.join(self.egg_base, "%s.egg-info" % dist.pkg.name)
        try:
            os.makedirs(egg_info_dir)
        except OSError, e:
            if e.errno != 17:
                raise
Exemple #9
0
    def run(self):
        self.run_command("build")
        dist = self.distribution

        n = dist.build_node.make_node(IPKG_PATH)
        ipkg = BuildManifest.from_file(n.abspath())

        egg_info = EggInfo.from_ipkg(ipkg, dist.build_node)

        egg_info_dir = op.join(self.egg_base, "%s.egg-info" % dist.pkg.name)
        try:
            os.makedirs(egg_info_dir)
        except OSError, e:
            if e.errno != 17:
                raise
Exemple #10
0
    def run(self, context):
        o, a = context.get_parsed_arguments()
        if o.help:
            p.print_help()
            return
        output_dir = o.output_dir
        output_file = o.output_file

        n = context.build_node.find_node(IPKG_PATH)
        manifest = BuildManifest.from_file(n.abspath())
        msi_root = context.build_node.make_node("msi")

        build_msi_tree(manifest, context.build_node, msi_root)

        create_msi_installer(context.pkg, context.run_node, msi_root,
                             o.output_file, o.output_dir)
Exemple #11
0
    def write_record(self):
        dist = self.distribution

        options_context = dist.global_context.retrieve_options_context(self.cmd_name)
        cmd_context_klass = dist.global_context.retrieve_command_context(self.cmd_name)
        context = cmd_context_klass(dist.global_context, [], options_context, dist.pkg, dist.run_node)

        n = context.build_node.make_node(IPKG_PATH)
        ipkg = BuildManifest.from_file(n.abspath())
        scheme = context.retrieve_configured_scheme()
        ipkg.update_paths(scheme)
        file_sections = ipkg.resolve_paths_with_destdir(src_root_node=context.build_node)

        def writer(fid):
            for kind, source, target in iter_files(file_sections):
                fid.write("%s\n" % target.abspath())
        bento.utils.io2.safe_write(self.record, writer, "w")
    def write_record(self):
        dist = self.distribution

        options_context = dist.global_context.retrieve_options_context(self.cmd_name)
        cmd_context_klass = dist.global_context.retrieve_command_context(self.cmd_name)
        context = cmd_context_klass(dist.global_context, [], options_context, dist.pkg, dist.run_node)

        n = context.build_node.make_node(BUILD_MANIFEST_PATH)
        build_manifest = BuildManifest.from_file(n.abspath())
        scheme = context.retrieve_configured_scheme()
        build_manifest.update_paths(scheme)
        file_sections = build_manifest.resolve_paths_with_destdir(src_root_node=context.build_node)

        def writer(fid):
            for kind, source, target in iter_files(file_sections):
                fid.write("%s\n" % target.abspath())
        bento.utils.io2.safe_write(self.record, writer, "w")
Exemple #13
0
    def run(self):
        self.run_command("build")
        dist = self.distribution

        n = dist.build_node.make_node(IPKG_PATH)
        ipkg = BuildManifest.from_file(n.abspath())

        egg_info = EggInfo.from_ipkg(ipkg, dist.build_node)

        egg_info_dir = op.join(self.egg_base, "%s.egg-info" % dist.pkg.name)
        try:
            os.makedirs(egg_info_dir)
        except OSError:
            e = extract_exception()
            if e.errno != 17:
                raise
        for filename, cnt in egg_info.iter_meta(dist.build_node):
            filename = op.join(egg_info_dir, filename)
            fid = open(filename, "w")
            try:
                fid.write(cnt)
            finally:
                fid.close()
    def run(self):
        self.run_command("build")
        dist = self.distribution

        n = dist.build_node.make_node(BUILD_MANIFEST_PATH)
        build_manifest = BuildManifest.from_file(n.abspath())

        egg_info = EggInfo.from_build_manifest(build_manifest, dist.build_node)

        egg_info_dir = op.join(self.egg_base, "%s.egg-info" % dist.pkg.name)
        try:
            os.makedirs(egg_info_dir)
        except OSError:
            e = extract_exception()
            if e.errno != 17:
                raise
        for filename, cnt in egg_info.iter_meta(dist.build_node):
            filename = op.join(egg_info_dir, filename)
            fid = open(filename, "w")
            try:
                fid.write(cnt)
            finally:
                fid.close()
Exemple #15
0
    def run(self, ctx):
        argv = ctx.command_argv
        p = ctx.options_context.parser
        o, a = p.parse_args(argv)
        if o.help:
            p.print_help()
            return

        root = ctx.top_node
        while root.height() > 0:
            root = root.parent

        default_scheme = get_default_scheme(ctx.pkg.name)
        default_prefix = default_scheme["prefix"]
        default_sitedir = default_scheme["sitedir"]

        n = ctx.build_node.make_node(BUILD_MANIFEST_PATH)
        build_manifest = BuildManifest.from_file(n.abspath())
        name = build_manifest.meta["name"]
        version = build_manifest.meta["version"]
        py_short = ".".join([str(i) for i in sys.version_info[:2]])
        if o.output_file is None:
            mpkg_name = "%s-%s-py%s.mpkg" % (name, version, py_short)
        else:
            mpkg_name = o.output_file

        categories = set()
        file_sections = build_manifest.resolve_paths(ctx.build_node)
        for kind, source, target in iter_files(file_sections):
            categories.add(kind)

        # Mpkg metadata
        mpkg_root = os.path.join(os.getcwd(), o.output_dir, mpkg_name)
        mpkg_cdir = os.path.join(mpkg_root, "Contents")
        if os.path.exists(mpkg_root):
            shutil.rmtree(mpkg_root)
        os.makedirs(mpkg_cdir)
        f = open(os.path.join(mpkg_cdir, "PkgInfo"), "w")
        try:
            f.write("pmkrpkg1")
        finally:
            f.close()
        mpkg_info = MetaPackageInfo.from_build_manifest(build_manifest)

        purelib_pkg = "%s-purelib-%s-py%s.pkg" % (name, version, py_short)
        scripts_pkg = "%s-scripts-%s-py%s.pkg" % (name, version, py_short)
        datafiles_pkg = "%s-datafiles-%s-py%s.pkg" % (name, version, py_short)
        mpkg_info.packages = [purelib_pkg, scripts_pkg, datafiles_pkg]
        make_mpkg_plist(mpkg_info, os.path.join(mpkg_cdir, "Info.plist"))

        mpkg_rdir = os.path.join(mpkg_root, "Contents", "Resources")
        os.makedirs(mpkg_rdir)
        make_mpkg_description(mpkg_info,
                              os.path.join(mpkg_rdir, "Description.plist"))

        # Package the stuff which ends up into site-packages
        pkg_root = os.path.join(mpkg_root, "Contents", "Packages", purelib_pkg)
        build_pkg_from_temp(ctx, build_manifest, pkg_root, root, "/",
                            ["pythonfiles"],
                            "Pure Python modules and packages")

        pkg_root = os.path.join(mpkg_root, "Contents", "Packages", scripts_pkg)
        build_pkg_from_temp(ctx, build_manifest, pkg_root, root, "/",
                            ["executables"], "Scripts and binaries")

        pkg_root = os.path.join(mpkg_root, "Contents", "Packages",
                                datafiles_pkg)
        build_pkg_from_temp(ctx, build_manifest, pkg_root, root, "/",
                            ["bentofiles", "datafiles"], "Data files")
Exemple #16
0
    def run(self, ctx):
        argv = ctx.command_argv
        p = ctx.options_context.parser
        o, a = p.parse_args(argv)
        if o.help:
            p.print_help()
            return

        root = ctx.top_node
        while root.height() > 0:
            root = root.parent

        default_scheme = get_default_scheme(ctx.pkg.name)
        default_prefix = default_scheme["prefix"]
        default_sitedir = default_scheme["sitedir"]

        n = ctx.build_node.make_node(BUILD_MANIFEST_PATH)
        build_manifest = BuildManifest.from_file(n.abspath())
        name = build_manifest.meta["name"]
        version = build_manifest.meta["version"]
        py_short = ".".join([str(i) for i in sys.version_info[:2]])
        if o.output_file is None:
            mpkg_name = "%s-%s-py%s.mpkg" % (name, version, py_short)
        else:
            mpkg_name = o.output_file

        categories = set()
        file_sections = build_manifest.resolve_paths(ctx.build_node)
        for kind, source, target in iter_files(file_sections):
            categories.add(kind)

        # Mpkg metadata
        mpkg_root = os.path.join(os.getcwd(), o.output_dir, mpkg_name)
        mpkg_cdir = os.path.join(mpkg_root, "Contents")
        if os.path.exists(mpkg_root):
            shutil.rmtree(mpkg_root)
        os.makedirs(mpkg_cdir)
        f = open(os.path.join(mpkg_cdir, "PkgInfo"), "w")
        try:
            f.write("pmkrpkg1")
        finally:
            f.close()
        mpkg_info = MetaPackageInfo.from_build_manifest(build_manifest)

        purelib_pkg = "%s-purelib-%s-py%s.pkg" % (name, version, py_short)
        scripts_pkg = "%s-scripts-%s-py%s.pkg" % (name, version, py_short)
        datafiles_pkg = "%s-datafiles-%s-py%s.pkg" % (name, version, py_short)
        mpkg_info.packages = [purelib_pkg, scripts_pkg, datafiles_pkg]
        make_mpkg_plist(mpkg_info, os.path.join(mpkg_cdir, "Info.plist"))

        mpkg_rdir = os.path.join(mpkg_root, "Contents", "Resources")
        os.makedirs(mpkg_rdir)
        make_mpkg_description(mpkg_info, os.path.join(mpkg_rdir, "Description.plist"))

        # Package the stuff which ends up into site-packages
        pkg_root = os.path.join(mpkg_root, "Contents", "Packages", purelib_pkg)
        build_pkg_from_temp(ctx, build_manifest, pkg_root, root, "/", ["pythonfiles"], "Pure Python modules and packages")

        pkg_root = os.path.join(mpkg_root, "Contents", "Packages", scripts_pkg)
        build_pkg_from_temp(ctx, build_manifest, pkg_root, root, "/", ["executables"], "Scripts and binaries")

        pkg_root = os.path.join(mpkg_root, "Contents", "Packages", datafiles_pkg)
        build_pkg_from_temp(ctx, build_manifest, pkg_root, root, "/", ["bentofiles", "datafiles"], "Data files")