summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattia Rizzolo <mattia@mapreri.org>2015-01-03 14:19:26 +0100
committerHolger Levsen <holger@layer-acht.org>2015-01-03 14:25:15 +0100
commit3ffc464cb913d2227efcfd25d1f0bda05c22d846 (patch)
tree5063415f1a690865f0fbc1ad8d2cbb6759b6d734
parent85122180152f3d6cce5565b75d20b03007a04513 (diff)
downloadjenkins.debian.net-3ffc464cb913d2227efcfd25d1f0bda05c22d846.tar.xz
reproducible: fix a issue with the json generation
-rwxr-xr-xbin/reproducible_json.sh14
1 files changed, 8 insertions, 6 deletions
diff --git a/bin/reproducible_json.sh b/bin/reproducible_json.sh
index 1bbf0d19..339df19b 100755
--- a/bin/reproducible_json.sh
+++ b/bin/reproducible_json.sh
@@ -21,23 +21,25 @@ RESULT=$(sqlite3 -init $INIT $PACKAGES_DB "SELECT name,version,status FROM sourc
COUNT_TOTAL=$(sqlite3 -init $INIT $PACKAGES_DB "SELECT COUNT(name) FROM source_packages WHERE status != \"\"")
echo "$(date) - processing $COUNT_TOTAL packages to create .json output... this will take a while."
+sep=""
write_json "["
-for LINE in $RESULT ; do
- PKG=$(echo $LINE | cut -d "|" -f1)
- VERSION=$(echo $LINE | cut -d "|" -f2)
- STATUS=$(echo $LINE | cut -d "|" -f3)
+while read LINE ; do
+ PKG=$(echo "$LINE" | cut -d "|" -f1)
+ VERSION=$(echo "$LINE" | cut -d "|" -f2)
+ STATUS=$(echo "$LINE" | cut -d "|" -f3)
if [ "$STATUS" = "unreproducible" ] ; then
if [ -f /var/lib/jenkins/userContent/buildinfo/${PKG}_${VERSION}_amd64.buildinfo ] ; then
STATUS="$STATUS-with-buildinfo"
fi
fi
- write_json "{"
+ write_json "${sep}{"
write_json "\"package\": \"$PKG\","
write_json "\"version\": \"$VERSION\","
write_json "\"status\": \"$STATUS\","
write_json "\"suite\": \"sid\""
write_json "}"
-done
+ sep=", "
+done < <(echo "$RESULT")
write_json "]"
echo