Ticket #1527: 1527_ckreleaser.patch
File 1527_ckreleaser.patch, 1.9 KB (added by , 15 years ago) |
---|
-
_source/includes/releaser.js
223 223 var regexLib = 224 224 { 225 225 packagerRemove : Pattern.compile( '(?m-s:^.*?%REMOVE_START%).*?(?m-s:%REMOVE_END%.*?$)', Pattern.DOTALL ), 226 packagerRemoveLine : Pattern.compile( '.*%REMOVE_LINE%.*(?:\\r\\n|\\r|\\n)?' ) 226 packagerRemoveLine : Pattern.compile( '.*%REMOVE_LINE%.*(?:\\r\\n|\\r|\\n)?' ), 227 packagerRev : Pattern.compile( '.*Revision: (\\d+).*', Pattern.DOTALL ) 227 228 }; 228 229 229 230 /* 230 231 * %VERSION%: 231 232 * the "version" string passed to the CKReleaser execution command. 233 * %REVISION%: 234 * the SVN revision number of the source directory. 232 235 * %TIMESTAMP%: 233 236 * a four characters string containing the 234 237 * concatenation of the "Base 36" value of each of the following components … … 249 252 text = text.replace( /%VERSION%/g, CKRELEASER.version ); 250 253 replaced = true; 251 254 } 255 if ( text.indexOf( "%REVISION%" ) != -1 ) 256 { 257 var o = 258 { 259 output : "" 260 }; 261 262 runCommand( "svn", "info", CKRELEASER.sourceDir, o ); 263 264 if ( o.output.indexOf( "Revision:" ) != -1 ) 265 { 266 var rev = regexLib.packagerRev.matcher( o.output ).replaceAll( '$1' ); 267 text = text.replace( /%REVISION%/g, rev ); 268 } 269 else 270 { 271 if ( o.output.indexOf( "not a working" ) != -1 ) 272 print( "WARNING: Unable to fetch the revision number, source directory is not under version control: " 273 + CKRELEASER.sourceDir ); 274 else 275 print( "WARNING: Unable to fetch the revision number, make sure that Subversions bin directory is in your system path." ); 276 text = text.replace( /%REVISION%/g, "UNKNOWN" ); 277 } 278 279 replaced = true; 280 } 252 281 if ( text.indexOf( "%TIMESTAMP%" ) != -1 ) 253 282 { 254 283 text = text.replace( /%TIMESTAMP%/g, CKRELEASER.timestamp );