Skip to content

Commit

Permalink
fixed: show Git revision number instead of SVN. commiting for TheUni
Browse files Browse the repository at this point in the history
  • Loading branch information
amet committed Jan 6, 2011
1 parent 0931a15 commit 646c49f
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 26 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Expand Up @@ -66,7 +66,7 @@ config.log
/stamp-h1
/xbmc.bin
/xbmc-xrandr
/svn_revision.h
/git_revision.h

# /addons/
/addons/com.nullsoft.milkdrop.xbmc/*.vis
Expand Down
4 changes: 2 additions & 2 deletions XBMC.xcodeproj/project.pbxproj
Expand Up @@ -7184,7 +7184,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "# Update version in Info.plist with SVN revision\nSVN_REVISION=\"Unknown\"\nBUNDLE_NAME=\"XBMC\"\n\nSVN_REVISION=\"SVN-\"$(cat svn_revision.h | sed -n 's/\\(.*\\)\\\"\\(.*\\)\\\"\\(.*\\)/\\2/p')\nperl -p -i -e \"s/r####/$SVN_REVISION/\" \"$TARGET_BUILD_DIR/$BUNDLE_NAME.app/Contents/Info.plist\"\n";
shellScript = "# Update version in Info.plist with Git revision\nGIT_REVISION=\"Unknown\"\nBUNDLE_NAME=\"XBMC\"\n\nGIT_REVISION=\"Git-\"$(cat git_revision.h | sed -n 's/\\(.*\\)\\\"\\(.*\\)\\\"\\(.*\\)/\\2/p')\nperl -p -i -e \"s/r####/$GIT_REVISION/\" \"$TARGET_BUILD_DIR/$BUNDLE_NAME.app/Contents/Info.plist\"\n";
};
F5A1CBDE0F6B0B4700A96ABD /* copy root files */ = {
isa = PBXShellScriptBuildPhase;
Expand Down Expand Up @@ -7227,7 +7227,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "# Update version in Info.plist with SVN revision\nSVN_REVISION=\"Unknown\"\nBUNDLE_NAME=\"XBMC\"\n\nSVN_REVISION=\"SVN-\"$(cat svn_revision.h | sed -n 's/\\(.*\\)\\\"\\(.*\\)\\\"\\(.*\\)/\\2/p')\nperl -p -i -e \"s/r####/$SVN_REVISION/\" \"$TARGET_BUILD_DIR/$BUNDLE_NAME.app/Contents/Info.plist\"\n";
shellScript = "# Update version in Info.plist with Git revision\nGIT_REVISION=\"Unknown\"\nBUNDLE_NAME=\"XBMC\"\n\nGIT_REVISION=\"Git-\"$(cat git_revision.h | sed -n 's/\\(.*\\)\\\"\\(.*\\)\\\"\\(.*\\)/\\2/p')\nperl -p -i -e \"s/r####/$GIT_REVISION/\" \"$TARGET_BUILD_DIR/$BUNDLE_NAME.app/Contents/Info.plist\"\n";
};
F5DEC3580E6DEBB2005A4E24 /* copy root files */ = {
isa = PBXShellScriptBuildPhase;
Expand Down
22 changes: 7 additions & 15 deletions configure.in
Expand Up @@ -1085,7 +1085,6 @@ if test "$ARCH" != "x86_64-linux"; then
fi
fi

AC_CHECK_PROG(HAVE_SVNVERSION,svnversion,"yes","no",)
AC_CHECK_PROG(HAVE_GIT,git,"yes","no",)

# Checks for header files.
Expand Down Expand Up @@ -1258,23 +1257,16 @@ else
final_message="$final_message\n Avahi:\tNo"
fi

if ! test -n "$SVN_REV" -a "$SVN_REV" != "" ; then
if test "$HAVE_SVNVERSION" = "yes" ; then
SVN_REV=$(svnversion -n -c 2>/dev/null | grep -iv ^exported | sed -e 's/.*\://')
fi
if test "$SVN_REV" = ""; then
if test "$HAVE_GIT" = "yes"; then
SVN_REV=$(./gitrev.sh)
fi
fi
if test "$SVN_REV" = ""; then
SVN_REV="Unknown"
fi
if test "$HAVE_GIT" = "yes"; then
GIT_REV=$(git rev-parse --short HEAD)
fi
if test "$GIT_REV" = ""; then
GIT_REV="Unknown"
fi
if test "$host_vendor" = "apple"; then
echo "#define SVN_REV \"$SVN_REV\"" > svn_revision.h
echo "#define GIT_REV \"$GIT_REV\"" > git_revision.h
else
SDL_DEFINES="$SDL_DEFINES -D'SVN_REV=\"$SVN_REV\"'"
SDL_DEFINES="$SDL_DEFINES -D'GIT_REV=\"$GIT_REV\"'"
fi

if test "$use_nonfree" = "yes"; then
Expand Down
8 changes: 4 additions & 4 deletions guilib/system.h
Expand Up @@ -144,15 +144,15 @@
#endif

/*****************
* SVN revision
* Git revision
*****************/

#ifdef __APPLE__
#include "../svn_revision.h"
#include "../git_revision.h"
#endif

#ifndef SVN_REV
#define SVN_REV "Unknown"
#ifndef GIT_REV
#define GIT_REV "Unknown"
#endif

/****************************************
Expand Down
4 changes: 2 additions & 2 deletions xbmc/Application.cpp
Expand Up @@ -499,9 +499,9 @@ bool CApplication::Create()

CLog::Log(LOGNOTICE, "-----------------------------------------------------------------------");
#if defined(__APPLE__)
CLog::Log(LOGNOTICE, "Starting XBMC, Platform: Mac OS X (%s). Built on %s (SVN:%s)", g_sysinfo.GetUnameVersion().c_str(), __DATE__, SVN_REV);
CLog::Log(LOGNOTICE, "Starting XBMC, Platform: Mac OS X (%s). Built on %s (Git:%s)", g_sysinfo.GetUnameVersion().c_str(), __DATE__, GIT_REV);
#elif defined(_LINUX)
CLog::Log(LOGNOTICE, "Starting XBMC, Platform: Linux (%s, %s). Built on %s (SVN:%s)", g_sysinfo.GetLinuxDistro().c_str(), g_sysinfo.GetUnameVersion().c_str(), __DATE__, SVN_REV);
CLog::Log(LOGNOTICE, "Starting XBMC, Platform: Linux (%s, %s). Built on %s (Git:%s)", g_sysinfo.GetLinuxDistro().c_str(), g_sysinfo.GetUnameVersion().c_str(), __DATE__, GIT_REV);
#elif defined(_WIN32)
CLog::Log(LOGNOTICE, "Starting XBMC, Platform: %s. Built on %s (SVN:%s, compiler %i)",g_sysinfo.GetKernelVersion().c_str(), __DATE__, SVN_REV, _MSC_VER);
CLog::Log(LOGNOTICE, g_cpuInfo.getCPUModel().c_str());
Expand Down
4 changes: 2 additions & 2 deletions xbmc/utils/GUIInfoManager.cpp
Expand Up @@ -3439,8 +3439,8 @@ CTemperature CGUIInfoManager::GetGPUTemperature()
CStdString CGUIInfoManager::GetVersion()
{
CStdString tmp;
#ifdef SVN_REV
tmp.Format("%s r%s", VERSION_STRING, SVN_REV);
#ifdef GIT_REV
tmp.Format("%s Git:%s", VERSION_STRING, GIT_REV);
#else
tmp.Format("%s", VERSION_STRING);
#endif
Expand Down

0 comments on commit 646c49f

Please sign in to comment.