From 7e08d7da157294640e72c22a521ae233bad2b84c Mon Sep 17 00:00:00 2001 From: Dr Scofield Date: Thu, 22 Jan 2009 16:43:09 +0000 Subject: From: Christopher Yeoh this patch makes load-oar a bit more tolerant to irrelevant differences in the oar file format. Directory entries are now ignored rather than trying to interpret them as files they hold which results in the load-oar failing. This change makes it easier to manually modify oar files. --- .../Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/Environment/Modules/Avatar') diff --git a/OpenSim/Region/Environment/Modules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs b/OpenSim/Region/Environment/Modules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs index eab4461..e15a232 100644 --- a/OpenSim/Region/Environment/Modules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs +++ b/OpenSim/Region/Environment/Modules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs @@ -187,9 +187,13 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Inventory.Archiver new FileStream(loadPath, FileMode.Open), CompressionMode.Decompress)); byte[] data; - while ((data = archive.ReadEntry(out filePath)) != null) + TarArchiveReader.TarEntryType entryType; + while ((data = archive.ReadEntry(out filePath, out entryType)) != null) { - if (filePath.StartsWith(ArchiveConstants.ASSETS_PATH)) + if (entryType==TarArchiveReader.TarEntryType.TYPE_DIRECTORY) { + m_log.WarnFormat("[ARCHIVER]: Ignoring directory entry {0}", + filePath); + } else if (filePath.StartsWith(ArchiveConstants.ASSETS_PATH)) { if (LoadAsset(filePath, data)) successfulAssetRestores++; -- cgit v1.1