From f7bcf9c5ca716cca210d4910d5c1145de9fac277 Mon Sep 17 00:00:00 2001
From: Alex Iribarren <Alex.Iribarren@cern.ch>
Date: Fri, 7 Dec 2018 16:12:15 +0100
Subject: [PATCH] Log exit status

---
 reposync/runreposync.sh | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/reposync/runreposync.sh b/reposync/runreposync.sh
index 7d91a5b..97861ef 100755
--- a/reposync/runreposync.sh
+++ b/reposync/runreposync.sh
@@ -153,6 +153,16 @@ for rpm in ${CHANGELIST}; do
 EOF
 done
 
+CHANGECOUNT=`echo "${CHANGELIST}" | wc -l | awk '{print $1}'`
+
+cat << EOF | log
+  "message_type": "result",
+  "exit_code": ${RET},
+  "pre_count": ${PRECOUNT},
+  "post_count": ${POSTCOUNT},
+  "change_count": ${CHANGECOUNT}
+EOF
+
 # Turn the new-line separated list of changes into a comma-separated list of quoted strings
 LIST=`sed 's/^/"/;s/$/"/;s/^""$//' <(echo "${CHANGELIST}") | /usr/bin/tr '\n' ',' | sed 's/,$//'`
 
-- 
GitLab