diff --git a/osrepodbmgr/ChangeLog b/osrepodbmgr/ChangeLog index a5ca089..c0ae342 100644 --- a/osrepodbmgr/ChangeLog +++ b/osrepodbmgr/ChangeLog @@ -1,3 +1,8 @@ +2017-04-23 Natalia Portillo + + * Core.cs: + Added detection of ZIP files created with Mac OS X. + 2017-04-23 Natalia Portillo * Core.cs: diff --git a/osrepodbmgr/Core.cs b/osrepodbmgr/Core.cs index b4fce1d..2f819fd 100644 --- a/osrepodbmgr/Core.cs +++ b/osrepodbmgr/Core.cs @@ -637,7 +637,6 @@ namespace osrepodbmgr } } - // TODO: Check if ZIP file contains Mac OS X metadata MainClass.copyArchive = false; MainClass.archiveFormat = format; MainClass.noFilesInArchive = counter; @@ -656,6 +655,20 @@ namespace osrepodbmgr return; } + if(format == "Zip") + { + ZipFile zf = ZipFile.Read(MainClass.path); + foreach(ZipEntry ze in zf) + { + // ZIP created with Mac OS X, need to be extracted with The UnArchiver to get correct ResourceFork structure + if(ze.FileName.StartsWith("__MACOSX", StringComparison.CurrentCulture)) + { + MainClass.copyArchive = true; + break; + } + } + } + if(Finished != null) Finished(); }