Esempio n. 1
0
 def _extract_deb(cls, deb_path: pathlib.Path, extract_dir: str) -> None:
     """Extract deb and return `<package-name>=<version>`."""
     try:
         subprocess.check_call(
             ["dpkg-deb", "--extract", deb_path, extract_dir])
     except subprocess.CalledProcessError:
         raise errors.UnpackError(deb_path)
Esempio n. 2
0
    def _extract_deb_name_version(cls, deb_path: pathlib.Path) -> str:
        try:
            output = subprocess.check_output(
                ["dpkg-deb", "--show", "--showformat=${Package}=${Version}", deb_path]
            )
        except subprocess.CalledProcessError:
            raise errors.UnpackError(deb_path)

        return output.decode().strip()