From bf3fccff2e33e63eb7b4d826ed0f54733573e0ce Mon Sep 17 00:00:00 2001 From: Renato Botelho Date: Thu, 10 Aug 2017 16:55:27 -0300 Subject: [PATCH] Save pkg update return code --- src/etc/rc.update_pkg_metadata | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/etc/rc.update_pkg_metadata b/src/etc/rc.update_pkg_metadata index 8c4e019fd4..a0fcd48f1e 100755 --- a/src/etc/rc.update_pkg_metadata +++ b/src/etc/rc.update_pkg_metadata @@ -32,11 +32,15 @@ tmp_version=$(mktemp -q /tmp/${product}_version.XXXXXXXX) \ sleep $sleep_time \ && /usr/local/sbin/${product}-upgrade -uf \ && ( \ - /usr/local/sbin/${product}-upgrade -Uc >> $tmp_version \ - ; test $? -eq 2 && return 0 \ + /usr/local/sbin/${product}-upgrade -Uc > $tmp_version \ + ; rc=$? \ + ; echo $rc > ${tmp_version}.rc \ + ; test $rc -eq 2 && return 0 || return $rc \ ) \ - && mv $tmp_version /var/run/${product}_version \ - || rm -f $tmp_version + && ( \ + mv $tmp_version /var/run/${product}_version \ + && mv ${tmp_version}.rc /var/run/${product}_version.rc \ + ) || rm -f $tmp_version ${tmp_version}.rc ) >/dev/null 2>&1 & exit 0