From 99c9679b63a279ac8efdecfb8a35e679edef330c Mon Sep 17 00:00:00 2001 From: David Anderson Date: Wed, 31 Aug 2005 00:18:36 +0000 Subject: [PATCH] versions are major/minor/release svn path=/trunk/boinc/; revision=7614 --- checkin_notes | 43 +++++++++++++++++++++++++++++++++++++ client/app_start.C | 4 +++- client/client_state.C | 21 +++++++----------- client/client_state.h | 2 +- client/client_types.C | 5 +++-- client/cs_scheduler.C | 2 ++ client/file_xfer.C | 3 ++- client/gui_rpc_server_ops.C | 12 +++++++---- clientgui/MainDocument.cpp | 5 ----- clientgui/MainDocument.h | 1 - configure.ac | 4 +++- doc/boinc_version.php | 27 +++-------------------- doc/build_system.php | 4 ++-- lib/app_ipc.C | 14 ++++++++++-- lib/app_ipc.h | 4 +++- lib/gui_rpc_client.C | 20 ++++++----------- lib/gui_rpc_client.h | 4 +++- lib/gui_rpc_client_ops.C | 8 +++++-- sched/server_types.C | 4 ++++ sched/server_types.h | 1 + sea/Makefile.am | 2 +- version.h | 13 ++++++----- version.h.in | 3 +++ 23 files changed, 126 insertions(+), 80 deletions(-) diff --git a/checkin_notes b/checkin_notes index 9646a16c43..c10876abf0 100755 --- a/checkin_notes +++ b/checkin_notes @@ -11201,3 +11201,46 @@ David 30 Aug 2005 html/ user/ edit_passwd_action.php + +David 30 Aug 2005 + Various changes for 3-part (major/minor/release) versions: + - app_init_data.xml file and APP_INIT_DATA struct + now have major/minor/release instead of core_version. + This shouldn't break anything because nothing used + core_version as far as I know. + - added element to state file, + scheduler RPC requests, file upload handler requests. + - GUI RPC requests now have major/minor/release instead of + - GUI RPC replies now have major/minor/release instead of encoded + + NOTE: there are a few places where version numbers are + still being packed into integers using the major*100 + minor encoding: + + 1) server min_core_client_version_announced mechanism + 2) server min_core_client_version mechanism + 3) wreq.core_client_version + + These are OK for now since they don't care about release, + and we're not going to have minor versions > 99 in the near future. + But at some point we should fix these. + + configure.ac + version.h + version.h.in + client/ + app_start.C + client_state.C,h + client_types.C + cs_scheduler.C + file_xfer.C + gui_rpc_server_ops.C + clientgui/ + MainDocument.cpp,h + lib/ + app_ipc.C,h + gui_rpc_client.C,h + gui_rpc_client_ops.C + sched/ + server_types.C,h + sea/ + Makefile.am diff --git a/client/app_start.C b/client/app_start.C index 5e47cc518c..873a8af3fb 100644 --- a/client/app_start.C +++ b/client/app_start.C @@ -142,7 +142,9 @@ int ACTIVE_TASK::write_app_init_file() { memset(&aid, 0, sizeof(aid)); - aid.core_version = gstate.version(); + aid.major_version = BOINC_MAJOR_VERSION; + aid.minor_version = BOINC_MINOR_VERSION; + aid.release = BOINC_RELEASE; safe_strcpy(aid.app_name, wup->app->name); safe_strcpy(aid.user_name, wup->project->user_name); safe_strcpy(aid.team_name, wup->project->team_name); diff --git a/client/client_state.C b/client/client_state.C index 1c4f8561a7..562a8b3a23 100644 --- a/client/client_state.C +++ b/client/client_state.C @@ -85,6 +85,7 @@ CLIENT_STATE::CLIENT_STATE() { network_suspended = false; core_client_major_version = BOINC_MAJOR_VERSION; core_client_minor_version = BOINC_MINOR_VERSION; + core_client_release = BOINC_RELEASE; platform_name = HOSTTYPE; exit_after_app_start_secs = 0; app_started = 0; @@ -219,17 +220,15 @@ int CLIENT_STATE::init() { language.read_language_file(LANGUAGE_FILE_NAME); + const char* p=""; #ifdef _DEBUG - msg_printf( - NULL, MSG_INFO, "Starting BOINC client version %d.%02d for %s (DEBUG)", - core_client_major_version, core_client_minor_version, platform_name - ); -#else - msg_printf( - NULL, MSG_INFO, "Starting BOINC client version %d.%02d for %s", - core_client_major_version, core_client_minor_version, platform_name - ); + p = " (DEBUG)"; #endif + msg_printf( + NULL, MSG_INFO, "Starting BOINC client version %d.%d.%d for %s%s", + core_client_major_version, core_client_minor_version, + core_client_release, platform_name, p + ); msg_printf(NULL, MSG_INFO, curl_version()); @@ -1380,10 +1379,6 @@ int CLIENT_STATE::detach_project(PROJECT* project) { return 0; } -int CLIENT_STATE::version() { - return core_client_major_version*100 + core_client_minor_version; -} - bool CLIENT_STATE::want_network() { if (http_ops->nops()) return true; if (network_suspended) return false; diff --git a/client/client_state.h b/client/client_state.h index 77efee8128..1773b057d3 100644 --- a/client/client_state.h +++ b/client/client_state.h @@ -105,6 +105,7 @@ public: int core_client_major_version; int core_client_minor_version; + int core_client_release; int file_xfer_giveup_period; int user_run_request; // values above (USER_RUN_REQUEST_*) @@ -197,7 +198,6 @@ public: int detach_project(PROJECT*); int report_result_error(RESULT&, const char *format, ...); int reset_project(PROJECT*); - int version(); bool want_network_flag; bool want_network(); void network_available(); diff --git a/client/client_types.C b/client/client_types.C index 217a187038..1fc7e79a87 100644 --- a/client/client_types.C +++ b/client/client_types.C @@ -1292,9 +1292,10 @@ int RESULT::write(MIOFILE& out, bool to_server) { out.printf("\n"); if (to_server) { out.printf( - "%d.%.2d\n", + "%d.%d.%d\n", gstate.core_client_major_version, - gstate.core_client_minor_version + gstate.core_client_minor_version, + gstate.core_client_release ); } out.printf(stderr_out.c_str()); diff --git a/client/cs_scheduler.C b/client/cs_scheduler.C index 93810f1bc0..1501499738 100644 --- a/client/cs_scheduler.C +++ b/client/cs_scheduler.C @@ -237,6 +237,7 @@ int CLIENT_STATE::make_scheduler_request(PROJECT* p) { " %s\n" " %d\n" " %d\n" + " %d\n" " %f\n" " %f\n" " %f\n" @@ -247,6 +248,7 @@ int CLIENT_STATE::make_scheduler_request(PROJECT* p) { p->anonymous_platform?"anonymous":platform_name, core_client_major_version, core_client_minor_version, + core_client_release, p->work_request, p->resource_share / prrs, time_until_work_done(p, proj_min_results(p, prrs)-1, prrs), diff --git a/client/file_xfer.C b/client/file_xfer.C index fbf7c024e7..a8c069c0f7 100644 --- a/client/file_xfer.C +++ b/client/file_xfer.C @@ -82,9 +82,10 @@ int FILE_XFER::init_upload(FILE_INFO& file_info) { "\n" " %d\n" " %d\n" + " %d\n" " %s\n" "\n", - BOINC_MAJOR_VERSION, BOINC_MINOR_VERSION, + BOINC_MAJOR_VERSION, BOINC_MINOR_VERSION, BOINC_RELEASE, file_info.name ); file_size_query = true; diff --git a/client/gui_rpc_server_ops.C b/client/gui_rpc_server_ops.C index a9cc443a40..5a311232fb 100644 --- a/client/gui_rpc_server_ops.C +++ b/client/gui_rpc_server_ops.C @@ -635,7 +635,7 @@ int GUI_RPC_CONN::handle_rpc() { MIOFILE mf; MFILE m; char* p; - int client_version; + int major_version; mf.init_mfile(&m); SCOPE_MSG_LOG scope_messages(log_messages, CLIENT_MSG_LOG::DEBUG_GUIRPC); @@ -656,12 +656,16 @@ int GUI_RPC_CONN::handle_rpc() { // get client version. not used for now // - parse_int(request_msg, "", client_version); + parse_int(request_msg, "", major_version); mf.printf( "\n" - "%d\n", - gstate.version() + "%d\n", + "%d\n" + "%d\n", + BOINC_MAJOR_VERSION, + BOINC_MINOR_VERSION, + BOINC_RELEASE ); if (match_tag(request_msg, "FrameShutdownDetected(); } -int CMainDocument::GetCoreClientVersion() { - return rpc.client_version; -} - - int CMainDocument::GetActivityRunMode(int& iMode) { int iRetVal = 0; diff --git a/clientgui/MainDocument.h b/clientgui/MainDocument.h index 57b1dd1dcc..2cc4e97432 100644 --- a/clientgui/MainDocument.h +++ b/clientgui/MainDocument.h @@ -106,7 +106,6 @@ public: int CachedStateUnlock(); int FrameShutdownDetected(); - int GetCoreClientVersion(); int CoreClientQuit(); int GetConnectedComputerName(wxString& strMachine); diff --git a/configure.ac b/configure.ac index 16ac6362e1..b1ace28ce3 100644 --- a/configure.ac +++ b/configure.ac @@ -9,7 +9,7 @@ dnl not sure exactly what the minimum version is (but 2.13 wont work) AC_PREREQ(2.57) dnl Set the BOINC version here. You can also use the set-version script. -AC_INIT(BOINC, 4.72) +AC_INIT(BOINC, 5.0.1) AC_ARG_ENABLE(debug, AS_HELP_STRING([--enable-debug], @@ -106,6 +106,7 @@ AC_DEFUN([KC_STRIP_LEADING_ZEROS],[m4_bregexp([$*],[^0*\(..*\)],\1)]) AC_DEFUN([BOINC_SET_VERSION],[dnl AC_SUBST([BOINC_MAJOR_VERSION],KC_STRIP_LEADING_ZEROS([$1])) AC_SUBST([BOINC_MINOR_VERSION],KC_STRIP_LEADING_ZEROS([$2])) +AC_SUBST([BOINC_RELEASE],KC_STRIP_LEADING_ZEROS([$3])) AC_SUBST([BOINC_VERSION_STRING],AC_PACKAGE_VERSION) ]) @@ -115,6 +116,7 @@ dnl Version information moved to version.h so removed from config.h dnl AC_DEFINE_UNQUOTED([BOINC_VERSION_STRING], "$BOINC_VERSION_STRING", [String representation of BOINC version number]) dnl AC_DEFINE_UNQUOTED([BOINC_MAJOR_VERSION], $BOINC_MAJOR_VERSION, [Major part of BOINC version number]) dnl AC_DEFINE_UNQUOTED([BOINC_MINOR_VERSION], $BOINC_MINOR_VERSION, [Minor part of BOINC version number]) +dnl AC_DEFINE_UNQUOTED([BOINC_RELEASE], $BOINC_RELEASE, [Release part of BOINC version number]) dnl Need to duplicate these AC_SUBST because some versions of autoconf wont dnl find AC_SUBST in a macro unless subsequently used in a DEFINE or SUBST diff --git a/doc/boinc_version.php b/doc/boinc_version.php index c14c8dfa2b..0628dbf92c 100755 --- a/doc/boinc_version.php +++ b/doc/boinc_version.php @@ -17,30 +17,9 @@ in which version mismatches could cause problems:

-Each BOINC software component has a version number -of the form 100*X + Y, -where X and Y are the major and minor versions. - -

-In general, all the parts of a BOINC system must -have the same major version. -A core client can interact with servers, -and can execute applications, -only if they have the same major version. - -

-Major-version changes to the BOINC software will require -that all projects update their server software (and databases) -and that all participants update their core client software on all hosts. -This doesn't have to happen all at once, -but in the midst of the crossover -some clients won't be able to access some servers. - -

-When a project makes a major-version change in its server software, -it may need to create new versions of its applications. -It must invalidate (by incrementing min_version) -all app versions that are incompatible with the new server software. +Each BOINC software component has a version +consisting of three integers: +major, minor, and release.

When a participant updates the core client, diff --git a/doc/build_system.php b/doc/build_system.php index 7026956a31..ca7a9c51a5 100644 --- a/doc/build_system.php +++ b/doc/build_system.php @@ -179,9 +179,9 @@ AC_CONFIG_FILES directive in configure.ac.

Version number

-To set the BOINC client version number: +To set the BOINC client version:
-  set-version 7.17
+  set-version 7.17.56
 
in the BOINC top-level source directory. This updates the AC_INIT line in diff --git a/lib/app_ipc.C b/lib/app_ipc.C index e21e653bc6..4b60137fec 100755 --- a/lib/app_ipc.C +++ b/lib/app_ipc.C @@ -78,7 +78,15 @@ void APP_INIT_DATA::copy(const APP_INIT_DATA& a) { int write_init_data_file(FILE* f, APP_INIT_DATA& ai) { string str1, str2; - fprintf(f, "\n%d\n", ai.core_version); + fprintf(f, + "\n" + "%d\n" + "%d\n" + "%d\n", + ai.major_version, + ai.minor_version, + ai.release + ); if (strlen(ai.app_name)) { fprintf(f, "%s\n", ai.app_name); } @@ -172,7 +180,9 @@ int parse_init_data_file(FILE* f, APP_INIT_DATA& ai) { ai.host_info.parse(mf); continue; } - else if (parse_int(buf, "", ai.core_version)) continue; + else if (parse_int(buf, "", ai.major_version)) continue; + else if (parse_int(buf, "", ai.minor_version)) continue; + else if (parse_int(buf, "", ai.release)) continue; else if (parse_str(buf, "", ai.app_name, sizeof(ai.app_name))) continue; else if (parse_str(buf, "", ai.user_name, sizeof(ai.user_name))) continue; else if (parse_str(buf, "", ai.team_name, sizeof(ai.team_name))) continue; diff --git a/lib/app_ipc.h b/lib/app_ipc.h index abdd9a2cd4..47fa5c3a32 100755 --- a/lib/app_ipc.h +++ b/lib/app_ipc.h @@ -156,7 +156,9 @@ public: // parsed version of main init file // struct APP_INIT_DATA { - int core_version; + int major_version; + int minor_version; + int release; char app_name[256]; char* project_preferences; int userid; diff --git a/lib/gui_rpc_client.C b/lib/gui_rpc_client.C index 8823e157a9..b7605e7a73 100644 --- a/lib/gui_rpc_client.C +++ b/lib/gui_rpc_client.C @@ -49,13 +49,10 @@ using std::string; using std::vector; -RPC_CLIENT::RPC_CLIENT() { - client_version = 0; -} +RPC_CLIENT::RPC_CLIENT() {} RPC_CLIENT::~RPC_CLIENT() { close(); - client_version = 0; } // if any RPC returns ERR_READ or ERR_WRITE, @@ -216,13 +213,6 @@ int RPC_CLIENT::authorize(const char* passwd) { retval = rpc.do_rpc("\n"); if (retval) return retval; while (rpc.fin.fgets(buf, 256)) { - if (parse_int(buf, "", client_version)) { - // core clients earlier than 4.30 don't do password authentication - // - if (client_version < 430) { - return 0; - } - } if (parse_str(buf, "", nonce, sizeof(nonce))) { found = true; } @@ -249,10 +239,14 @@ int RPC_CLIENT::send_request(const char* p) { char buf[4096]; sprintf(buf, "\n" - " %d\n" + " %d\n" + " %d\n" + " %d\n" "%s" "\n\003", - BOINC_MAJOR_VERSION*100 + BOINC_MINOR_VERSION, + BOINC_MAJOR_VERSION, + BOINC_MINOR_VERSION, + BOINC_RELEASE, p ); int n = send(sock, buf, strlen(buf), 0); diff --git a/lib/gui_rpc_client.h b/lib/gui_rpc_client.h index c1a0842b46..66bf001bce 100644 --- a/lib/gui_rpc_client.h +++ b/lib/gui_rpc_client.h @@ -490,7 +490,9 @@ struct LOOKUP_WEBSITE { class RPC_CLIENT { public: int sock; - int client_version; + int client_major_version; + int client_minor_version; + int client_release; bool tried_alt_port; double start_time; double timeout; diff --git a/lib/gui_rpc_client_ops.C b/lib/gui_rpc_client_ops.C index f9f957eb59..209322f96f 100644 --- a/lib/gui_rpc_client_ops.C +++ b/lib/gui_rpc_client_ops.C @@ -855,7 +855,9 @@ int RPC_CLIENT::get_state(CC_STATE& state) { int retval; state.clear(); - client_version = 0; + client_major_version = 0; + client_minor_version = 0; + client_release = 0; retval = rpc.do_rpc("\n"); if (retval) return retval; @@ -865,7 +867,9 @@ int RPC_CLIENT::get_state(CC_STATE& state) { return ERR_AUTHENTICATOR; } if (match_tag(buf, "")) break; - else if (parse_int(buf, "", client_version)) continue; + else if (parse_int(buf, "", client_major_version)) continue; + else if (parse_int(buf, "", client_minor_version)) continue; + else if (parse_int(buf, "", client_release)) continue; else if (match_tag(buf, "")) { project = new PROJECT(); project->parse(rpc.fin); diff --git a/sched/server_types.C b/sched/server_types.C index f64602ae69..0b7efc3e0c 100644 --- a/sched/server_types.C +++ b/sched/server_types.C @@ -105,6 +105,7 @@ int SCHEDULER_REQUEST::parse(FILE* fin) { hostid = 0; core_client_major_version = 0; core_client_minor_version = 0; + core_client_release = 0; rpc_seqno = 0; work_req_seconds = 0; resource_share_fraction = 1.0; @@ -139,6 +140,7 @@ int SCHEDULER_REQUEST::parse(FILE* fin) { } else if (parse_int(buf, "", core_client_major_version)) continue; else if (parse_int(buf, "", core_client_minor_version)) continue; + else if (parse_int(buf, "", core_client_release)) continue; else if (parse_double(buf, "", work_req_seconds)) continue; else if (parse_double(buf, "", resource_share_fraction)) continue; else if (parse_double(buf, "", estimated_delay)) continue; @@ -246,6 +248,7 @@ int SCHEDULER_REQUEST::write(FILE* fout) { " %d\n" " %d\n" " %d\n" + " %d\n" " %d\n" " %.15f\n" " %.15f\n" @@ -260,6 +263,7 @@ int SCHEDULER_REQUEST::write(FILE* fout) { hostid, core_client_major_version, core_client_minor_version, + core_client_release, rpc_seqno, work_req_seconds, resource_share_fraction, diff --git a/sched/server_types.h b/sched/server_types.h index c4e9bf52f8..08a8ef67c8 100644 --- a/sched/server_types.h +++ b/sched/server_types.h @@ -111,6 +111,7 @@ struct SCHEDULER_REQUEST { int hostid; // zero if first RPC int core_client_major_version; int core_client_minor_version; + int core_client_release; int rpc_seqno; double work_req_seconds; // in "normalized CPU seconds" (see work_req.php) diff --git a/sea/Makefile.am b/sea/Makefile.am index b989213059..601b6e0cfa 100644 --- a/sea/Makefile.am +++ b/sea/Makefile.am @@ -1,6 +1,6 @@ EXTRA_DIST = make-sea.sh -vers = @BOINC_MAJOR_VERSION@.@BOINC_MINOR_VERSION@_@target@ +vers = @BOINC_MAJOR_VERSION@.@BOINC_MINOR_VERSION@.@BOINC_RELEASE@_@target@ sea = boinc_$(vers).sh tarfiles = BOINC/boinc BOINC/boincmgr BOINC/boinc_cmd BOINC/binstall.sh\ BOINC/boincmgr.8x8.png BOINC/boincmgr.16x16.png BOINC/boincmgr.32x32.png diff --git a/version.h b/version.h index 55cc6bd92b..372539c575 100644 --- a/version.h +++ b/version.h @@ -4,13 +4,16 @@ #define BOINC_VERSION_H /* Major part of BOINC version number */ -#define BOINC_MAJOR_VERSION 4 +#define BOINC_MAJOR_VERSION 5 /* Minor part of BOINC version number */ -#define BOINC_MINOR_VERSION 72 +#define BOINC_MINOR_VERSION 0 + +/* Release part of BOINC version number */ +#define BOINC_RELEASE 1 /* String representation of BOINC version number */ -#define BOINC_VERSION_STRING "4.72" +#define BOINC_VERSION_STRING "5.0.1" #if (defined(_WIN32) || defined(__APPLE__)) /* Name of package */ @@ -23,13 +26,13 @@ #define PACKAGE_NAME "BOINC" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "BOINC 4.72" +#define PACKAGE_STRING "BOINC 5.0.1" /* Define to the one symbol short name of this package. */ #define PACKAGE_TARNAME "boinc" /* Define to the version of this package. */ -#define PACKAGE_VERSION "4.72" +#define PACKAGE_VERSION "5.0.1" #endif /* #if (defined(_WIN32) || defined(__APPLE__)) */ diff --git a/version.h.in b/version.h.in index f6cd4e1fc1..ebafdb83f3 100644 --- a/version.h.in +++ b/version.h.in @@ -9,6 +9,9 @@ /* Minor part of BOINC version number */ #define BOINC_MINOR_VERSION @BOINC_MINOR_VERSION@ +/* Release part of BOINC version number */ +#define BOINC_RELEASE @BOINC_RELEASE@ + /* String representation of BOINC version number */ #define BOINC_VERSION_STRING "@BOINC_VERSION_STRING@"