versions are major/minor/release

svn path=/trunk/boinc/; revision=7614
This commit is contained in:
David Anderson 2005-08-31 00:18:36 +00:00
parent 259eb36fcf
commit 99c9679b63
23 changed files with 126 additions and 80 deletions

View File

@ -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 <core_client_release> element to state file,
scheduler RPC requests, file upload handler requests.
- GUI RPC requests now have major/minor/release instead of <version>
- 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

View File

@ -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);

View File

@ -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;

View File

@ -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();

View File

@ -1292,9 +1292,10 @@ int RESULT::write(MIOFILE& out, bool to_server) {
out.printf("<stderr_out>\n");
if (to_server) {
out.printf(
"<core_client_version>%d.%.2d</core_client_version>\n",
"<core_client_version>%d.%d.%d</core_client_version>\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());

View File

@ -237,6 +237,7 @@ int CLIENT_STATE::make_scheduler_request(PROJECT* p) {
" <platform_name>%s</platform_name>\n"
" <core_client_major_version>%d</core_client_major_version>\n"
" <core_client_minor_version>%d</core_client_minor_version>\n"
" <core_client_release>%d</core_client_release>\n"
" <work_req_seconds>%f</work_req_seconds>\n"
" <resource_share_fraction>%f</resource_share_fraction>\n"
" <estimated_delay>%f</estimated_delay>\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),

View File

@ -82,9 +82,10 @@ int FILE_XFER::init_upload(FILE_INFO& file_info) {
"<data_server_request>\n"
" <core_client_major_version>%d</core_client_major_version>\n"
" <core_client_minor_version>%d</core_client_minor_version>\n"
" <core_client_release>%d</core_client_release>\n"
" <get_file_size>%s</get_file_size>\n"
"</data_server_request>\n",
BOINC_MAJOR_VERSION, BOINC_MINOR_VERSION,
BOINC_MAJOR_VERSION, BOINC_MINOR_VERSION, BOINC_RELEASE,
file_info.name
);
file_size_query = true;

View File

@ -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, "<version>", client_version);
parse_int(request_msg, "<major_version>", major_version);
mf.printf(
"<boinc_gui_rpc_reply>\n"
"<client_version>%d</client_version>\n",
gstate.version()
"<major_version>%d</major_version>\n",
"<minor_version>%d</minor_version>\n"
"<release>%d</release>\n",
BOINC_MAJOR_VERSION,
BOINC_MINOR_VERSION,
BOINC_RELEASE
);
if (match_tag(request_msg, "<auth1")) {
handle_auth1(mf);

View File

@ -419,11 +419,6 @@ int CMainDocument::FrameShutdownDetected() {
return m_pNetworkConnection->FrameShutdownDetected();
}
int CMainDocument::GetCoreClientVersion() {
return rpc.client_version;
}
int CMainDocument::GetActivityRunMode(int& iMode) {
int iRetVal = 0;

View File

@ -106,7 +106,6 @@ public:
int CachedStateUnlock();
int FrameShutdownDetected();
int GetCoreClientVersion();
int CoreClientQuit();
int GetConnectedComputerName(wxString& strMachine);

View File

@ -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

View File

@ -17,30 +17,9 @@ in which version mismatches could cause problems:
</ul>
<p>
Each BOINC software component has a version number
of the form 100*X + Y,
where X and Y are the major and minor versions.
<p>
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.
<p>
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.
<p>
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.
<p>
When a participant updates the core client,

View File

@ -179,9 +179,9 @@ AC_CONFIG_FILES directive in <code>configure.ac</code>.
</ul>
<h2>Version number</h2>
To set the BOINC client version number:
To set the BOINC client version:
<pre>
set-version 7.17
set-version 7.17.56
</pre>
in the BOINC top-level source directory. This updates
the <code>AC_INIT</code> line in

View File

@ -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, "<app_init_data>\n<core_version>%d</core_version>\n", ai.core_version);
fprintf(f,
"<app_init_data>\n"
"<major_version>%d</major_version>\n"
"<minor_version>%d</minor_version>\n"
"<release>%d</release>\n",
ai.major_version,
ai.minor_version,
ai.release
);
if (strlen(ai.app_name)) {
fprintf(f, "<app_name>%s</app_name>\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, "<core_version>", ai.core_version)) continue;
else if (parse_int(buf, "<major_version>", ai.major_version)) continue;
else if (parse_int(buf, "<minor_version>", ai.minor_version)) continue;
else if (parse_int(buf, "<release>", ai.release)) continue;
else if (parse_str(buf, "<app_name>", ai.app_name, sizeof(ai.app_name))) continue;
else if (parse_str(buf, "<user_name>", ai.user_name, sizeof(ai.user_name))) continue;
else if (parse_str(buf, "<team_name>", ai.team_name, sizeof(ai.team_name))) continue;

View File

@ -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;

View File

@ -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("<auth1/>\n");
if (retval) return retval;
while (rpc.fin.fgets(buf, 256)) {
if (parse_int(buf, "<client_version>", client_version)) {
// core clients earlier than 4.30 don't do password authentication
//
if (client_version < 430) {
return 0;
}
}
if (parse_str(buf, "<nonce>", nonce, sizeof(nonce))) {
found = true;
}
@ -249,10 +239,14 @@ int RPC_CLIENT::send_request(const char* p) {
char buf[4096];
sprintf(buf,
"<boinc_gui_rpc_request>\n"
" <version>%d</version>\n"
" <major_version>%d</major_version>\n"
" <minor_version>%d</minor_version>\n"
" <release>%d</release>\n"
"%s"
"</boinc_gui_rpc_request>\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);

View File

@ -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;

View File

@ -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("<get_state/>\n");
if (retval) return retval;
@ -865,7 +867,9 @@ int RPC_CLIENT::get_state(CC_STATE& state) {
return ERR_AUTHENTICATOR;
}
if (match_tag(buf, "</client_state>")) break;
else if (parse_int(buf, "<client_version>", client_version)) continue;
else if (parse_int(buf, "<client_major_version>", client_major_version)) continue;
else if (parse_int(buf, "<client_minor_version>", client_minor_version)) continue;
else if (parse_int(buf, "<client_release>", client_release)) continue;
else if (match_tag(buf, "<project>")) {
project = new PROJECT();
project->parse(rpc.fin);

View File

@ -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>", core_client_major_version)) continue;
else if (parse_int(buf, "<core_client_minor_version>", core_client_minor_version)) continue;
else if (parse_int(buf, "<core_client_release>", core_client_release)) continue;
else if (parse_double(buf, "<work_req_seconds>", work_req_seconds)) continue;
else if (parse_double(buf, "<resource_share_fraction>", resource_share_fraction)) continue;
else if (parse_double(buf, "<estimated_delay>", estimated_delay)) continue;
@ -246,6 +248,7 @@ int SCHEDULER_REQUEST::write(FILE* fout) {
" <hostid>%d</hostid>\n"
" <core_client_major_version>%d</core_client_major_version>\n"
" <core_client_minor_version>%d</core_client_minor_version>\n"
" <core_client_release>%d</core_client_release>\n"
" <rpc_seqno>%d</rpc_seqno>\n"
" <work_req_seconds>%.15f</work_req_seconds>\n"
" <resource_share_fraction>%.15f</resource_share_fraction>\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,

View File

@ -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)

View File

@ -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

View File

@ -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__)) */

View File

@ -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@"