]> granicus.if.org Git - transmission/commitdiff
change 'v' field in dht to use major/minor version instead of svn revision
authorDaniel Lee <Longinus00@gmail.com>
Wed, 13 Oct 2010 17:09:05 +0000 (17:09 +0000)
committerDaniel Lee <Longinus00@gmail.com>
Wed, 13 Oct 2010 17:09:05 +0000 (17:09 +0000)
libtransmission/tr-dht.c
update-version-h.sh

index 7eba00189d09d6dd65af223cdb4eff882b69fc6c..a439889f989f712a26a9e3a67557ba88bb89eb0d 100644 (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;
index 7d4b45114dc2dd1090fa2f6132cca5f2f6758aff..ec0d42c5b8da2f26d9fc8e57b4c0f2909fa820b3 100755 (executable)
@@ -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