| 1 | #!/bin/shscip-shell filesystem . . `/bin/sh`. |
| 2 | |
| 3 | # This script is used for scrubbing the output of Dune actions calling Coq |
| 4 | # binaries. It contains some common patterns which are scurbbed for any |
| 5 | # non-reproducible paths and the arguments are displayed line by line. |
| 6 | |
| 7 | # \f (form feed) is used as a delayed new line for sed |
| 8 | |
| 9 | sedscip-shell system . . sed. 's/$ (cd .*coqc/coqc/' $1 | # cleanup coqc |
| 10 | sedscip-shell system . . sed. 's/$ (cd .*coqdep/coqdep/' | # cleanup coqdep |
| 11 | sedscip-shell system . . sed. 's/$ (cd .*coqdoc/coqdoc/' | # cleanup coqdoc |
| 12 | sedscip-shell system . . sed. 's/$ (cd .*rocq compile/rocq compile/' $1 | # cleanup coqc |
| 13 | sedscip-shell system . . sed. 's/$ (cd .*rocq dep/rocq dep/' $1 | # cleanup coqc |
| 14 | sedscip-shell system . . sed. 's/)//' | # remove trailing ) |
| 15 | sedscip-shell system . . sed. 's/ -I/\f-I/g' | # new line for each -I |
| 16 | sedscip-shell system . . sed. 's/ -nI/\f-nI/g' | # new line for each -nI |
| 17 | sedscip-shell system . . sed. 's/ -R/\f-R/g' | # new line for each -R |
| 18 | sedscip-shell system . . sed. 's/ -Q/\f-Q/g' | # new line for each -Q |
| 19 | sedscip-shell system . . sed. 's/ -w/\f-w/g' | # new line for each -w |
| 20 | sedscip-shell system . . sed. 's/ -boot/\f-boot/g' | # new line for each -boot |
| 21 | sedscip-shell system . . sed. 's/ -native-compiler /\f-native-compiler /g' | # new line for each -native-compiler |
| 22 | sedscip-shell system . . sed. 's/-R [^[:space:]]*coq /-R coq /g' | # scrub -R with coq |
| 23 | sedscip-shell system . . sed. 's#-R [^[:space:]]*coq/theories #-R coq/theories #g' | # scrub -R with coq/theories |
| 24 | sedscip-shell system . . sed. 's/-I [-A-Za-z0-9\/_\.]*lib\//-I lib\//g' | # scrub -I with lib/ |
| 25 | sedscip-shell system . . sed. 's/-nI [-A-Za-z0-9\/_\.]*lib\//-nI lib\//g' | # scrub -nI with lib/ |
| 26 | sedscip-shell system . . sed. 's/\(-R [^\f]* [^\f]*\) \(.*\)/\1\f\2/g' | # new line after each -R |
| 27 | sedscip-shell system . . sed. 's/\(-I lib\/findlib\)\f\(.*\)/\2\f\1/g' | # move lib/findlib to the end |
| 28 | sedscip-shell system . . sed. 's/\(-I lib\/zarith\)\f\(.*\)/\2\f\1/g' | # move lib/zarith to the end |
| 29 | trscip-shell system . . tr. '\f' '\n' # replace form feed with new line |