Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #21427: Deprecation warning with apt_get module on ubuntu22 - fix #1360

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 4 additions & 3 deletions tree/10_ncf_internals/modules/packages/apt_get
Expand Up @@ -39,7 +39,8 @@ apt_get_options = ["-o", "Dpkg::Options::=--force-confold",
"-o", "Dpkg::Options::=--force-confdef",
"-y"]

if LooseVersion(apt_version) < LooseVersion("1.1"):
# compare only the first two digits of the version so versions like 1.1.1ubuntu2 work
if [int(x) for x in apt_version.split(".")[0:2]] < [1, 1]:
apt_get_options.append("--force-yes")

else:
Expand All @@ -50,8 +51,8 @@ else:

apt_get_list_update_options = []

# assume apt-get -v returns faily simple version with integers separated by dots
if [int(x) for x in apt_version.split(".")] < [1, 1]:
# compare only the first two digits of the version so versions like 1.1.1ubuntu2 work
if [int(x) for x in apt_version.split(".")[0:2]] < [1, 0]:
apt_get_list_update_options.append("--with-new-pkgs")

os.environ['DEBIAN_FRONTEND'] = "noninteractive"
Expand Down