Create option to turn on verbose logging.
Change-Id: I1ad71a603a92e44ee93e0663c7b2db216a1811ff
This commit is contained in:
parent
1858d0ef37
commit
229bbe75b0
@ -35,13 +35,11 @@ fi
|
|||||||
write_test "${persist_path}"
|
write_test "${persist_path}"
|
||||||
|
|
||||||
load_package_list_with_versions(){
|
load_package_list_with_versions(){
|
||||||
set +x
|
|
||||||
for f in "$@"; do
|
for f in "$@"; do
|
||||||
IFS="=" read -r name version <<< $f;
|
IFS="=" read -r name version <<< $f;
|
||||||
IFS=":" read -r name arch <<< $name;
|
IFS=":" read -r name arch <<< $name;
|
||||||
CURRENT_PACKAGES["$name"]="$version";
|
CURRENT_PACKAGES["$name"]="$version";
|
||||||
done
|
done
|
||||||
set -x
|
|
||||||
}
|
}
|
||||||
|
|
||||||
################################################
|
################################################
|
||||||
@ -115,7 +113,6 @@ DEBIAN_FRONTEND=noninteractive apt-get update
|
|||||||
dpkg --configure -a --force-confold,confdef
|
dpkg --configure -a --force-confold,confdef
|
||||||
|
|
||||||
# Perform package installs
|
# Perform package installs
|
||||||
set +x
|
|
||||||
{{- if .Values.conf.apt.strict }}
|
{{- if .Values.conf.apt.strict }}
|
||||||
{{- range $all_apt_packages }}
|
{{- range $all_apt_packages }}
|
||||||
{{- $pkg_name := .name }}
|
{{- $pkg_name := .name }}
|
||||||
@ -131,7 +128,6 @@ fi
|
|||||||
REQUESTED_PACKAGES="$REQUESTED_PACKAGES {{$pkg_name}}"
|
REQUESTED_PACKAGES="$REQUESTED_PACKAGES {{$pkg_name}}"
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
set -x
|
|
||||||
# Run this in case some package installation was interrupted
|
# Run this in case some package installation was interrupted
|
||||||
DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y -o Dpkg::Options::=--force-confdef -o Dpkg::Options::=--force-confold {{- if .Values.conf.apt.allow_downgrade }} "--allow-downgrades" {{ end }}{{- if .repo }} -t {{ .repo }}{{ end }} $INSTALLED_THIS_TIME
|
DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y -o Dpkg::Options::=--force-confdef -o Dpkg::Options::=--force-confold {{- if .Values.conf.apt.allow_downgrade }} "--allow-downgrades" {{ end }}{{- if .repo }} -t {{ .repo }}{{ end }} $INSTALLED_THIS_TIME
|
||||||
{{- end }}
|
{{- end }}
|
||||||
@ -179,12 +175,10 @@ if [ -f ${persist_path}/packages ]; then
|
|||||||
{{- if .Values.conf.apt.strict }}
|
{{- if .Values.conf.apt.strict }}
|
||||||
load_package_list_with_versions $(dpkg -l | awk 'NR>5 {print $2"="$3}')
|
load_package_list_with_versions $(dpkg -l | awk 'NR>5 {print $2"="$3}')
|
||||||
{{- end }}
|
{{- end }}
|
||||||
set +x
|
|
||||||
for package in "${!CURRENT_PACKAGES[@]}"
|
for package in "${!CURRENT_PACKAGES[@]}"
|
||||||
do
|
do
|
||||||
CURRENT_PACKAGE_NAMES="$CURRENT_PACKAGE_NAMES $package"
|
CURRENT_PACKAGE_NAMES="$CURRENT_PACKAGE_NAMES $package"
|
||||||
done
|
done
|
||||||
set -x
|
|
||||||
echo $CURRENT_PACKAGE_NAMES | sed 's/ /\n/g' | sed '/^[[:space:]]*$/d' | sort > ${persist_path}/packages.current
|
echo $CURRENT_PACKAGE_NAMES | sed 's/ /\n/g' | sed '/^[[:space:]]*$/d' | sort > ${persist_path}/packages.current
|
||||||
{{- if .Values.conf.apt.strict }}
|
{{- if .Values.conf.apt.strict }}
|
||||||
TO_DELETE=$(comm -23 ${persist_path}/packages.current ${persist_path}/packages.requested)
|
TO_DELETE=$(comm -23 ${persist_path}/packages.current ${persist_path}/packages.requested)
|
||||||
|
@ -93,7 +93,10 @@ die(){
|
|||||||
}
|
}
|
||||||
export -f die
|
export -f die
|
||||||
trap 'die' ERR
|
trap 'die' ERR
|
||||||
set -x
|
{{- if .Values.conf.extra_verbose }}
|
||||||
|
set -x
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
|
||||||
write_test(){
|
write_test(){
|
||||||
local write_test_file
|
local write_test_file
|
||||||
|
@ -24,6 +24,7 @@ images:
|
|||||||
conf:
|
conf:
|
||||||
chroot_mnt_path: '/mnt'
|
chroot_mnt_path: '/mnt'
|
||||||
log_colors: False
|
log_colors: False
|
||||||
|
extra_verbose: False
|
||||||
apt:
|
apt:
|
||||||
upgrade: false
|
upgrade: false
|
||||||
allow_downgrade: false
|
allow_downgrade: false
|
||||||
|
Loading…
x
Reference in New Issue
Block a user