Beispiel #1
0
 def run_output(self, cmd, cwd=None, **kwargs):
     if not cwd:
         cwd = self.builddir
     os.makedirs(cwd, exist_ok=True)
     try:
         return common.run_output(cmd, cwd=cwd, **kwargs)
     except CalledProcessError as process_error:
         raise errors.SnapcraftPluginCommandError(
             command=cmd, part_name=self.name, exit_code=process_error.returncode
         ) from process_error
Beispiel #2
0
 def run(self, cmd, cwd=None, **kwargs):
     if not cwd:
         cwd = self.builddir
     cmd_string = " ".join([shlex.quote(c) for c in cmd])
     print(cmd_string)
     os.makedirs(cwd, exist_ok=True)
     try:
         return common.run(cmd, cwd=cwd, **kwargs)
     except CalledProcessError as process_error:
         raise errors.SnapcraftPluginCommandError(
             command=cmd, part_name=self.name, exit_code=process_error.returncode
         ) from process_error
Beispiel #3
0
    def pull(self):
        super().pull()

        if self.options.meson_version:
            meson_package = "meson=={}".format(self.options.meson_version)
        else:
            meson_package = "meson"

        try:
            subprocess.check_call(
                ["python3", "-m", "pip", "install", "-U", meson_package])
        except subprocess.CalledProcessError as call_error:
            raise errors.SnapcraftPluginCommandError(
                command=call_error.cmd,
                part_name=self.name,
                exit_code=call_error.returncode,
            ) from call_error