pgrep will exit with non-zero exit code if it didn't find a matching
process. This breaks the script since we set 'errexit' so we need to
mask it by simply piping it to a 'cat' command.
Change-Id: I80dcf06b597a769242bd59d628bbd8e09f0f199e
Signed-off-by: Markos Chandras <mchandras@suse.de>
echo "Checking for running package manager instance..."
while true; do
- _pkg_mgr_proc=$(pgrep -f "${pkg_mgr_cmd%*install*}")
+ _pkg_mgr_proc=$(pgrep -f "${pkg_mgr_cmd%*install*}" | cat)
if [[ -n ${_pkg_mgr_proc} ]]; then
echo "Wainting for process ${_pkg_mgr_proc} to finish..."
sleep 60