Skip to content

Commit

Permalink
Add a script to detect new/deleted C/C++ source files.
Browse files Browse the repository at this point in the history
  • Loading branch information
linuxdude42 committed May 2, 2020
1 parent a702905 commit f0e09a1
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -49,3 +49,4 @@ GPATH
GRTAGS
GTAGS
compile_commands.json
source-checksum
32 changes: 32 additions & 0 deletions mythtv/programs/scripts/sourcechanged.sh
@@ -0,0 +1,32 @@
#!/bin/bash

while [[ ! -e ".git" ]] ; do
cd ..
if [[ `pwd` == "/" ]] ; then
echo "fail."
exit
fi
done

CHECKSUM=`find . -name \*.cpp -o -name \*.c -o -name \*.h | md5sum | cut -b -32`

if [[ ! -e "compile_commands.json" ]] ; then
echo $CHECKSUM > "source-checksum"
echo "new"
exit
fi

if [[ ! -e "source-checksum" ]] ; then
echo $CHECKSUM > "source-checksum"
echo "new2"
exit
fi

line=$(head -n 1 "source-checksum")
if [[ $line != $CHECKSUM ]]; then
echo $CHECKSUM > "source-checksum"
echo "changed"
else
echo "ok"
fi

0 comments on commit f0e09a1

Please sign in to comment.