Skip to content

Commit

Permalink
Merge pull request #1392 from camptocamp/debian-fix
Browse files Browse the repository at this point in the history
Don't add a file for Ubuntu in Debian container
  • Loading branch information
sbrunner authored Nov 29, 2023
2 parents 4ebe4ca + f46c1e7 commit d4e7ec1
Showing 1 changed file with 16 additions and 15 deletions.
31 changes: 16 additions & 15 deletions c2cciutils/scripts/docker_versions_update.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,22 +51,23 @@ def main() -> None:
],
check=True,
)
# Create a temporary file
with tempfile.NamedTemporaryFile(mode="w", encoding=("utf-8")) as sources_list:
sources_list.write(
"\n".join(
[
f"deb http://archive.ubuntu.com/ubuntu/ {dist_name}-security main restricted",
f"deb http://archive.ubuntu.com/ubuntu/ {dist_name}-security universe",
f"deb http://archive.ubuntu.com/ubuntu/ {dist_name}-security multiverse",
"",
]
if images == "ubuntu":
with tempfile.NamedTemporaryFile(mode="w", encoding=("utf-8")) as sources_list:
sources_list.write(
"\n".join(
[
f"deb http://archive.ubuntu.com/ubuntu/ {dist_name}-security main restricted",
f"deb http://archive.ubuntu.com/ubuntu/ {dist_name}-security universe",
f"deb http://archive.ubuntu.com/ubuntu/ {dist_name}-security multiverse",
"",
]
)
)
sources_list.flush()
subprocess.run(
["docker", "cp", sources_list.name, "apt:/etc/apt/sources.list"],
check=True,
)
)
sources_list.flush()
subprocess.run(
["docker", "cp", sources_list.name, "apt:/etc/apt/sources.list"], check=True
)

subprocess.run(["docker", "exec", "apt", "apt-get", "update"], check=True)

Expand Down

0 comments on commit d4e7ec1

Please sign in to comment.