diff --git a/docker/package/Dockerfile-fedora b/docker/package/Dockerfile-fedora index 6eacc33c4..cd5ebc5a1 100644 --- a/docker/package/Dockerfile-fedora +++ b/docker/package/Dockerfile-fedora @@ -25,6 +25,7 @@ RUN python3 fetch_tezos_sources.py WORKDIR /tezos-packaging/docker COPY meta.json /tezos-packaging/meta.json COPY protocols.json /tezos-packaging/protocols.json +COPY docker/supported_versions.json /tezos-packaging/docker/supported_versions.json COPY docker/package/*.py /tezos-packaging/docker/package/ COPY docker/package/defaults /tezos-packaging/docker/package/defaults COPY docker/package/scripts /tezos-packaging/docker/package/scripts diff --git a/docker/package/Dockerfile-ubuntu b/docker/package/Dockerfile-ubuntu index de12b25cb..77ce4f488 100644 --- a/docker/package/Dockerfile-ubuntu +++ b/docker/package/Dockerfile-ubuntu @@ -34,6 +34,7 @@ RUN python3 fetch_tezos_sources.py WORKDIR /tezos-packaging/docker COPY meta.json /tezos-packaging/meta.json COPY protocols.json /tezos-packaging/protocols.json +COPY docker/supported_versions.json /tezos-packaging/docker/supported_versions.json COPY docker/package/*.py /tezos-packaging/docker/package/ COPY docker/package/defaults /tezos-packaging/docker/package/defaults COPY docker/package/scripts /tezos-packaging/docker/package/scripts diff --git a/docker/package/package_generator.py b/docker/package/package_generator.py index c63412e4c..5b658d213 100755 --- a/docker/package/package_generator.py +++ b/docker/package/package_generator.py @@ -3,6 +3,7 @@ import os import sys +import json import shutil import argparse import urllib.request @@ -218,25 +219,34 @@ def build_ubuntu(args): "tezos-rc" if "rc" in version or "beta" in version else "tezos" ) name = package.name.lower() - # distributions list is always unempty at this point - # and sources archive is the same for all distributions - dist = distributions[0] - url = f"https://launchpad.net/~serokell/+archive/ubuntu/{repo}/+sourcefiles/{name}/2:{version}-0ubuntu1~{dist}/{name}_{version}.orig.tar.gz" - source_archive = f"{name}_{package.meta.version}.orig.tar.gz" - try: - urllib.request.urlretrieve( - url, - source_archive, - lambda count, block_size, total_size: print( - f"{package.name} source is downloading: " - + str(round(count * block_size / total_size * 100, 2)) - + "%", - end="\r", - ), - ) - print(f"{package.name} source was downloaded successfully") - package.source_archive = os.path.realpath(source_archive) - except (urllib.error.URLError, ValueError): + + with open("supported_versions.json", "r") as f: + distributions = json.loads(f.read())["ubuntu"] + + success = False + for dist in distributions: + source_archive = f"{name}_{package.meta.version}.orig.tar.gz" + url = f"https://launchpad.net/~serokell/+archive/ubuntu/{repo}/+sourcefiles/{name}/2:{version}-0ubuntu1~{dist}/{name}_{version}.orig.tar.gz" + try: + urllib.request.urlretrieve( + url, + source_archive, + lambda count, block_size, total_size: print( + f"{package.name} source is downloading: " + + str( + round(count * block_size / total_size * 100, 2) + ) + + "%", + end="\r", + ), + ) + print(f"{package.name} source was downloaded successfully") + package.source_archive = os.path.realpath(source_archive) + success = True + break + except (urllib.error.URLError, ValueError): + continue + if not success: errors.append( f"ERROR: source archive for {package.name} is not available" ) diff --git a/docker/package/scripts/build-binary.sh b/docker/package/scripts/build-binary.sh index bb66264d7..2c5963b28 100755 --- a/docker/package/scripts/build-binary.sh +++ b/docker/package/scripts/build-binary.sh @@ -19,7 +19,7 @@ eval "$(opam env)" OPAMASSUMEDEPEXTS=true opam install conf-rust conf-rust-2021 export CFLAGS="-fPIC ${CFLAGS:-}" -opam install opam/virtual/octez-deps.opam --deps-only --criteria="-notuptodate,-changed,-removed" +OPAMASSUMEDEPEXTS=true opam install opam/virtual/octez-deps.opam --deps-only --criteria="-notuptodate,-changed,-removed" eval "$(opam env)" dune build "$dune_filepath" diff --git a/meta.json b/meta.json index ee18ff21f..f69d20db3 100644 --- a/meta.json +++ b/meta.json @@ -1,5 +1,5 @@ { - "release": "1", + "release": "2", "maintainer": "Serokell ", "tezos_ref": "octez-v20.2" }