Changeset 2138 for trunk/source/version.h
- Timestamp:
- 06/29/08 08:53:10 (5 months ago)
- Files:
-
- 1 modified
-
trunk/source/version.h (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/version.h
r2052 r2138 12 12 static const int CLD_PATCH = 0; 13 13 14 #if 015 14 #ifdef SVN_REVISION 16 15 static const char* svn_revision = SVN_REVISION; 17 16 #else 18 static const char* svn_revision = " unknown";17 static const char* svn_revision = "????"; 19 18 #endif 20 19 21 20 static const string Url = "$HeadURL$"; 22 #endif23 21 24 22 static const char* CITATION = "Ferland, G. J., Korista, K. T., Verner, D. A., Ferguson, J. W., Kingdon, J. B., & Verner, E. M. 1998, PASP, 110, 761"; … … 35 33 { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" }; 36 34 37 #if 038 35 // first analyze the URL to determine where we live, the chVersion string is derived from that 39 36 // the code below is based on the following naming scheme: 40 37 // 41 // /branches/c0 8_branch -- release branch, all bug fixes are submitted here42 // 43 // /tags/develop/c0 8.01_rc1 -- release candidates go here44 // 45 // /tags/release/c0 8.01-- first official release46 // /tags/release/c0 8.02-- first bug-fix rollup, etc...47 // 48 // /tags/patch_versions/c0 8.01.00 -- identical to /tags/release/c08.0149 // /tags/patch_versions/c0 8.01.01 -- first patch update, etc...38 // /branches/c09_branch -- release branch, all bug fixes are submitted here 39 // 40 // /tags/develop/c09.00_rc1 -- release candidates go here 41 // 42 // /tags/release/c09.00 -- first official release 43 // /tags/release/c09.01 -- first bug-fix rollup, etc... 44 // 45 // /tags/patch_versions/c09.00.00 -- identical to /tags/release/c09.00 46 // /tags/patch_versions/c09.00.01 -- first patch update, etc... 50 47 // 51 48 // /trunk -- this will be labeled as "exprimental" … … 58 55 { 59 56 // the last two parts are "source" and "version.h $", we don't need them... 60 // the one before is the name of the branch (e.g. "trunk", "newmole", "c08.01") 57 // the one before is the relevant identifier (e.g. "trunk", "newmole", "c09.01") 58 // for conciseness we will refer to it below as the "branch" 61 59 string Branch = Part[Part.size()-3]; 62 60 … … 64 62 bool lgPatchTag = ( Url.find("/tags/patch_versions/") != string::npos ); 65 63 bool lgDevelopTag = ( Url.find("/tags/develop/") != string::npos ); 66 // this expects a branch name like "c0 8_branch"64 // this expects a branch name like "c09_branch" 67 65 bool lgReleaseBranch = ( Url.find("/branches/") != string::npos && 68 66 Branch.size() == 10 && Branch[0] == 'c' && … … 74 72 string::size_type ptr; 75 73 if( lgDevelopTag && ( ptr = Branch.find( "_rc" ) ) != string::npos ) 76 // this expects a branch name like "c0 8.01_rc1"74 // this expects a branch name like "c09.00_rc1" 77 75 sscanf( Branch.substr( ptr+3 ).c_str(), "%ld", &nBetaVer ); 78 76 else 79 77 nBetaVer = 0; 80 78 81 int nPatchLevel; 79 int nMajorLevel=0, nMinorLevel=0, nPatchLevel=0; 80 81 if( lgReleaseBranch || lgRelease || nBetaVer > 0 ) 82 { 83 // this expects a branch name starting with "c09" 84 sscanf( Branch.substr(1,2).c_str(), "%d", &nMajorLevel ); 85 if( nMajorLevel != CLD_MAJOR ) 86 fprintf( ioQQQ, "PROBLEM - CLD_MAJOR mismatch, please check version.h\n" ); 87 } 88 89 if( lgRelease || nBetaVer > 0 ) 90 { 91 // this expects a branch name starting with "c09.01" 92 sscanf( Branch.substr(4,2).c_str(), "%d", &nMinorLevel ); 93 if( nMinorLevel != CLD_MINOR ) 94 fprintf( ioQQQ, "PROBLEM - CLD_MINOR mismatch, please check version.h\n" ); 95 } 96 82 97 if( lgPatchTag ) 83 // this expects a branch name like "c08.01.02" 84 sscanf( Branch.substr( Branch.size()-2 ).c_str(), "%d", &nPatchLevel ); 85 else 86 nPatchLevel = 0; 98 { 99 // this expects a branch name like "c09.01.02" 100 sscanf( Branch.substr(7,2).c_str(), "%d", &nPatchLevel ); 101 if( nPatchLevel != CLD_PATCH ) 102 fprintf( ioQQQ, "PROBLEM - CLD_PATCH mismatch, please check version.h\n" ); 103 // c09.00.00 is identical to release c09.00, so pass it off as the latter... 104 if( nPatchLevel == 0 ) 105 lgReleaseTag = true; 106 } 87 107 88 108 if( lgReleaseTag ) 89 // this expects a branch name like "c0 8.01"90 strncpy( chVersion, Branch.substr(1 ).c_str(), INPUT_LINE_LENGTH );109 // this expects a branch name like "c09.01" 110 strncpy( chVersion, Branch.substr(1,5).c_str(), INPUT_LINE_LENGTH ); 91 111 else if( lgPatchTag ) 92 // this expects a branch name like "c0 8.01.02"112 // this expects a branch name like "c09.01.02" 93 113 sprintf( chVersion, "%s (patch level %d)", Branch.substr(1,5).c_str(), nPatchLevel ); 94 114 else if( nBetaVer > 0 ) 95 // this expects a branch name like "c0 8.01_rc1"115 // this expects a branch name like "c09.00_rc1" 96 116 sprintf( chVersion, "%s beta %ld (prerelease)", Branch.substr(1,5).c_str(), nBetaVer ); 97 117 else if( lgReleaseBranch ) 98 // this expects a branch name like "c0 8_branch"99 sprintf( chVersion, "(prerelease, %s, ver.%s)", Branch.c_str(), svn_revision );118 // this expects a branch name like "c09_branch" 119 sprintf( chVersion, "(prerelease, %s, r%s)", Branch.c_str(), svn_revision ); 100 120 else 101 121 // the branch name can be anything except "c??_branch" 102 sprintf( chVersion, "(experimental, %s, ver.%s)", Branch.c_str(), svn_revision );122 sprintf( chVersion, "(experimental, %s, r%s)", Branch.c_str(), svn_revision ); 103 123 } 104 124 else … … 109 129 lgRelease = false; 110 130 111 /* is this a beta version? 0 for no */ 131 /* is this a beta version? 0 for no 132 * if this is non-zero then lgRelease above should be false */ 112 133 nBetaVer = 0; 113 134 114 sprintf( chVersion, "%2.2i%2.2i%2.2i", YEAR%100, MONTH+1, DAY ); 135 if( lgRelease ) 136 { 137 if( CLD_PATCH > 0 ) 138 sprintf( chVersion, "%2.2i.%2.2i (patch level %d)", 139 CLD_MAJOR, CLD_MINOR, CLD_PATCH ); 140 else 141 sprintf( chVersion, "%2.2i.%2.2i", CLD_MAJOR, CLD_MINOR ); 142 } 143 else if( nBetaVer > 0 ) 144 { 145 sprintf( chVersion, "%2.2i.%2.2i beta %ld (prerelease)", 146 CLD_MAJOR, CLD_MINOR, nBetaVer ); 147 } 148 else 149 { 150 sprintf( chVersion, "%2.2i.%2.2i.%2.2i", YEAR%100, MONTH+1, DAY ); 151 } 115 152 } 116 #else117 /* is this a release version? */118 lgRelease = false;119 120 /* is this a beta version? 0 for no121 * if this is non-zero then lgRelease above should be false */122 nBetaVer = 0;123 124 if( lgRelease )125 {126 if( CLD_PATCH > 0 )127 sprintf( chVersion, "%2.2i.%2.2i (patch level %d)", CLD_MAJOR, CLD_MINOR, CLD_PATCH );128 else129 sprintf( chVersion, "%2.2i.%2.2i", CLD_MAJOR, CLD_MINOR );130 }131 else if( nBetaVer > 0 )132 {133 sprintf( chVersion, "%2.2i.%2.2i beta %ld (prerelease)", CLD_MAJOR, CLD_MINOR, nBetaVer );134 }135 else136 {137 sprintf( chVersion, "%2.2i.%2.2i.%2.2i", YEAR%100, MONTH+1, DAY );138 }139 #endif140 153 141 154 sprintf( chDate, "%2.2i%3.3s%2.2i", YEAR%100, chMonth[MONTH], DAY );
