aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Framework/Servers/BaseOpenSimServer.cs68
1 files changed, 46 insertions, 22 deletions
diff --git a/OpenSim/Framework/Servers/BaseOpenSimServer.cs b/OpenSim/Framework/Servers/BaseOpenSimServer.cs
index d2193ca..2a97528 100644
--- a/OpenSim/Framework/Servers/BaseOpenSimServer.cs
+++ b/OpenSim/Framework/Servers/BaseOpenSimServer.cs
@@ -76,7 +76,7 @@ namespace OpenSim.Framework.Servers
76 protected string m_startupDirectory = Environment.CurrentDirectory; 76 protected string m_startupDirectory = Environment.CurrentDirectory;
77 77
78 /// <summary> 78 /// <summary>
79 /// Server version information. Usually VersionInfo + information about svn revision, operating system, etc. 79 /// Server version information. Usually VersionInfo + information about git commit, operating system, etc.
80 /// </summary> 80 /// </summary>
81 protected string m_version; 81 protected string m_version;
82 82
@@ -422,6 +422,16 @@ namespace OpenSim.Framework.Servers
422 { 422 {
423 string buildVersion = string.Empty; 423 string buildVersion = string.Empty;
424 424
425 // Add commit hash and date information if available
426 // The commit hash and date are stored in a file bin/.version
427 // This file can automatically created by a post
428 // commit script in the opensim git master repository or
429 // by issuing the follwoing command from the top level
430 // directory of the opensim repository
431 // git log -n 1 --pretty="format:%h: %ci" >bin/.version
432 // For the full git commit hash use %H instead of %h
433 //
434 // The subversion information is deprecated and will be removed at a later date
425 // Add subversion revision information if available 435 // Add subversion revision information if available
426 // Try file "svn_revision" in the current directory first, then the .svn info. 436 // Try file "svn_revision" in the current directory first, then the .svn info.
427 // This allows to make the revision available in simulators not running from the source tree. 437 // This allows to make the revision available in simulators not running from the source tree.
@@ -429,39 +439,53 @@ namespace OpenSim.Framework.Servers
429 // elsewhere as well 439 // elsewhere as well
430 string svnRevisionFileName = "svn_revision"; 440 string svnRevisionFileName = "svn_revision";
431 string svnFileName = ".svn/entries"; 441 string svnFileName = ".svn/entries";
442 string gitCommitFileName = ".version";
432 string inputLine; 443 string inputLine;
433 int strcmp; 444 int strcmp;
434 445
435 if (File.Exists(svnRevisionFileName)) 446 if (File.Exists( gitCommitFileName))
436 { 447 {
437 StreamReader RevisionFile = File.OpenText(svnRevisionFileName); 448 StreamReader CommitFile = File.OpenText(gitCommitFileName);
438 buildVersion = RevisionFile.ReadLine(); 449 buildVersion = Environment.NewLine + "git# " + CommitFile.ReadLine();
439 buildVersion.Trim(); 450 CommitFile.Close();
440 RevisionFile.Close(); 451 m_version += buildVersion ?? "";
441 } 452 }
442 453
443 if (string.IsNullOrEmpty(buildVersion) && File.Exists(svnFileName)) 454 // Remove the else logic when subversion mirror is no longer used
455 else
444 { 456 {
445 StreamReader EntriesFile = File.OpenText(svnFileName); 457 if (File.Exists(svnRevisionFileName))
446 inputLine = EntriesFile.ReadLine();
447 while (inputLine != null)
448 { 458 {
449 // using the dir svn revision at the top of entries file 459 StreamReader RevisionFile = File.OpenText(svnRevisionFileName);
450 strcmp = String.Compare(inputLine, "dir"); 460 buildVersion = RevisionFile.ReadLine();
451 if (strcmp == 0) 461 buildVersion.Trim();
452 { 462 RevisionFile.Close();
453 buildVersion = EntriesFile.ReadLine(); 463
454 break; 464 }
455 } 465
456 else 466 if (string.IsNullOrEmpty(buildVersion) && File.Exists(svnFileName))
467 {
468 StreamReader EntriesFile = File.OpenText(svnFileName);
469 inputLine = EntriesFile.ReadLine();
470 while (inputLine != null)
457 { 471 {
458 inputLine = EntriesFile.ReadLine(); 472 // using the dir svn revision at the top of entries file
473 strcmp = String.Compare(inputLine, "dir");
474 if (strcmp == 0)
475 {
476 buildVersion = EntriesFile.ReadLine();
477 break;
478 }
479 else
480 {
481 inputLine = EntriesFile.ReadLine();
482 }
459 } 483 }
484 EntriesFile.Close();
460 } 485 }
461 EntriesFile.Close();
462 }
463 486
464 m_version += string.IsNullOrEmpty(buildVersion) ? " " : ("." + buildVersion + " ").Substring(0, 6); 487 m_version += string.IsNullOrEmpty(buildVersion) ? " " : ("." + buildVersion + " ").Substring(0, 6);
488 }
465 } 489 }
466 490
467 protected void CreatePIDFile(string path) 491 protected void CreatePIDFile(string path)