Skip to content

Commit

Permalink
Merge pull request #1418 from camptocamp/backport/1417-to-master
Browse files Browse the repository at this point in the history
[Backport master] Don't override the sources list
  • Loading branch information
sbrunner authored Nov 30, 2023
2 parents 4581969 + 5a96bbb commit 13b2017
Showing 1 changed file with 4 additions and 22 deletions.
26 changes: 4 additions & 22 deletions c2cciutils/scripts/docker_versions_update.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import re
import subprocess # nosec
import sys
import tempfile

import ruamel.yaml

Expand All @@ -27,12 +26,12 @@ def main() -> None:
dist, package = package_full.split("/")
if dist not in cache:
correspondence = {
"ubuntu_22_04": ("ubuntu", "22.04", "jammy"),
"debian_11": ("debian", "11", "bullseye"),
"debian_12": ("debian", "12", "bookworm"),
"ubuntu_22_04": ("ubuntu", "22.04"),
"debian_11": ("debian", "11"),
"debian_12": ("debian", "12"),
}
if dist in correspondence:
images, tag, dist_name = correspondence[dist]
images, tag = correspondence[dist]
subprocess.run(
["docker", "rm", "--force", "apt"], stderr=subprocess.DEVNULL, check=False
)
Expand All @@ -52,23 +51,6 @@ def main() -> None:
],
check=True,
)
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,
)

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

Expand Down

0 comments on commit 13b2017

Please sign in to comment.