change 'v' field in dht to use major/minor version instead of svn revision

This commit is contained in:
Daniel Lee 2010-10-13 17:09:05 +00:00
parent 1f9e305e30
commit 3f8748edfc
2 changed files with 7 additions and 2 deletions

View File

@ -389,8 +389,8 @@ tr_dhtInit(tr_session *ss, const tr_address * tr_addr)
v[0] = 'T';
v[1] = 'R';
v[2] = (SVN_REVISION_NUM >> 8) & 0xFF;
v[3] = SVN_REVISION_NUM & 0xFF;
v[2] = MAJOR_VERSION;
v[3] = MINOR_VERSION;
rc = dht_init( dht_socket, dht6_socket, myid, (const unsigned char*)v );
if(rc < 0)
goto fail;

View File

@ -17,6 +17,9 @@ user_agent_prefix=`grep m4_define configure.ac | sed "s/[][)(]/,/g" | grep user_
peer_id_prefix=`grep m4_define configure.ac | sed "s/[][)(]/,/g" | grep peer_id_prefix | cut -d , -f 6`
major_version=`echo ${user_agent_prefix} | awk -F . '{print $1}'`
minor_version=`echo ${user_agent_prefix} | awk -F . '{print $2 + 0}'`
# If this is a svn tree, and svnversion is available in PATH, use it to
# grab the version.
if [ -d ".svn" ] && type svnversion >/dev/null 2>&1; then
@ -34,6 +37,8 @@ cat > libtransmission/version.h.new << EOF
#define SHORT_VERSION_STRING "${user_agent_prefix}"
#define LONG_VERSION_STRING "${user_agent_prefix} (${svn_revision})"
#define VERSION_STRING_INFOPLIST ${user_agent_prefix}
#define MAJOR_VERSION ${major_version}
#define MINOR_VERSION ${minor_version}
EOF
# Add a release definition