示例#1
0
    def execute(self, cmd, cwd):
        """Execute given command inside environment."""

        bind_opts = " ".join(["-b %s" % bind for bind in self.binds])
        fullcmd = "proot -Q %(qemu)s %(binds)s -w %(cwd)s %(rootdir)s " \
                  "%(cmd)s" % \
                {
                    "qemu": ARCH_QEMU_MAP[self.arch],
                    "rootdir": self.rootdir,
                    "cwd": cwd,
                    "cmd": cmd,
                    "binds": bind_opts
                }
        LOG.debug("Executing `%s` inside env" % fullcmd)
        env = os.environ
        env.update(self.envvars)
        call(fullcmd, env=env, shell=True)
示例#2
0
    def unpack(self):
        """Create build tree in working directory."""

        LOG.debug("unpack")
        call(["dpkg-source", "-x", self.dsc_path], cwd=self.workdir)