diff --git a/Autoupdate/SUPipedUnarchiver.m b/Autoupdate/SUPipedUnarchiver.m index 6c3018f65c..5d0931fa50 100644 --- a/Autoupdate/SUPipedUnarchiver.m +++ b/Autoupdate/SUPipedUnarchiver.m @@ -25,6 +25,7 @@ @implementation SUPipedUnarchiver NSArray *extractTBZ = @[@"/usr/bin/tar", @"-jxC"]; NSArray *extractTXZ = extractTGZ; + // Note: keep this list in sync with generate_appcast's unarchiveUpdates() NSDictionary *> *extractCommandDictionary = @{ @".zip" : @[@"/usr/bin/ditto", @"-x",@"-k",@"-"], diff --git a/generate_appcast/Unarchive.swift b/generate_appcast/Unarchive.swift index 29fc756c03..d3e95aff4a 100644 --- a/generate_appcast/Unarchive.swift +++ b/generate_appcast/Unarchive.swift @@ -56,7 +56,18 @@ func unarchiveUpdates(archivesSourceDir: URL, archivesDestDir: URL, disableNeste // so we can ignore duplicate archive entries before trying to unarchive archives in parallel var fileEntries: [URL: URL] = [:] let dir = try fileManager.contentsOfDirectory(atPath: archivesSourceDir.path) - for item in dir.filter({ !$0.hasPrefix(".") && !$0.hasSuffix(".delta") && !$0.hasSuffix(".xml") && !$0.hasSuffix(".html") && !$0.hasSuffix(".txt") }) { + for item in dir { + if item.hasPrefix(".") { + continue + } + + let itemURL = archivesSourceDir.appendingPathComponent(item) + let fileExtension = itemURL.pathExtension + // Note: keep this list in sync with SUPipedUnarchiver + guard ["zip", "tar", "gz", "tgz", "bz2", "tbz", "xz", "txz", "lzma", "dmg"].contains(fileExtension) else { + continue + } + let itemPath = archivesSourceDir.appendingPathComponent(item) // Ignore directories