diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs index bae1bdd..d21efed 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs | |||
@@ -172,7 +172,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
172 | m_log.InfoFormat("[ARCHIVER]: Creating archive file. This may take some time."); | 172 | m_log.InfoFormat("[ARCHIVER]: Creating archive file. This may take some time."); |
173 | 173 | ||
174 | // Write out control file | 174 | // Write out control file |
175 | archiveWriter.WriteFile(ArchiveConstants.CONTROL_FILE_PATH, Create0p2ControlFile()); | 175 | archiveWriter.WriteFile(ArchiveConstants.CONTROL_FILE_PATH, Create0p2ControlFile(options)); |
176 | m_log.InfoFormat("[ARCHIVER]: Added control file to archive."); | 176 | m_log.InfoFormat("[ARCHIVER]: Added control file to archive."); |
177 | 177 | ||
178 | new AssetsRequest( | 178 | new AssetsRequest( |
@@ -184,15 +184,33 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
184 | /// Create the control file for the most up to date archive | 184 | /// Create the control file for the most up to date archive |
185 | /// </summary> | 185 | /// </summary> |
186 | /// <returns></returns> | 186 | /// <returns></returns> |
187 | public static string Create0p2ControlFile() | 187 | public static string Create0p2ControlFile(Dictionary<string, object> options) |
188 | { | 188 | { |
189 | int majorVersion, minorVersion; | ||
190 | if (options.ContainsKey("version") && (string)options["version"] == "0") | ||
191 | { | ||
192 | majorVersion = 0; | ||
193 | minorVersion = 3; | ||
194 | } | ||
195 | else | ||
196 | { | ||
197 | majorVersion = 1; | ||
198 | minorVersion = 0; | ||
199 | } | ||
200 | |||
201 | m_log.InfoFormat("[ARCHIVER]: Creating version {0}.{1} OAR", majorVersion, minorVersion); | ||
202 | if (majorVersion == 1) | ||
203 | { | ||
204 | m_log.WarnFormat("[ARCHIVER]: Please be aware that version 1.0 OARs are not compatible with OpenSim 0.7.0.2 and earlier. Please use the --version=0 option if you want to produce a compatible OAR"); | ||
205 | } | ||
206 | |||
189 | StringWriter sw = new StringWriter(); | 207 | StringWriter sw = new StringWriter(); |
190 | XmlTextWriter xtw = new XmlTextWriter(sw); | 208 | XmlTextWriter xtw = new XmlTextWriter(sw); |
191 | xtw.Formatting = Formatting.Indented; | 209 | xtw.Formatting = Formatting.Indented; |
192 | xtw.WriteStartDocument(); | 210 | xtw.WriteStartDocument(); |
193 | xtw.WriteStartElement("archive"); | 211 | xtw.WriteStartElement("archive"); |
194 | xtw.WriteAttributeString("major_version", "0"); | 212 | xtw.WriteAttributeString("major_version", majorVersion.ToString()); |
195 | xtw.WriteAttributeString("minor_version", "3"); | 213 | xtw.WriteAttributeString("minor_version", minorVersion.ToString()); |
196 | 214 | ||
197 | xtw.WriteStartElement("creation_info"); | 215 | xtw.WriteStartElement("creation_info"); |
198 | DateTime now = DateTime.UtcNow; | 216 | DateTime now = DateTime.UtcNow; |