source: trunk/update-version-h.sh @ 8576

Last change on this file since 8576 was 8576, checked in by charles, 13 years ago

(trunk) "perl -r" wasn't portable to os x

  • Property svn:executable set to *
File size: 839 bytes
Line 
1echo "creating libtransmission/version.h"
2
3user_agent_prefix=`grep m4_define configure.ac | sed "s/[][)(]/,/g" | grep user_agent_prefix  | cut -d , -f 6`
4
5peer_id_prefix=`grep m4_define configure.ac | sed "s/[][)(]/,/g" | grep peer_id_prefix  | cut -d , -f 6`
6
7if [ -d .svn ]; then
8    svn_revision=`svnversion -n | cut -d: -f1 | cut -dM -f1 | cut -dS -f1`
9else
10    svn_revision=`grep -oh '\$Id: [^ ]\+ [0-9]\+' */*\.cc */*\.[chm] | cut -d ' ' -f 3 | sort | tail -n 1 -`
11fi
12
13cat > libtransmission/version.h << EOF
14#define PEERID_PREFIX         "${peer_id_prefix}"
15#define USERAGENT_PREFIX      "${user_agent_prefix}"
16#define SVN_REVISION          "${svn_revision}"
17#define SVN_REVISION_NUM      ${svn_revision}
18#define SHORT_VERSION_STRING  "${user_agent_prefix}"
19#define LONG_VERSION_STRING   "${user_agent_prefix} (${svn_revision})"
20EOF
Note: See TracBrowser for help on using the repository browser.