diff options
author | Stefan Metzmacher <metze@samba.org> | 2006-05-08 13:09:09 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 14:05:44 -0500 |
commit | 713f241edcf222af8e341fd44b3fdb15c71c7ffc (patch) | |
tree | f77d8e60f58864d801e036a3a06c40b341db5902 /source4/script | |
parent | 3cd705a65f9027afa24b5d096b961b8356256257 (diff) | |
download | samba-713f241edcf222af8e341fd44b3fdb15c71c7ffc.tar.gz samba-713f241edcf222af8e341fd44b3fdb15c71c7ffc.tar.bz2 samba-713f241edcf222af8e341fd44b3fdb15c71c7ffc.zip |
r15513: only run 'svn info' and 'svk info' once
metze
(This used to be commit 82cd1de3fb061e0f02455be06506b5aed157b0e5)
Diffstat (limited to 'source4/script')
-rwxr-xr-x | source4/script/mkversion.sh | 33 |
1 files changed, 20 insertions, 13 deletions
diff --git a/source4/script/mkversion.sh b/source4/script/mkversion.sh index 0dd80712ff..908aae8a3d 100755 --- a/source4/script/mkversion.sh +++ b/source4/script/mkversion.sh @@ -69,26 +69,33 @@ if test x"${SAMBA_VERSION_IS_SVN_SNAPSHOT}" = x"yes";then _SAVE_LANG=${LANG} LANG="" HAVESVN=no - svn info ${SOURCE_DIR} >/dev/null 2>&1 && HAVESVN=yes - TMP_REVISION=`(svn info ${SOURCE_DIR} 2>/dev/null || svk info ${SOURCE_DIR} 2>/dev/null) |grep 'Last Changed Rev.*:' |sed -e 's/Last Changed Rev.*: \([0-9]*\).*/\1/'` - if test x"${HAVESVN}" = x"no";then + SVN_INFO=`svn info ${SOURCE_DIR} 2>/dev/null` + TMP_REVISION=`echo -e "${SVN_INFO}" | grep 'Last Changed Rev.*:' |sed -e 's/Last Changed Rev.*: \([0-9]*\).*/\1/'` + if test -n "$TMP_REVISION"; then + HAVESVN=yes + fi + if test x"${HAVESVN}" != x"yes";then HAVESVK=no - svk info ${SOURCE_DIR} >/dev/null 2>&1 && HAVESVK=yes - TMP_MIRRORED_REVISION=`(svk info ${SOURCE_DIR} 2>/dev/null) |grep 'Mirrored From:.*samba\.org.*' |sed -e 's/Mirrored From: .* Rev\..* \([0-9]*\).*/\1/'` - if test -n "$TMP_MIRRORED_REVISION"; then - TMP_SVK_REVISION_STR="${TMP_REVISION}-${USER}@${HOSTNAME}-[SVN-${TMP_MIRRORED_REVISION}]" - else - TMP_SVK_REVISION_STR="${TMP_REVISION}-${USER}@${HOSTNAME}" + SVK_INFO=`svk info ${SOURCE_DIR} 2>/dev/null` + TMP_REVISION=`echo -e "${SVK_INFO}" | grep 'Last Changed Rev.*:' |sed -e 's/Last Changed Rev.*: \([0-9]*\).*/\1/'` + if test -n "$TMP_REVISION"; then + HAVESVK=yes fi + TMP_MIRRORED_REVISION=`echo -e "${SVK_INFO}" | grep 'Mirrored From:.*samba\.org.*' |sed -e 's/Mirrored From: .* Rev\..* \([0-9]*\).*/\1/'` fi if test x"${HAVESVN}" = x"yes";then - SAMBA_VERSION_STRING="${SAMBA_VERSION_STRING}-SVN-build-${TMP_REVISION}" - echo "#define SAMBA_VERSION_SVN_REVISION ${TMP_REVISION}" >> $OUTPUT_FILE + SAMBA_VERSION_STRING="${SAMBA_VERSION_STRING}-SVN-build-${TMP_REVISION}" + echo "#define SAMBA_VERSION_SVN_REVISION ${TMP_REVISION}" >> $OUTPUT_FILE elif test x"${HAVESVK}" = x"yes";then - SAMBA_VERSION_STRING="${SAMBA_VERSION_STRING}-SVK-build-${TMP_SVK_REVISION_STR}" + if test -n "$TMP_MIRRORED_REVISION"; then + TMP_SVK_REVISION_STR="${TMP_REVISION}-${USER}@${HOSTNAME}-[SVN-${TMP_MIRRORED_REVISION}]" + else + TMP_SVK_REVISION_STR="${TMP_REVISION}-${USER}@${HOSTNAME}" + fi + SAMBA_VERSION_STRING="${SAMBA_VERSION_STRING}-SVK-build-${TMP_SVK_REVISION_STR}" else - SAMBA_VERSION_STRING="${SAMBA_VERSION_STRING}-SVN-build-UNKNOWN" + SAMBA_VERSION_STRING="${SAMBA_VERSION_STRING}-SVN-build-UNKNOWN" fi LANG=${_SAVE_LANG} fi |