diff options
Diffstat (limited to 'OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs')
-rw-r--r-- | OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs index bae5a7a..9080e1c 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs | |||
@@ -123,9 +123,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
123 | 123 | ||
124 | try | 124 | try |
125 | { | 125 | { |
126 | // We're almost done. Just need to write out the control file now | ||
127 | m_archiveWriter.WriteFile(ArchiveConstants.CONTROL_FILE_PATH, Create0p1ControlFile()); | ||
128 | m_log.InfoFormat("[ARCHIVER]: Added control file to archive."); | ||
129 | m_archiveWriter.Close(); | 126 | m_archiveWriter.Close(); |
130 | } | 127 | } |
131 | catch (Exception e) | 128 | catch (Exception e) |
@@ -277,6 +274,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
277 | 274 | ||
278 | m_archiveWriter = new TarArchiveWriter(m_saveStream); | 275 | m_archiveWriter = new TarArchiveWriter(m_saveStream); |
279 | 276 | ||
277 | // Write out control file. This has to be done first so that subsequent loaders will see this file first | ||
278 | // XXX: I know this is a weak way of doing it since external non-OAR aware tar executables will not do this | ||
279 | m_archiveWriter.WriteFile(ArchiveConstants.CONTROL_FILE_PATH, Create0p1ControlFile()); | ||
280 | m_log.InfoFormat("[INVENTORY ARCHIVER]: Added control file to archive."); | ||
281 | |||
280 | if (inventoryFolder != null) | 282 | if (inventoryFolder != null) |
281 | { | 283 | { |
282 | m_log.DebugFormat( | 284 | m_log.DebugFormat( |
@@ -399,13 +401,17 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
399 | /// <returns></returns> | 401 | /// <returns></returns> |
400 | public static string Create0p1ControlFile() | 402 | public static string Create0p1ControlFile() |
401 | { | 403 | { |
404 | int majorVersion = 0, minorVersion = 1; | ||
405 | |||
406 | m_log.InfoFormat("[INVENTORY ARCHIVER]: Creating version {0}.{1} IAR", majorVersion, minorVersion); | ||
407 | |||
402 | StringWriter sw = new StringWriter(); | 408 | StringWriter sw = new StringWriter(); |
403 | XmlTextWriter xtw = new XmlTextWriter(sw); | 409 | XmlTextWriter xtw = new XmlTextWriter(sw); |
404 | xtw.Formatting = Formatting.Indented; | 410 | xtw.Formatting = Formatting.Indented; |
405 | xtw.WriteStartDocument(); | 411 | xtw.WriteStartDocument(); |
406 | xtw.WriteStartElement("archive"); | 412 | xtw.WriteStartElement("archive"); |
407 | xtw.WriteAttributeString("major_version", "0"); | 413 | xtw.WriteAttributeString("major_version", majorVersion.ToString()); |
408 | xtw.WriteAttributeString("minor_version", "1"); | 414 | xtw.WriteAttributeString("minor_version", minorVersion.ToString()); |
409 | xtw.WriteEndElement(); | 415 | xtw.WriteEndElement(); |
410 | 416 | ||
411 | xtw.Flush(); | 417 | xtw.Flush(); |