Commit 24691ac9 authored by Natanael Copa's avatar Natanael Copa

setup-apkrepos: simplification of apk update error handling

apk update -q will output error if any and be quiet otherwise.
we dont need extra logic to fish out error messages.
parent 64c15514
......@@ -306,12 +306,7 @@ prompt_update_apk() {
case "$update_repo_indexes" in
[yY])
echo -n "Updating repository indexes... "
local apkupdate_errors=`apk update 2>&1 | grep -E "^(WARNING|ERROR)" | sed -r "s/(WARNING|ERROR)/\n\1/g"`
if [ ${#apkupdate_errors} -gt 0 ]; then
echo "$apkupdate_errors"
else
echo "done."
fi
apk update -q && echo "done."
break
;;
[nN]) break;;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment