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

Last change on this file since 8587 was 8587, checked in by jhujhiti, 13 years ago

(trunk) fix an awk oops (thanks to geirha on freenode)

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