2009-09-17 17:56:59 +00:00
|
|
|
#!/usr/bin/env sh
|
|
|
|
|
2009-09-18 19:26:34 +00:00
|
|
|
HEADER="svn_version.h"
|
|
|
|
TMPFILE="$HEADER.tmp"
|
|
|
|
|
|
|
|
echo "#ifndef SVN_VERSION_H" > $TMPFILE
|
|
|
|
echo "#define SVN_VERSION_H" >> $TMPFILE
|
|
|
|
echo "" >> $TMPFILE
|
2009-09-17 17:56:59 +00:00
|
|
|
|
|
|
|
if [ -d .git ]; then
|
|
|
|
CMD="git svn info"
|
|
|
|
elif [ -d .svn ]; then
|
|
|
|
CMD="svn info"
|
|
|
|
else
|
|
|
|
CMD=""
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "x$CMD" != "x" ]; then
|
2010-11-09 18:14:15 +00:00
|
|
|
LANG=C $CMD | awk '/^URL/ { url = $2; }; \
|
2009-09-17 17:56:59 +00:00
|
|
|
/^Rev/ { rev = $2; }; \
|
|
|
|
END { print "#define SVN_VERSION \"Repository: " url \
|
|
|
|
" Revision: " rev "\""; };' \
|
2009-09-18 19:26:34 +00:00
|
|
|
>> $TMPFILE
|
2009-09-17 17:56:59 +00:00
|
|
|
else
|
2009-09-18 19:26:34 +00:00
|
|
|
echo "#include \"version.h\"" >> $TMPFILE
|
|
|
|
echo "#define SVN_VERSION BOINC_VERSION_STRING" >> $TMPFILE
|
2009-09-17 17:56:59 +00:00
|
|
|
fi
|
|
|
|
|
2009-09-18 19:26:34 +00:00
|
|
|
echo "" >> $TMPFILE
|
|
|
|
echo "#endif" >> $TMPFILE
|
|
|
|
|
|
|
|
if cmp "$HEADER" "$TMPFILE" >/dev/null 2>&1; then
|
|
|
|
rm -f "$TMPFILE"
|
|
|
|
else
|
|
|
|
mv "$TMPFILE" "$HEADER"
|
|
|
|
fi
|