diff --git a/.gitignore b/.gitignore index 84ac74b30..30cf7b27f 100644 --- a/.gitignore +++ b/.gitignore @@ -71,7 +71,7 @@ config.log /stamp-h1 /xbmc.bin /xbmc-xrandr -/svn_revision.h +/git_revision.h # /addons/ /addons/com.nullsoft.milkdrop.xbmc/*.vis diff --git a/XBMC.xcodeproj/project.pbxproj b/XBMC.xcodeproj/project.pbxproj index ee6752f8a..04794bdfb 100644 --- a/XBMC.xcodeproj/project.pbxproj +++ b/XBMC.xcodeproj/project.pbxproj @@ -7186,7 +7186,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; @@ -7229,7 +7229,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; diff --git a/configure.in b/configure.in index a2b67ed85..2a42ee990 100644 --- a/configure.in +++ b/configure.in @@ -1118,7 +1118,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. @@ -1296,23 +1295,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 diff --git a/guilib/system.h b/guilib/system.h index 3e4d67ce1..ec96050dd 100644 --- a/guilib/system.h +++ b/guilib/system.h @@ -152,15 +152,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 /**************************************** diff --git a/xbmc/Application.cpp b/xbmc/Application.cpp index c8a86c315..968c82299 100644 --- a/xbmc/Application.cpp +++ b/xbmc/Application.cpp @@ -503,9 +503,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()); diff --git a/xbmc/utils/GUIInfoManager.cpp b/xbmc/utils/GUIInfoManager.cpp index a7b9f4cdc..165bbb2f2 100644 --- a/xbmc/utils/GUIInfoManager.cpp +++ b/xbmc/utils/GUIInfoManager.cpp @@ -3438,8 +3438,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