2009-06-05 17:54:48 +00:00
|
|
|
#!/bin/sh
|
2009-06-01 00:43:01 +00:00
|
|
|
echo "creating libtransmission/version.h"
|
|
|
|
|
2009-05-31 20:22:47 +00:00
|
|
|
user_agent_prefix=`grep m4_define configure.ac | sed "s/[][)(]/,/g" | grep user_agent_prefix | cut -d , -f 6`
|
|
|
|
|
|
|
|
peer_id_prefix=`grep m4_define configure.ac | sed "s/[][)(]/,/g" | grep peer_id_prefix | cut -d , -f 6`
|
|
|
|
|
|
|
|
if [ -d .svn ]; then
|
2009-06-01 00:43:01 +00:00
|
|
|
svn_revision=`svnversion -n | cut -d: -f1 | cut -dM -f1 | cut -dS -f1`
|
2009-05-31 20:22:47 +00:00
|
|
|
else
|
2009-06-05 17:54:48 +00:00
|
|
|
svn_revision=`awk '/\\$Id: /{ if ($4>i) i=$4 } END {print i}' */*.cc */*.[chm]`
|
2009-05-31 20:22:47 +00:00
|
|
|
fi
|
|
|
|
|
2009-05-31 20:25:37 +00:00
|
|
|
cat > libtransmission/version.h << EOF
|
2009-05-31 20:22:47 +00:00
|
|
|
#define PEERID_PREFIX "${peer_id_prefix}"
|
|
|
|
#define USERAGENT_PREFIX "${user_agent_prefix}"
|
|
|
|
#define SVN_REVISION "${svn_revision}"
|
|
|
|
#define SVN_REVISION_NUM ${svn_revision}
|
|
|
|
#define SHORT_VERSION_STRING "${user_agent_prefix}"
|
|
|
|
#define LONG_VERSION_STRING "${user_agent_prefix} (${svn_revision})"
|
|
|
|
EOF
|