@@ -382,7 +382,7 @@ To execute:
382382# ## `utils/compare_ds.py` – Compare two data streams (can also compare XCCDFs)
383383
384384This script compares two data streams or two benchmarks and generates a diff output.
385- It can show what changed in rules, for example in description, references and remediation scripts.
385+ It shows what changed in rules, for example in description, references and remediation scripts.
386386Changes in checks (OVAL and OCIL) are shown too, but the OVAL diff is limited to the ` criteria`
387387and ` criterion` order and their IDs.
388388
@@ -396,16 +396,16 @@ diff for the whole data stream or benchmark.
396396The option ` --rule-diffs` can be used to generate a diff file per rule. In this mode the diff files
397397are created in a directory: ` ./compare_ds-diffs` . To change the output dir use ` --output-dir` option.
398398
399- Compare current DISA ' s manual benchmark, and generate per file diffs :
399+ Compare two data streams and save the output to a file :
400400
401401` ` ` bash
402- $ utils/compare_ds.py --disa-content --rule-diffs ./disa-stig-rhel8-v1r6-xccdf-manual. xml shared/references/disa-stig-rhel8-v1r7-xccdf-manual .xml
402+ $ utils/compare_ds.py < source. xml> < target .xml> > content.diff
403403` ` `
404404
405- Compare two data streams :
405+ Compare two DISA ' s benchmarks, and generate per rule diffs in the `compare_ds-diffs` directory :
406406
407407```bash
408- $ utils/compare_ds.py /tmp/ssg-rhel8-ds.xml build/ssg-rhel8-ds .xml > content.diff
408+ $ utils/compare_ds.py --disa-content --rule-diffs <source .xml> <target.xml>
409409```
410410
411411#### HTML Diffs
@@ -420,11 +420,12 @@ Install `diff2html`:
420420 $ sudo npm install -g diff2html-cli
421421```
422422
423- Generate the HTML diffs:
423+ Generate the HTML diffs in the `html` directory. Run the `utils/compare_ds.py` first to generate the diffs in the `compare_ds-diffs` directory.
424424
425425```bash
426+ $ rm -r html/
426427 $ mkdir -p html
427- $ for f in $(ls compare_ds-diffs/) ; do diff2html -i file -t $f -F "html/$f .html" "compare_ds-diffs/ $f"; done
428+ $ for f in compare_ds-diffs/* ; do name="${f##*/}"; diff2html -i file -t "$name" -F "html/$name .html" -- " $f" & done; wait
428429```
429430
430431### `utils/compare_results.py` – Compare to two ARF result files
0 commit comments