model_server/project_cm/src/mrg_group.cxx
// Copies into src_name the original source that last -proj pass built
// If there is no CM preference, or "no version" is stored in the PMOD,
// then the pset file source gets copied.
// Returns:  -1     - on failure to find source file
//            >=0   - succeeded
Copies into src_name the original source that last -proj pass built
If there is no CM preference, or "no version" is stored in the PMOD,
then the pset file source gets copied.
Returns:  -1     - on failure to find source file
>=0   - succeeded
Copies into src_name the original source that last - proj pass built If there is no CM preference or " no version " is stored in the PMOD then the pset file source gets copied . Returns : - 1 - on failure to find source file > = 0 - succeeded
int projModule_retrieve_built_source (projModule *mod, char const *src_name)
{
    Initialize(projModule_retrieve_built_source);
    int res = -1;
    if (!mod || !src_name || !src_name[0])
	return res;
    if (customize::no_cm() == false) {
	genString ver;
	projModule_get_built_revision (mod, ver);
	if (ver.length()) {
	    msg("$1module $2; modelbuild version is $3. Retrieving ...",
		    normal_sev)
		    << mrg_msg << eoarg
		    << mod->get_name() << eoarg
		    << (char const *)ver << eom;
	    res = projModule_retrieve_revision (mod, ver, src_name);
	    if (res == -1) {
		msg("$1module $2; failed to retrieve version $3", error_sev)
		    << mrg_msg << eoarg
		    << mod->get_name() << eoarg
		    << (char const *)ver << eom;
	    } else {
		msg("$1module $2; retrieved version $3", normal_sev)
		    << mrg_msg << eoarg
		    << mod->get_name() << eoarg
		    << (char const *)ver << eom;
	    }
	}
    }
    if (res == -1) {
	genString pset_file = mod->paraset_file_name ();
	if (pset_file.length() == 0)
	    pset_file = "<null>";
	else
	    res = db_read_src_from_pset (pset_file, src_name);
	if (res == -1) {
	    msg("$1module $2; failed to extract source code from .pset $3",
		error_sev)
		<< mrg_msg << eoarg
		<< mod->get_name() << eoarg
		<< (char const *)pset_file << eom;
	} else {
	    msg("$1module $2; extracted .pset file source", normal_sev)
		<< mrg_msg << eoarg
		<< mod->get_name() << eom;
	}
    }
    return res;
}
int projModule_retrieve_built_source ( projModule * mod , char const * src_name ) { Initialize ( projModule_retrieve_built_source ) ; int res = -1 ; if ( ! mod || ! src_name || ! src_name [ 0 ] ) return res ; if ( customize :: no_cm ( ) == false ) { genString ver ; projModule_get_built_revision ( mod , ver ) ; if ( ver . length ( ) ) { msg ( " " , normal_sev ) << mrg_msg << eoarg << mod -> get_name ( ) << eoarg << ( char const * ) ver << eom ; res = projModule_retrieve_revision ( mod , ver , src_name ) ; if ( res == -1 ) { msg ( " " , error_sev ) << mrg_msg << eoarg << mod -> get_name ( ) << eoarg << ( char const * ) ver << eom ; } else { msg ( " " , normal_sev ) << mrg_msg << eoarg << mod -> get_name ( ) << eoarg << ( char const * ) ver << eom ; } } } if ( res == -1 ) { genString pset_file = mod -> paraset_file_name ( ) ; if ( pset_file . length ( ) == 0 ) pset_file = " " ; else res = db_read_src_from_pset ( pset_file , src_name ) ; if ( res == -1 ) { msg ( " " , error_sev ) << mrg_msg << eoarg << mod -> get_name ( ) << eoarg << ( char const * ) pset_file << eom ; } else { msg ( " " , normal_sev ) << mrg_msg << eoarg << mod -> get_name ( ) << eom ; } } return res ; }
Copies into src_name the original source that last -proj pass built
If there is no CM preference, or "no version" is stored in the PMOD,
then the pset file source gets copied.
Copies into src_name the original source that last - proj pass built If there is no CM preference or " no version " is stored in the PMOD then the pset file source gets copied .