feat(script): Generate list of affected pkgs on one line (#1)
This commit is contained in:
parent
188e3481af
commit
b1249d6a40
@ -43,6 +43,28 @@ function set_severity () {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function write_pkg_list_oneline () {
|
||||||
|
local unabridged_pkg_list_oneline
|
||||||
|
if [[ "${severity}" == 'imp' ]]; then
|
||||||
|
for pkg in "${important_pkgs_in_transaction[@]}"; do
|
||||||
|
if [[ "${unabridged_pkg_list_oneline}" ]]; then
|
||||||
|
unabridged_pkg_list_oneline="${unabridged_pkg_list_oneline}"','"${pkg}"
|
||||||
|
else
|
||||||
|
unabridged_pkg_list_oneline="${pkg}"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
if [[ "${#trivial_pkgs_in_transaction[@]}" -ge '1' ]]; then
|
||||||
|
for pkg in "${trivial_pkgs_in_transaction[@]}"; do
|
||||||
|
if [[ "${unabridged_pkg_list_oneline}" ]]; then
|
||||||
|
unabridged_pkg_list_oneline="${unabridged_pkg_list_oneline}"','"${pkg}"
|
||||||
|
else
|
||||||
|
unabridged_pkg_list_oneline="${pkg}"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
function main () {
|
function main () {
|
||||||
local pkgs_in_transaction
|
local pkgs_in_transaction
|
||||||
pkgs_in_transaction=("${@}")
|
pkgs_in_transaction=("${@}")
|
||||||
@ -53,6 +75,9 @@ function main () {
|
|||||||
local severity
|
local severity
|
||||||
set_severity
|
set_severity
|
||||||
|
|
||||||
|
local pkg_list_oneline
|
||||||
|
write_pkg_list_oneline
|
||||||
|
|
||||||
#for pkg in "${!important_pkgs_in_transaction[@]}"; do
|
#for pkg in "${!important_pkgs_in_transaction[@]}"; do
|
||||||
# printf -- 'Array item '"'"'%s'"'"' equals '"'"'%s'"'"'\n' "${pkg}" "${important_pkgs_in_transaction[${pkg}]}"
|
# printf -- 'Array item '"'"'%s'"'"' equals '"'"'%s'"'"'\n' "${pkg}" "${important_pkgs_in_transaction[${pkg}]}"
|
||||||
#done
|
#done
|
||||||
|
Loading…
x
Reference in New Issue
Block a user