diff --git a/tests/bufr_compare.sh b/tests/bufr_compare.sh index 8175cd30b..e4c41cce6 100755 --- a/tests/bufr_compare.sh +++ b/tests/bufr_compare.sh @@ -281,6 +281,24 @@ ${tools_dir}/bufr_compare -b stationOrSiteName $fBufrTmp1 $fBufrTmp2 unset ECCODES_BUFR_MULTI_ELEMENT_CONSTANT_ARRAYS rm -f $fBufrTmp1 $fBufrTmp2 +# Through index +# ------------- +tempIndex1=temp.$label.1.idx +tempIndex2=temp.$label.2.idx +f=$ECCODES_SAMPLES_PATH/BUFR3_local.tmpl +${tools_dir}/bufr_set -s ident:s=66611 $f $fBufrTmp +${tools_dir}/bufr_index_build -N -o $tempIndex1 $f +${tools_dir}/bufr_index_build -N -o $tempIndex2 $fBufrTmp + +set +e +${tools_dir}/bufr_compare $tempIndex1 $tempIndex2 +status=$? +set -e +[ $status -eq 1 ] + +${tools_dir}/bufr_compare -bident -v $tempIndex1 $tempIndex2 +rm -f $tempIndex1 $tempIndex2 + # Clean up # ------------- diff --git a/tools/grib_tools.cc b/tools/grib_tools.cc index faa2ca00f..ce038d07f 100644 --- a/tools/grib_tools.cc +++ b/tools/grib_tools.cc @@ -179,10 +179,11 @@ int grib_tool(int argc, char** argv) dump_file = stdout; } - /* ECC-926: Currently only GRIB indexing works. Disable the through_index if BUFR, GTS etc */ - if (global_options.mode == MODE_GRIB && + /* ECC-926: Currently only GRIB and BUFR indexing work. Disable the through_index if GTS etc */ + if ((global_options.mode == MODE_GRIB || global_options.mode == MODE_BUFR) && is_index_file(global_options.infile->name) && - (global_options.infile_extra && is_index_file(global_options.infile_extra->name))) { + (global_options.infile_extra && is_index_file(global_options.infile_extra->name))) + { global_options.through_index = 1; return grib_tool_index(&global_options); }