mirror of
https://github.com/sparkle-project/Sparkle
synced 2026-11-24 04:38:16 +00:00
Merge pull request #982 from sparkle-project/genapp
Workaround for bugs in NSXMLDocument prefix handling
This commit is contained in:
commit
f43b9f7f02
3 files changed
+5
-4
No files matched your search
@@ -23,7 +23,7 @@ class DeltaUpdate {
|
||||
class func create(from: ArchiveItem, to: ArchiveItem, archivePath: URL) throws -> DeltaUpdate {
|
||||
var applyDiffError: NSError? = nil;
|
||||
|
||||
if (!createBinaryDelta(from.appPath.path, to.appPath.path, archivePath.path, .beigeMajorVersion, true, &applyDiffError)) {
|
||||
if (!createBinaryDelta(from.appPath.path, to.appPath.path, archivePath.path, .beigeMajorVersion, false, &applyDiffError)) {
|
||||
throw applyDiffError!;
|
||||
}
|
||||
|
||||
|
||||
@@ -47,7 +47,6 @@ func writeAppcast(appcastDestPath: URL, updates: [ArchiveItem]) throws {
|
||||
XMLNode.Options.nodeLoadExternalEntitiesNever,
|
||||
XMLNode.Options.nodePreserveCDATA,
|
||||
XMLNode.Options.nodePreserveWhitespace,
|
||||
XMLNode.Options.nodePreservePrefixes,
|
||||
];
|
||||
doc = try XMLDocument(contentsOf: appcastDestPath, options: Int(options.rawValue));
|
||||
} catch {
|
||||
@@ -160,5 +159,7 @@ func writeAppcast(appcastDestPath: URL, updates: [ArchiveItem]) throws {
|
||||
}
|
||||
|
||||
let options = XMLNode.Options.nodeCompactEmptyElement;
|
||||
try doc.xmlData(withOptions:Int(options.rawValue)).write(to: appcastDestPath);
|
||||
let docData = doc.xmlData(withOptions:Int(options.rawValue));
|
||||
let _ = try XMLDocument(data: docData, options:0); // Verify that it was generated correctly, which does not always happen!
|
||||
try docData.write(to: appcastDestPath);
|
||||
}
|
||||
@@ -31,7 +31,7 @@ func unarchive(itemPath:URL, archiveDestDir: URL, callback: @escaping (Error?) -
|
||||
}, progressBlock: nil)
|
||||
} else {
|
||||
_ = try? fileManager.removeItem(at: itemCopy);
|
||||
callback(makeError(code: .unarchivingError, "Can't create a hardlink to \(itemCopy)"));
|
||||
callback(makeError(code: .unarchivingError, "Not a supported archive format: \(itemCopy)"));
|
||||
}
|
||||
} catch {
|
||||
_ = try? fileManager.removeItem(at: tempDir);
|
||||
|
||||
Reference in new issue
Block a user