예제 #1
0
 def fallback_to_all(url_or_name: str):
     """Until July 2022 we had clickhouse-server and clickhouse-client with
     arch 'all'"""
     # deb
     if url_or_name.endswith("amd64.deb") or url_or_name.endswith(
             "arm64.deb"):
         return f"{url_or_name[:-9]}all.deb"
     # rpm
     if url_or_name.endswith("x86_64.rpm") or url_or_name.endswith(
             "aarch64.rpm"):
         new = removesuffix(removesuffix(url_or_name, "x86_64.rpm"),
                            "aarch64.rpm")
         return f"{new}noarch.rpm"
     # tgz
     if url_or_name.endswith("-amd64.tgz") or url_or_name.endswith(
             "-arm64.tgz"):
         return f"{url_or_name[:-10]}.tgz"
     return url_or_name
예제 #2
0
 def arch(self, deb_pkg: str) -> str:
     if deb_pkg not in self.deb:
         raise ValueError(f"{deb_pkg} not in {self.deb}")
     return removesuffix(deb_pkg, ".deb").split("_")[-1]
예제 #3
0
 def arch(self, deb_pkg: str) -> str:
     if deb_pkg not in self.deb:
         raise ValueError("{} not in {}".format(deb_pkg, self.deb))
     return removesuffix(deb_pkg, ".deb").split("_")[-1]