- fixed bug in generate_svn_version.sh that generated incorrect output

on unix systems that don't synchronize writes to the same file from 
  opposite sides of a pipe. 


svn path=/trunk/boinc/; revision=26058
This commit is contained in:
Eric J. Korpela 2012-08-24 00:36:13 +00:00
parent 5a6b02985d
commit d08a619acc
2 changed files with 17 additions and 7 deletions

View File

@ -5694,3 +5694,11 @@ Rom 22 Aug 2012
client/
cs_cmdline.cpp
main.cpp
Eric K 23 Aug 2012
- build environment: fixed bug in generate_svn_version.sh that generated
incorrect output on unix systems that don't synchronize writes to the
same file from opposite sides of a pipe.
/
generate_svn_version.sh

View File

@ -1,4 +1,4 @@
#!/usr/bin/env sh
#!/usr/bin/env bash
HEADER="svn_version.h"
TMPFILE="$HEADER.tmp"
@ -32,17 +32,19 @@ if [ "x$GIT_LOG" != "x" ]; then
y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/;
s/^/#define REPOSITORY_/;s/$/ 1/' >> $TMPFILE
elif [ "x$CMD" != "x" ]; then
LANG=C $CMD |
awk '/^URL/ { url = $2; };
LANG=C
URL=`$CMD | awk '
/^URL/ { url = $2; };
/^Rev/ { rev = $2; };
END { print "#define SVN_VERSION \"Repository: " url \
" Revision: " rev "\"" >> "'"$TMPFILE"'";
print "#define SVN_REPOSITORY \"" url "\"" >> "'"$TMPFILE"'";
print "#define SVN_REVISION " rev >> "'"$TMPFILE"'";
print url };' |
sed 's%.*://%%;s/[^/]*@//;s/[^a-zA-Z0-9]/_/g;s/__*/_/g;
y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/;
s/^/#define REPOSITORY_/;s/$/ 1/' >> $TMPFILE
print url };'`
echo $URL |
sed 's%.*://%%;s/[^/]*@//;s/[^a-zA-Z0-9]/_/g;s/__*/_/g;
y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/;
s/^/#define REPOSITORY_/;s/$/ 1/' >> $TMPFILE
else
echo "#include \"version.h\"" >> $TMPFILE
echo "#define SVN_VERSION BOINC_VERSION_STRING" >> $TMPFILE