File: check-files-in-git.sh

package info (click to toggle)
libwacom 2.16.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,328 kB
  • sloc: ansic: 5,943; python: 2,528; sh: 65; makefile: 21
file content (26 lines) | stat: -rwxr-xr-x 611 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/usr/bin/env bash
#
# Usage: check-files-in-git.sh /path/to/libwacom/

if [ -z "$top_srcdir" ]; then
    top_srcdir="$1"
fi
if [ -z "$top_srcdir" ]; then
    echo "Usage: `basename $0` /path/to/libwacom"
    exit 1
fi

export GIT_DIR="$top_srcdir/.git";
if ! git ls-files >& /dev/null; then
    echo "Not a git tree. Skipping"
    exit 77
fi

pushd "$top_srcdir" > /dev/null
for file in data/*.tablet data/*.stylus data/layouts/*.svg; do
    git ls-files --error-unmatch "$file" &> /dev/null || (
        echo "ERROR: File $file is not in git" && test);
    rc="$(($rc + $?))";
done
popd > /dev/null
exit $rc