X-Git-Url: https://git.xonotic.org/?p=xonotic%2Fxonotic.git;a=blobdiff_plain;f=check-gitattributes.sh;h=bb3022c4cf29ff9512026bf84ba9c81ec97a7e21;hp=6a35c4c0a2d2f6388aa44b6e0dd622af826f8ed8;hb=06f78be4eba3c99ef500ae7cddab7a6efe528019;hpb=740a38b25a4637627123304d6355a355376a1979 diff --git a/check-gitattributes.sh b/check-gitattributes.sh index 6a35c4c0..bb3022c4 100755 --- a/check-gitattributes.sh +++ b/check-gitattributes.sh @@ -3,20 +3,26 @@ exec 3<&0 ISANYTHING=" -crlf" -ISBINARY=" -crlf -diff" +ISBINARY=" -diff -crlf" ISTEXT=" crlf=input" LF=" " eol=`cat .gitattributes` -find . -name .git -prune -o \( -type f -print \) | { +find . -name .git -prune -o -name xonotic-nexcompat.pk3dir -prune -o \( -type f -print \) | { unseen=`echo "$eol" | cut -d ' ' -f 1 | grep .` neweol= while IFS= read -r LINE; do nam=${LINE##*/} case "$nam" in + *.txt.*) + nam="*.txt.*" + ;; + *.db.*) + nam="*.db.*" + ;; *.*) - nam=*.${nam##*.} + nam="*.${nam##*.}" ;; esac t=`file -b --mime-type "$LINE"` @@ -33,16 +39,16 @@ find . -name .git -prune -o \( -type f -print \) | { esac unseen=`{ echo "$nam"; echo "$nam"; echo "$unseen"; } | sort | uniq -u` case "$LF$eol$LF$neweol$LF" in - *$LF$nam$ISANYTHING$LF*) + *$LF$nam$ISANYTHING*$LF*) # ignore and treat as binary ;; - *$LF$nam$ISBINARY$LF*) + *$LF$nam$ISBINARY*$LF*) # should be binary if $t; then echo "WARNING: file $LINE is text, should be binary" fi ;; - *$LF$nam$ISTEXT$LF*) + *$LF$nam$ISTEXT*$LF*) # should be text if ! $t; then echo "WARNING: file $LINE is binary, should be text"