diff --git a/libtransmission/tr-dht.c b/libtransmission/tr-dht.c index 7eba00189..a439889f9 100644 --- a/libtransmission/tr-dht.c +++ b/libtransmission/tr-dht.c @@ -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; diff --git a/update-version-h.sh b/update-version-h.sh index 7d4b45114..ec0d42c5b 100755 --- a/update-version-h.sh +++ b/update-version-h.sh @@ -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