Пример #1
0
    def run(self):

        build = self.get_finalized_command("build")
        build.run()

        dist = build.distribution
        n = dist.build_node.make_node(IPKG_PATH)
        ipkg = InstalledPkgDescription.from_file(n.abspath())

        build_node = self.distribution.build_node
        # FIXME: fix build_egg signature - we use a dummy context here to avoid
        # creating the whole command context stuff
        context = _FakeContext(build_node)
        build_egg(ipkg, context, build_node.abspath())
Пример #2
0
                sdata.truncate(nbytes - (n - null_ind))
            finally:
                sdata.seek(cur, 0)

        truncate_null(sdata)
        parser.readfp(sdata)
        raise ValueError("YO - fix wininst METADATA")
        ipkg_str = base64.b64decode(parser.get("IPKG_INFO", "value"))

        ipkg = InstalledPkgDescription.from_string(ipkg_str)
        return ipkg


if __name__ == "__main__":
    from bento.commands.wininst_utils import get_exe_bytes
    if len(sys.argv) < 2:
        WININST = "bento-0.0.3dev-py2.6.win32.exe"
    else:
        WININST = sys.argv[1]

    ipkg = read_ipkg(WININST)
    tmpdir = tempfile.mkdtemp()

    z = zipfile.ZipFile(WININST)
    try:
        z.extractall(path=tmpdir)
        build_egg(ipkg, source_root=os.path.join(tmpdir, "PURELIB"), path=".")
    finally:
        z.close()
        shutil.rmtree(tmpdir)
Пример #3
0
                sdata.seek(-n, 2)
                null_ind = sdata.read().find("\0")
                sdata.truncate(nbytes - (n-null_ind))
            finally:
                sdata.seek(cur, 0)
        truncate_null(sdata)
        parser.readfp(sdata)
        raise ValueError("YO - fix wininst METADATA")
        ipkg_str = base64.b64decode(parser.get("IPKG_INFO", "value"))

        ipkg = InstalledPkgDescription.from_string(ipkg_str)
        return ipkg

if __name__ == "__main__":
    from bento.commands.wininst_utils import get_exe_bytes
    if len(sys.argv) < 2:
        WININST = "bento-0.0.3dev-py2.6.win32.exe"
    else:
        WININST = sys.argv[1]

    ipkg = read_ipkg(WININST)
    tmpdir = tempfile.mkdtemp()

    z = zipfile.ZipFile(WININST)
    try:
        z.extractall(path=tmpdir)
        build_egg(ipkg, source_root=os.path.join(tmpdir, "PURELIB"), path=".")
    finally:
        z.close()
        shutil.rmtree(tmpdir)