From 69d9afd75a64fb7ebaec0d45e348abe5f9cc1ec4 Mon Sep 17 00:00:00 2001 From: Mike Gelfand Date: Tue, 17 Apr 2018 12:16:18 +0300 Subject: [PATCH] Adjust CFBundleVersion format to fix Sparkle update check Set the first version component to be the same as the last Subversion-based release build version and add two more components (major and minor version numbers). To allow for nightly build updates this should probably include another component (e.g. build timestamp), but we're not there yet. --- Transmission.xcodeproj/project.pbxproj | 6 +++--- libtransmission/version.h.in | 1 + macosx/AboutWindowController.m | 6 +++--- macosx/Info.plist | 2 +- update-version-h.sh | 1 + 5 files changed, 9 insertions(+), 7 deletions(-) diff --git a/Transmission.xcodeproj/project.pbxproj b/Transmission.xcodeproj/project.pbxproj index 93c8c17f3..811ec7674 100644 --- a/Transmission.xcodeproj/project.pbxproj +++ b/Transmission.xcodeproj/project.pbxproj @@ -3435,7 +3435,7 @@ IBC_NOTICES = NO; IBC_WARNINGS = YES; INFOPLIST_FILE = "$(SRCROOT)/macosx/Info.plist"; - INFOPLIST_OTHER_PREPROCESSOR_FLAGS = "-CC"; + INFOPLIST_OTHER_PREPROCESSOR_FLAGS = "-traditional"; INFOPLIST_PREFIX_HEADER = "$(SRCROOT)/libtransmission/version.h"; INFOPLIST_PREPROCESS = YES; LIBRARY_SEARCH_PATHS = ( @@ -3571,7 +3571,7 @@ IBC_NOTICES = NO; IBC_WARNINGS = YES; INFOPLIST_FILE = "$(SRCROOT)/macosx/Info.plist"; - INFOPLIST_OTHER_PREPROCESSOR_FLAGS = "-CC"; + INFOPLIST_OTHER_PREPROCESSOR_FLAGS = "-traditional"; INFOPLIST_PREFIX_HEADER = "$(SRCROOT)/libtransmission/version.h"; INFOPLIST_PREPROCESS = YES; LIBRARY_SEARCH_PATHS = ( @@ -3648,7 +3648,7 @@ IBC_NOTICES = NO; IBC_WARNINGS = YES; INFOPLIST_FILE = "$(SRCROOT)/macosx/Info.plist"; - INFOPLIST_OTHER_PREPROCESSOR_FLAGS = "-CC"; + INFOPLIST_OTHER_PREPROCESSOR_FLAGS = "-traditional"; INFOPLIST_PREFIX_HEADER = "$(SRCROOT)/libtransmission/version.h"; INFOPLIST_PREPROCESS = YES; LIBRARY_SEARCH_PATHS = ( diff --git a/libtransmission/version.h.in b/libtransmission/version.h.in index db4b5be23..aa6a19d65 100644 --- a/libtransmission/version.h.in +++ b/libtransmission/version.h.in @@ -7,6 +7,7 @@ #define SHORT_VERSION_STRING "${TR_USER_AGENT_PREFIX}" #define LONG_VERSION_STRING "${TR_USER_AGENT_PREFIX} (${TR_VCS_REVISION})" #define VERSION_STRING_INFOPLIST ${TR_USER_AGENT_PREFIX} +#define BUILD_STRING_INFOPLIST 14714.${TR_VERSION_MAJOR}.${TR_VERSION_MINOR} #define MAJOR_VERSION ${TR_VERSION_MAJOR} #define MINOR_VERSION ${TR_VERSION_MINOR} diff --git a/macosx/AboutWindowController.m b/macosx/AboutWindowController.m index f16003bbc..8a30c514c 100644 --- a/macosx/AboutWindowController.m +++ b/macosx/AboutWindowController.m @@ -24,6 +24,8 @@ #import "AboutWindowController.h" +#include "version.h" + @implementation AboutWindowController AboutWindowController * fAboutBoxInstance = nil; @@ -36,9 +38,7 @@ AboutWindowController * fAboutBoxInstance = nil; - (void) awakeFromNib { - NSDictionary * info = [[NSBundle mainBundle] infoDictionary]; - [fVersionField setStringValue: [NSString stringWithFormat: @"%@ (%@)", - [info objectForKey: @"CFBundleShortVersionString"], [info objectForKey: (NSString *)kCFBundleVersionKey]]]; + [fVersionField setStringValue: @(LONG_VERSION_STRING)]; [fCopyrightField setStringValue: [[NSBundle mainBundle] localizedStringForKey: @"NSHumanReadableCopyright" value: nil table: @"InfoPlist"]]; diff --git a/macosx/Info.plist b/macosx/Info.plist index 1f6e290f2..4590634e2 100644 --- a/macosx/Info.plist +++ b/macosx/Info.plist @@ -59,7 +59,7 @@ CFBundleVersion - VCS_REVISION_NUM + BUILD_STRING_INFOPLIST LSApplicationCategoryType public.app-category.utilities LSMinimumSystemVersion diff --git a/update-version-h.sh b/update-version-h.sh index 2679b466b..5f08825be 100755 --- a/update-version-h.sh +++ b/update-version-h.sh @@ -54,6 +54,7 @@ cat > libtransmission/version.h.new << EOF #define SHORT_VERSION_STRING "${user_agent_prefix}" #define LONG_VERSION_STRING "${user_agent_prefix} (${vcs_revision})" #define VERSION_STRING_INFOPLIST ${user_agent_prefix} +#define BUILD_STRING_INFOPLIST 14714.${major_version}.${minor_version} #define MAJOR_VERSION ${major_version} #define MINOR_VERSION ${minor_version} EOF -- 2.40.0