Changeset 1896
- Timestamp:
- 03/30/08 16:05:35 (9 months ago)
- Location:
- trunk/source
- Files:
-
- 7 modified
-
assert_results.cpp (modified) (2 diffs)
-
Makefile (modified) (1 diff)
-
parse_commands.cpp (modified) (1 diff)
-
parse_print.cpp (modified) (1 diff)
-
prt_comment.cpp (modified) (1 diff)
-
punch_fits.cpp (modified) (3 diffs)
-
version.h (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/assert_results.cpp
r1891 r1896 2214 2214 if( called.lgTalk && nAsserts>0 ) 2215 2215 { 2216 char chVer[10];2217 2216 time_t now; 2218 cdVersion(chVer );2219 2217 2220 2218 /* First disambiguate any line identifications */ … … 2281 2279 2282 2280 /* write start of title and version number of code */ 2283 fprintf( ioASSERT, "=============Results of asserts: C %s ",chVer);2281 fprintf( ioASSERT, "=============Results of asserts: Cloudy %s ", version::Inst().chVersion ); 2284 2282 2285 2283 /* usually print date and time info - do not if "no times" command entered, -
trunk/source/Makefile
r1756 r1896 85 85 endif 86 86 87 SVNVER = ${shell which svnversion} 88 ifneq ($(SVNVER),) 89 REVISION = ${shell $(SVNVER) $(SRCDIR)} 90 else 91 REVISION = exported 92 endif 93 CXXFLAGS += -DSVN_REVISION=\"$(REVISION)\" 94 87 95 cloudy.exe : ${preobjects} maincl.o libcloudy.a 88 96 ${CXX} ${LDFLAGS} -o cloudy.exe maincl.o -L. -lcloudy ${LDLIBS} -
trunk/source/parse_commands.cpp
r1894 r1896 120 120 { 121 121 fprintf( ioQQQ, 122 "\n This is %s (beta %ld) of Cloudy, and is intended for testing only.\n\n", 123 version::Inst().chVersion, version::Inst().nBetaVer ); 122 "\n This is a beta release of Cloudy, and is intended for testing only.\n\n" ); 124 123 } 125 124 -
trunk/source/parse_print.cpp
r1891 r1896 95 95 { 96 96 /* print compiler and code version information */ 97 fprintf( ioQQQ, "\nThis is Cloudy , version%s\n%s\n\n" ,97 fprintf( ioQQQ, "\nThis is Cloudy %s\n%s\n\n" , 98 98 version::Inst().chVersion, 99 99 version::Inst().chInfo ); -
trunk/source/prt_comment.cpp
r1891 r1896 163 163 { 164 164 sprintf( chLine, 165 " !This is beta test version %4ld and is intended for testing only.",165 " !This is beta test version %ld and is intended for testing only.", 166 166 version::Inst().nBetaVer ); 167 167 bangin(chLine); -
trunk/source/punch_fits.cpp
r1891 r1896 725 725 STATIC void writeCloudyDetails( void ) 726 726 { 727 char chVer[10];728 727 char timeString[30]=""; 729 728 char tempString[70]; … … 731 730 long i, j, k; 732 731 733 cdVersion( chVer );734 735 732 /* usually print date and time info - do not if "no times" command entered, 736 733 * which set this flag false */ … … 752 749 } 753 750 754 strcpy( tempString, "Generated by Cloudy version" );755 strcat( tempString, chVer);751 strcpy( tempString, "Generated by Cloudy " ); 752 strcat( tempString, version::Inst().chVersion ); 756 753 bytesAdded += addComment( tempString ); 757 754 bytesAdded += addComment( version::Inst().chInfo ); -
trunk/source/version.h
r1891 r1896 8 8 #include "date.h" 9 9 10 static const int CLD_MAJOR = 8; 11 static const int CLD_MINOR = 1; 12 static const int CLD_PATCH = 0; 13 10 14 #if 0 11 static const int CLD_MAJOR = 8;12 static const int CLD_MINOR = 0;13 14 15 #ifdef SVN_REVISION 15 16 static const char* svn_revision = SVN_REVISION; … … 31 32 version() 32 33 { 33 /* set date and version - this code will need to be modified in the year 2100 */34 if( YEAR >= 200 )35 {36 fprintf(ioQQQ,"must update formation of chDate in cdInit \n");37 TotalInsanity();38 }39 40 34 static const char chMonth[12][4] = 41 35 { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" }; 42 36 37 #if 0 38 // first analyze the URL to determine where we live, the chVersion string is derived from that 39 // the code below is based on the following naming scheme: 40 // 41 // /branches/c08_branch -- release branch, all bug fixes are submitted here 42 // 43 // /tags/develop/c08.01_rc1 -- release candidates go here 44 // 45 // /tags/release/c08.01 -- first official release 46 // /tags/release/c08.02 -- first bug-fix rollup, etc... 47 // 48 // /tags/patch_versions/c08.01.00 -- identical to /tags/release/c08.01 49 // /tags/patch_versions/c08.01.01 -- first patch update, etc... 50 // 51 // /trunk -- this will be labeled as "exprimental" 52 // /tags/stable -- ditto 53 // /branches/* -- ditto, note that "*" can be anything except c??_branch 54 55 vector<string> Part; 56 Split( Url, "/", Part, SPM_RELAX ); 57 if( Part.size() >= 3 ) 58 { 59 // 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") 61 string Branch = Part[Part.size()-3]; 62 63 bool lgReleaseTag = ( Url.find("/tags/release/") != string::npos ); 64 bool lgPatchTag = ( Url.find("/tags/patch_versions/") != string::npos ); 65 bool lgDevelopTag = ( Url.find("/tags/develop/") != string::npos ); 66 // this expects a branch name like "c08_branch" 67 bool lgReleaseBranch = ( Url.find("/branches/") != string::npos && 68 Branch.size() == 10 && Branch[0] == 'c' && 69 Branch.find("_branch") != string::npos ); 70 71 lgRelease = ( lgReleaseTag || lgPatchTag ); 72 73 // determine if this is a beta version 74 string::size_type ptr; 75 if( lgDevelopTag && ( ptr = Branch.find( "_rc" ) ) != string::npos ) 76 // this expects a branch name like "c08.01_rc1" 77 sscanf( Branch.substr( ptr+3 ).c_str(), "%ld", &nBetaVer ); 78 else 79 nBetaVer = 0; 80 81 int nPatchLevel; 82 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; 87 88 if( lgReleaseTag ) 89 // this expects a branch name like "c08.01" 90 strncpy( chVersion, Branch.substr(1).c_str(), INPUT_LINE_LENGTH ); 91 else if( lgPatchTag ) 92 // this expects a branch name like "c08.01.02" 93 sprintf( chVersion, "%s (patch level %d)", Branch.substr(1,5).c_str(), nPatchLevel ); 94 else if( nBetaVer > 0 ) 95 // this expects a branch name like "c08.01_rc1" 96 sprintf( chVersion, "%s beta %ld (prerelease)", Branch.substr(1,5).c_str(), nBetaVer ); 97 else if( lgReleaseBranch ) 98 // this expects a branch name like "c08_branch" 99 sprintf( chVersion, "(prerelease, %s, ver. %s)", Branch.c_str(), svn_revision ); 100 else 101 // the branch name can be anything except "c??_branch" 102 sprintf( chVersion, "(experimental, %s, ver. %s)", Branch.c_str(), svn_revision ); 103 } 104 else 105 { 106 // create a default version string in case HeadURL was not expanded 107 108 /* is this a release version? */ 109 lgRelease = false; 110 111 /* is this a beta version? 0 for no */ 112 nBetaVer = 0; 113 114 sprintf( chVersion, "%2.2i%2.2i%2.2i", YEAR%100, MONTH+1, DAY ); 115 } 116 #else 117 /* is this a release version? */ 118 lgRelease = false; 119 43 120 /* is this a beta version? 0 for no */ 44 121 nBetaVer = 0; 45 46 /* is this a release version? */47 lgRelease = false;48 49 sprintf( chDate, "%2.2i%3.3s%2.2i",50 YEAR-100,51 chMonth[MONTH],52 DAY );53 122 54 sprintf( chVersion, "%2.2i.%2.2i.%2.2i", 55 YEAR-100, 56 MONTH+1, 57 DAY ); 58 123 if( lgRelease ) 124 { 125 if( CLD_PATCH > 0 ) 126 sprintf( chVersion, "%2.2i.%2.2i (patch level %d)", CLD_MAJOR, CLD_MINOR, CLD_PATCH ); 127 else 128 sprintf( chVersion, "%2.2i.%2.2i", CLD_MAJOR, CLD_MINOR ); 129 } 130 else if( nBetaVer > 0 ) 131 { 132 sprintf( chVersion, "%2.2i.%2.2i beta %ld (prerelease)", CLD_MAJOR, CLD_MINOR, nBetaVer ); 133 } 134 else 135 { 136 sprintf( chVersion, "%2.2i.%2.2i.%2.2i", YEAR%100, MONTH+1, DAY ); 137 } 138 #endif 139 140 sprintf( chDate, "%2.2i%3.3s%2.2i", YEAR%100, chMonth[MONTH], DAY ); 141 59 142 char mode[6]; 60 143 if( sizeof(long) == 4 ) … … 64 147 else 65 148 strncpy( mode, "?????", 6 ); 66 149 67 150 /* now generate info on how we were compiled, including compiler version */ 68 sprintf( chInfo ,69 "cdInit compiled on %s in OS %s using the %s %i compiler in %s mode.",70 __DATE__ ,__OS , __COMP , __COMP_VER, mode);151 sprintf( chInfo, 152 "cdInit compiled on %s in OS %s using the %s %i compiler in %s mode.", 153 __DATE__, __OS, __COMP, __COMP_VER, mode ); 71 154 72 155 chCitation = CITATION; … … 75 158 } 76 159 public: 77 /** date of this version of the code as a string, set in cdinit.c, 78 * where space is allocated */ 160 /** date of this version of the code as a string */ 79 161 char chDate[INPUT_LINE_LENGTH]; 80 162 81 /** version number of this version of the code, as a string, set in cdinit.c 82 * where space is allocated */ 163 /** version string of this version of the code */ 83 164 char chVersion[INPUT_LINE_LENGTH]; 84 165 … … 86 167 long int nBetaVer; 87 168 88 /* is this a release version? if so do not print some internal comments */169 /** is this a release version? if so do not print some internal comments */ 89 170 bool lgRelease; 90 171 … … 103 184 }; 104 185 105 106 186 #endif /* _VERSION_H_ */
