From 387f743993456bb7dbc6ea639bfa98db4567789c Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Sat, 11 Dec 2010 02:18:16 +0000 Subject: If we're saving an IAR with --profile information, then label this a version 1.0 IAR since it isn't compatible with older OpenSim releases. --- .../Archiver/InventoryArchiveWriteRequest.cs | 27 ++++++++++++++++++---- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs index cab341d..5e5f6c0 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs @@ -156,7 +156,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver /// The inventory folder to save /// The path to which the folder should be saved /// If true, save this folder itself. If false, only saves contents - protected void SaveInvFolder(InventoryFolderBase inventoryFolder, string path, bool saveThisFolderItself, Dictionary options, IUserAccountService userAccountService) + /// + /// + protected void SaveInvFolder( + InventoryFolderBase inventoryFolder, string path, bool saveThisFolderItself, + Dictionary options, IUserAccountService userAccountService) { if (saveThisFolderItself) { @@ -249,7 +253,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver // Write out control file. This has to be done first so that subsequent loaders will see this file first // XXX: I know this is a weak way of doing it since external non-OAR aware tar executables will not do this - m_archiveWriter.WriteFile(ArchiveConstants.CONTROL_FILE_PATH, Create0p1ControlFile()); + // not sure how to fix this though, short of going with a completely different file format. + m_archiveWriter.WriteFile(ArchiveConstants.CONTROL_FILE_PATH, CreateControlFile(options)); m_log.InfoFormat("[INVENTORY ARCHIVER]: Added control file to archive."); if (inventoryFolder != null) @@ -372,12 +377,24 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver } /// - /// Create the control file for a 0.1 version archive + /// Create the control file for the archive /// + /// /// - public static string Create0p1ControlFile() + public static string CreateControlFile(Dictionary options) { - int majorVersion = 0, minorVersion = 1; + int majorVersion, minorVersion; + + if (options.ContainsKey("profile")) + { + majorVersion = 1; + minorVersion = 0; + } + else + { + majorVersion = 0; + minorVersion = 1; + } m_log.InfoFormat("[INVENTORY ARCHIVER]: Creating version {0}.{1} IAR", majorVersion, minorVersion); -- cgit v1.1