Commit 5c6b2b5e authored by Antonio Terceiro's avatar Antonio Terceiro

debian-status: avoid generating invalid JSON

Cherry-picked from master
parent cd4f9bd7
......@@ -36,7 +36,9 @@ get_status_file() {
get_json() {
local status_file=$(get_status_file "$1")
local prefix="$2"
if [ -f "$status_file" ]; then
echo "$prefix"
cat "$status_file"
fi
}
......@@ -130,10 +132,7 @@ if [ $status_file ]; then
fi
prefix=''
for pkg in $@; do
if [ $prefix ]; then
echo "$prefix" | $indent
fi
get_json "$pkg" | $indent
get_json "$pkg" "$prefix" | $indent
prefix=','
done
[ $# -gt 1 -o $all ] && echo "]"
......
debci (0.6.3) unstable; urgency=medium
* debian-status: avoid generating invalid JSON in the presence of packages
without status files
-- Antonio Terceiro <terceiro@debian.org> Thu, 29 May 2014 12:48:48 -0300
debci (0.6.2) unstable; urgency=medium
* debci-generate-index: don't try merging dependencies diff when no package
......
......@@ -12,4 +12,12 @@ test_everything_fails() {
assertEquals 'fail' "$(debci status -l | awk '{print($2)}' | uniq)"
}
test_packages_without_runs_yet() {
result_pass debci batch
find $debci_data_basedir -type d -name rake | xargs rm -rf
debci generate-index
find $debci_data_basedir -name packages.json | xargs cat | json_pp -f json -t json > /dev/null
assertEquals 0 $?
}
. shunit2
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment