Mac: Use the current date when building BOINC Client and Manager to automatically set the copyright year which will be shown in Mac's Get Info display for this build.

This commit is contained in:
Charlie Fenton 2014-06-16 03:02:04 -07:00
parent a93cc30e59
commit aba26d3564
1 changed files with 7 additions and 1 deletions

View File

@ -31,6 +31,7 @@
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <time.h>
#include <sys/param.h> // for MAXPATHLEN
#include <sys/stat.h>
#include "version.h"
@ -141,6 +142,11 @@ int file_exists(const char* path) {
int FixInfoPlist_Strings(char* myPath, char* name) {
int retval = 0;
FILE *f;
time_t cur_time;
struct tm *time_data;
cur_time = time(NULL);
time_data = localtime( &cur_time );
if (IsFileCurrent(myPath))
return 0;
@ -151,7 +157,7 @@ int FixInfoPlist_Strings(char* myPath, char* name) {
fprintf(f, "/* Localized versions of Info.plist keys */\n\n");
fprintf(f, "CFBundleName = \"%s\";\n", name);
fprintf(f, "CFBundleShortVersionString = \"%s version %s\";\n", name, BOINC_VERSION_STRING);
fprintf(f, "CFBundleGetInfoString = \"%s version %s, Copyright 2014 University of California.\";\n", name, BOINC_VERSION_STRING);
fprintf(f, "CFBundleGetInfoString = \"%s version %s, Copyright %d University of California.\";\n", name, BOINC_VERSION_STRING, time_data->tm_year+1900);
fflush(f);
retval = fclose(f);
}