From 3ffc464cb913d2227efcfd25d1f0bda05c22d846 Mon Sep 17 00:00:00 2001 From: Mattia Rizzolo Date: Sat, 3 Jan 2015 14:19:26 +0100 Subject: reproducible: fix a issue with the json generation --- bin/reproducible_json.sh | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'bin/reproducible_json.sh') 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 -- cgit v1.2.3-54-g00ecf