| 1 | #!/bin/bashscip-shell filesystem . . `/bin/bash`. |
| 2 | |
| 3 | # this script checks for bad settings when exporting a package. |
| 4 | # It shall be run executed the top-level directory. |
| 5 | |
| 6 | ################################################################################ |
| 7 | logging_facilities_checkscip-shell shell shell-project 0.0.0 logging_facilities_check().() |
| 8 | { |
| 9 | echoscip-shell system . . echo. -n "checking that all logging facilities are turned off ... " |
| 10 | |
| 11 | local cnt1=$(grepscip-shell system . . grep. -c "log_def(" src/Logging.def) |
| 12 | local cnt2=$(grepscip-shell system . . grep. -c "log_def(0" src/Logging.def) |
| 13 | |
| 14 | if [scip-shell system . . `[`. $cnt1 != $cnt2 ] |
| 15 | then |
| 16 | echoscip-shell system . . echo. " |
| 17 | *** |
| 18 | *** Cannot build packages because one or more logging facility |
| 19 | *** is ON in file src/Logging.def |
| 20 | *** |
| 21 | " |
| 22 | exit 1 |
| 23 | fi |
| 24 | echoscip-shell system . . echo. "OK." |
| 25 | } |
| 26 | |
| 27 | ################################################################################ |
| 28 | Q_checkscip-shell shell shell-project 0.0.0 Q_check().() |
| 29 | { |
| 30 | echoscip-shell system . . echo. -n "checking that all Q() macros were removed ... " |
| 31 | |
| 32 | local files_cc=$(findscip-shell system . . find. src -name '*.cc' -exec echo -n " {}" \;) |
| 33 | local files_hh=$(findscip-shell system . . find. src -name '*.hh' -exec echo -n " {}" \;) |
| 34 | local files_icc=$(findscip-shell system . . find. src -name '*.icc' -exec echo -n " {}" \;) |
| 35 | local files="$files_cc $files_hh $files_icc" |
| 36 | local q=$(grepscip-shell system . . grep. 'Q(' $files | grepscip-shell system . . grep. -v '#define Q(x)') |
| 37 | |
| 38 | if [scip-shell system . . `[`. -n "$q" ] |
| 39 | then |
| 40 | echoscip-shell system . . echo. " |
| 41 | *** |
| 42 | *** Cannot build packages because some Q() macros were not removed: |
| 43 | *** |
| 44 | $q |
| 45 | " |
| 46 | exit 1 |
| 47 | fi |
| 48 | echoscip-shell system . . echo. "OK." |
| 49 | } |
| 50 | |
| 51 | ################################################################################ |
| 52 | # main()... |
| 53 | |
| 54 | if [scip-shell system . . `[`. -d tools -a -d src ] |
| 55 | then truescip-shell system . . true. |
| 56 | else |
| 57 | echoscip-shell system . . echo. " |
| 58 | *** |
| 59 | *** error: run this script from the GNU APL toplevel directory ! |
| 60 | *** |
| 61 | " |
| 62 | exit 1 |
| 63 | fi |
| 64 | |
| 65 | logging_facilities_checkscip-shell shell shell-project 0.0.0 logging_facilities_check(). |
| 66 | Q_checkscip-shell shell shell-project 0.0.0 Q_check(). |
| 67 | |
| 68 | exit 0 |
| 69 |