Merge "apt: Add allow-downgrades option per package"

This commit is contained in:
Zuul 2019-10-17 18:26:23 +00:00 committed by Gerrit Code Review
commit 010b5c6c03
3 changed files with 3 additions and 1 deletions

View File

@ -106,7 +106,7 @@ dpkg --configure -a
{{- $pkg_name := .name }}
if [[ "${CURRENT_PACKAGES[{{ .name | squote }}]+isset}" != "isset"{{- if .version }} || "${CURRENT_PACKAGES[{{ .name | squote }}]}" != {{ .version }}{{- end }} ]]; then
# Run this in case some package installation was interrupted
DEBIAN_FRONTEND=noninteractive apt-get install -y -o Dpkg::Options::=--force-confdef -o Dpkg::Options::=--force-confold{{- if .repo }} -t {{ .repo }}{{ end }} {{ .name -}} {{- if .version }}={{ .version }}{{ end }}
DEBIAN_FRONTEND=noninteractive apt-get install -y -o Dpkg::Options::=--force-confdef -o Dpkg::Options::=--force-confold {{- if .allow_downgrade }} "--allow-downgrades" {{ end }}{{- if .repo }} -t {{ .repo }}{{ end }} {{ .name -}} {{- if .version }}={{ .version }}{{ end }}
INSTALLED_THIS_TIME="$INSTALLED_THIS_TIME {{ .name }}"
fi
REQUESTED_PACKAGES="$REQUESTED_PACKAGES {{ .name }}"

View File

@ -121,6 +121,7 @@ Here is an example configuration for it::
packages:
- name: <PACKAGE1>
version: <VERSION1>
allow_downgrade: true
- name: <PACKAGE2>
There is a possibility to blacklist packages, e.g. ``telnetd`` and ``nis``::

View File

@ -1208,6 +1208,7 @@ test_apt(){
packages:
- name: $APT_PACKAGE1
version: $APT_VERSION1
allow_downgrade: true
- name: $APT_PACKAGE2" > "${overrides_yaml}"
install_base "--values=${overrides_yaml}"
get_container_status apt