| 1 | #!/usr/bin/envscip-shell filesystem . . `/usr/bin/env`. bash |
| 2 | # |
| 3 | # Usage: check-files-in-git.sh /path/to/libwacom/ |
| 4 | |
| 5 | if [scip-shell system . . `[`. -z "$top_srcdir" ]; then |
| 6 | top_srcdir="$1" |
| 7 | fi |
| 8 | if [scip-shell system . . `[`. -z "$top_srcdir" ]; then |
| 9 | echoscip-shell system . . echo. "Usage: `basenamescip-shell system . . basename. $0` /path/to/libwacom" |
| 10 | exit 1 |
| 11 | fi |
| 12 | |
| 13 | export GIT_DIR="$top_srcdir/.git"; |
| 14 | if ! gitscip-shell system . . git. ls-files >& /dev/null; then |
| 15 | echoscip-shell system . . echo. "Not a git tree. Skipping" |
| 16 | exit 77 |
| 17 | fi |
| 18 | |
| 19 | pushd "$top_srcdir" > /dev/nullscip-shell filesystem . . `/dev/null`. |
| 20 | for file in data/*.tablet data/*.stylus data/layouts/*.svg; do |
| 21 | gitscip-shell system . . git. ls-files --error-unmatch "$file" &> /dev/nullscip-shell filesystem . . `/dev/null`. || ( |
| 22 | echoscip-shell system . . echo. "ERROR: File $file is not in git" && testscip-shell system . . test.); |
| 23 | rc="$(($rc + $?))"; |
| 24 | done |
| 25 | popd > /dev/nullscip-shell filesystem . . `/dev/null`. |
| 26 | exit $rc |