Compare commits

...
16 Commits
Author SHA1 Message Date
Kornel d01298c9ce Bump 2020-05-13 11:15:47 +01:00
Kornel a242035c74 Merge pull request #1586 from lwouis/fix-iframe-popup 2020-05-12 13:54:36 +01:00
Louis Pontoise 8f19f6a8cc fix: when the user set a release note url, and that page was creating iframes without src attributes, these would make popups appear saying "There is no application set to open the URL about:blank."
A request URL to about:blank has no purpose of being opened, so we ignore it.
2020-05-12 02:12:54 +09:00
Kornel 9568732f78 Merge pull request #1582 from Wevah/generate-appcast-hashpath 2020-05-02 15:53:48 +01:00
Nate Weaver f49295b054 Use the SHA-256 hash of the archive as the extraction path
Issue #1559.
2020-05-01 19:49:20 -05:00
Nate Weaver aff67ceda8 Add documentation comments; don't return an optional from the FileHandle method 2020-05-01 19:23:58 -05:00
Nate Weaver c8d5d18ce0 Add URL+Hashing 2020-05-01 19:15:29 -05:00
Kornel f1167b3649 Merge pull request #1575 from DanielFirlej/Polish2622
Update SUUpdateAlert.xib
2020-04-12 22:20:35 +01:00
DanielFirlej 3077864a3e Update SUUpdateAlert.xib
Missing translation > Software Update > Uaktualnienie oprogramowania
2020-04-12 20:40:15 +02:00
Kornel 2db0d8cb37 Merge pull request #1571 from D0miH/feature/1569-download-url-prefix-option
Prefix for download url can be provided to generate_appcast
2020-04-07 00:17:05 +01:00
Dominik H 0d16b459a5 added help command line option 2020-04-06 17:09:55 +02:00
Dominik H 4c3e202d2e added function that parses all command line options 2020-04-06 16:57:17 +02:00
Dominik H 96d162c7e5 command line option to provide a download url prefix is now parsed and set on each archive item 2020-04-04 23:12:26 +02:00
Kornel 01b48d44e8 Merge pull request #1561 from TheTechRobo/master
Update README.markdown
2020-03-17 14:08:01 +00:00
Ittussarom Retals Mail Ynohtna c39f7df513 Update README.markdown
A few changes to the README file to make it a tad more clear
2020-03-17 09:38:22 -04:00
Kornel ec15362770 Compress with lzma 2020-02-11 18:24:54 +00:00
13 changed files with 242 additions and 67 deletions

No files matched your search

+11
View File
@@ -1,3 +1,14 @@
# 1.24.0-alpha
* Fixed error about "about:blank" release notes (Louis Pontoise)
* Use the SHA-256 hash of the archive as the cache path (Nate Weaver)
* Don't return an optional from the FileHandle method (Nate Weaver)
* Added URL+Hashing (Nate Weaver)
* Update SUUpdateAlert.xib (DanielFirlej)
* Added help command line option (Dominik H)
* Added function that parses all command line options (Dominik H)
* Command line option to provide a download url prefix is now parsed and set on each archive item (Dominik H)
# 1.23.0
* Support generating appcast with localizations (#1499) (Alik Vovkotrub)
+1 -1
View File
@@ -16,7 +16,7 @@ SPARKLE_AUTOMATED_DOWNGRADES = 0
SPARKLE_NORMALIZE_INSTALLED_APPLICATION_NAME = 0
SPARKLE_VERSION_MAJOR = 1
SPARKLE_VERSION_MINOR = 23
SPARKLE_VERSION_MINOR = 24
SPARKLE_VERSION_PATCH = 0
SPARKLE_VERSION = $(SPARKLE_VERSION_MAJOR).$(SPARKLE_VERSION_MINOR).$(SPARKLE_VERSION_PATCH)
+2 -2
View File
@@ -12,7 +12,7 @@ if [ "$ACTION" = "" ] ; then
fi
rm -rf "$CONFIGURATION_BUILD_DIR/staging"
rm -f "Sparkle-$CURRENT_PROJECT_VERSION.tar.bz2"
rm -f "Sparkle-$CURRENT_PROJECT_VERSION.tar.xz"
mkdir -p "$CONFIGURATION_BUILD_DIR/staging"
cp "$SRCROOT/CHANGELOG" "$SRCROOT/LICENSE" "$SRCROOT/Resources/SampleAppcast.xml" "$CONFIGURATION_BUILD_DIR/staging"
@@ -37,6 +37,6 @@ if [ "$ACTION" = "" ] ; then
cd "$CONFIGURATION_BUILD_DIR/staging"
# Sorted file list groups similar files together, which improves tar compression
find . \! -type d | rev | sort | rev | tar cjvf "../Sparkle-$CURRENT_PROJECT_VERSION.tar.bz2" --files-from=-
find . \! -type d | rev | sort | rev | tar cv --files-from=- | xz -9 > "../Sparkle-$CURRENT_PROJECT_VERSION.tar.xz"
rm -rf "$CONFIGURATION_BUILD_DIR/staging"
fi
+1 -1
View File
@@ -14,7 +14,7 @@ localizable-strings:
release:
xcodebuild -scheme Distribution -configuration Release -derivedDataPath "$(BUILDDIR)" build
open -R "$(BUILDDIR)/Build/Products/Release/Sparkle-"*.tar.bz2
open -R "$(BUILDDIR)/Build/Products/Release/Sparkle-"*.tar.xz
cat Sparkle.podspec
@echo "Don't forget to update CocoaPods! pod trunk push"
+2 -2
View File
@@ -4,7 +4,7 @@ Secure and reliable software update framework for Cocoa developers.
<img src="Resources/Screenshot.png" width="732" alt="Sparkle shows familiar update window with release notes">
This branch is the production ready, battle-tested version of Sparkle used by thousands of Mac apps.
This branch is the production ready, battle-tested version of Sparkle used by thousands of Mac apps.
The upcoming Sparkle 2 (currently in beta) can be found in the [2.x branch](https://github.com/sparkle-project/Sparkle/tree/2.x).
## Features
@@ -26,7 +26,7 @@ The upcoming Sparkle 2 (currently in beta) can be found in the [2.x branch](http
* Runtime: macOS 10.7 or greater
* Build: Xcode 9 and 10.11 SDK or greater
* HTTPS server for serving updates (see [App Transport Security](http://sparkle-project.org/documentation/app-transport-security/))
* No sandboxing. Sparkle 1.x can't update sandboxed apps. [Sparkle 2.x](https://github.com/sparkle-project/Sparkle/tree/2.x) can.
* No sandboxing. Sparkle 1.x can't update sandboxed apps. However, [Sparkle 2.x](https://github.com/sparkle-project/Sparkle/tree/2.x) can.
## Usage
+1 -1
View File
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "Sparkle"
s.version = "1.22.0"
s.version = "1.23.0"
s.summary = "A software update framework for macOS"
s.description = "Sparkle is an easy-to-use software update framework for Cocoa developers."
s.homepage = "http://sparkle-project.org"
+4
View File
@@ -276,6 +276,7 @@
767B61AD1972D488004E0C3C /* SUGuidedPackageInstaller.m in Sources */ = {isa = PBXBuildFile; fileRef = 767B61AB1972D488004E0C3C /* SUGuidedPackageInstaller.m */; };
767B61AE1972D488004E0C3C /* SUGuidedPackageInstaller.m in Sources */ = {isa = PBXBuildFile; fileRef = 767B61AB1972D488004E0C3C /* SUGuidedPackageInstaller.m */; };
A5BF4F1D1BC7668B007A052A /* SUTestWebServer.m in Sources */ = {isa = PBXBuildFile; fileRef = A5BF4F1C1BC7668B007A052A /* SUTestWebServer.m */; };
B2D3F865245CEA24009BA78C /* URL+Hashing.swift in Sources */ = {isa = PBXBuildFile; fileRef = B2D3F864245CEA24009BA78C /* URL+Hashing.swift */; };
C23E885B1BE7B24F0050BB73 /* SparkleTestCodeSignApp.enc.dmg in Resources */ = {isa = PBXBuildFile; fileRef = C23E88591BE7AF890050BB73 /* SparkleTestCodeSignApp.enc.dmg */; };
E1545EC51E1D7E0200FAECE8 /* SUTouchBarButtonGroup.h in Headers */ = {isa = PBXBuildFile; fileRef = E1545EC31E1D7E0200FAECE8 /* SUTouchBarButtonGroup.h */; };
E1545EC61E1D7E0200FAECE8 /* SUTouchBarButtonGroup.m in Sources */ = {isa = PBXBuildFile; fileRef = E1545EC41E1D7E0200FAECE8 /* SUTouchBarButtonGroup.m */; };
@@ -948,6 +949,7 @@
8DC2EF5B0486A6940098B216 /* Sparkle.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Sparkle.framework; sourceTree = BUILT_PRODUCTS_DIR; };
A5BF4F1B1BC7668B007A052A /* SUTestWebServer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUTestWebServer.h; sourceTree = "<group>"; };
A5BF4F1C1BC7668B007A052A /* SUTestWebServer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUTestWebServer.m; sourceTree = "<group>"; };
B2D3F864245CEA24009BA78C /* URL+Hashing.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "URL+Hashing.swift"; sourceTree = "<group>"; };
C23E88591BE7AF890050BB73 /* SparkleTestCodeSignApp.enc.dmg */ = {isa = PBXFileReference; lastKnownFileType = file; path = SparkleTestCodeSignApp.enc.dmg; sourceTree = "<group>"; };
E1545EC31E1D7E0200FAECE8 /* SUTouchBarButtonGroup.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUTouchBarButtonGroup.h; sourceTree = "<group>"; };
E1545EC41E1D7E0200FAECE8 /* SUTouchBarButtonGroup.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUTouchBarButtonGroup.m; sourceTree = "<group>"; };
@@ -1324,6 +1326,7 @@
5AA96C571E0AE0DB00CA4346 /* main.swift */,
5AE13F771E0C9B12000D2C2C /* Signatures.swift */,
5A5AC5351E0C6CA300998119 /* Unarchive.swift */,
B2D3F864245CEA24009BA78C /* URL+Hashing.swift */,
);
path = generate_appcast;
sourceTree = "<group>";
@@ -2275,6 +2278,7 @@
5A5AC5381E0C6D3000998119 /* FeedXML.swift in Sources */,
5AA96C581E0AE0DB00CA4346 /* main.swift in Sources */,
5AE13F781E0C9B12000D2C2C /* Signatures.swift in Sources */,
B2D3F865245CEA24009BA78C /* URL+Hashing.swift in Sources */,
5AE13FBA1E0DA389000D2C2C /* SUBinaryDeltaApply.m in Sources */,
5AAD00661E0C2D9B00AF411E /* SUBinaryDeltaCommon.m in Sources */,
5AAD00671E0C2D9B00AF411E /* SUBinaryDeltaCreate.m in Sources */,
+3 -2
View File
@@ -352,7 +352,8 @@ static NSString *const SUUpdateAlertTouchBarIndentifier = @"" SPARKLE_BUNDLE_IDE
{
NSURL *requestURL = request.URL;
NSString *scheme = requestURL.scheme;
BOOL whitelistedSafe = [scheme isEqualToString:@"http"] || [scheme isEqualToString:@"https"] || [requestURL.absoluteString isEqualToString:@"about:blank"];
BOOL isAboutBlank = [requestURL.absoluteString isEqualToString:@"about:blank"];
BOOL whitelistedSafe = [scheme isEqualToString:@"http"] || [scheme isEqualToString:@"https"] || isAboutBlank;
// Do not allow redirects to dangerous protocols such as file://
if (!whitelistedSafe) {
@@ -362,7 +363,7 @@ static NSString *const SUUpdateAlertTouchBarIndentifier = @"" SPARKLE_BUNDLE_IDE
}
if (self.webViewFinishedLoading) {
if (requestURL) {
if (requestURL && !isAboutBlank) {
[[NSWorkspace sharedWorkspace] openURL:requestURL];
}
+1 -1
View File
@@ -23,7 +23,7 @@
</customObject>
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
<window identifier="SUUpdateAlert" title="Software Update" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" hidesOnDeactivate="YES" releasedWhenClosed="NO" visibleAtLaunch="NO" frameAutosaveName="SUUpdateAlert" animationBehavior="default" id="5" userLabel="Update Alert (release notes)">
<window identifier="SUUpdateAlert" title="Uaktualnienie oprogramowania" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" hidesOnDeactivate="YES" releasedWhenClosed="NO" visibleAtLaunch="NO" frameAutosaveName="SUUpdateAlert" animationBehavior="default" id="5" userLabel="Update Alert (release notes)">
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES"/>
<windowPositionMask key="initialPositionMask" topStrut="YES" bottomStrut="YES"/>
<rect key="contentRect" x="746" y="229" width="620" height="370"/>
+6 -2
View File
@@ -46,6 +46,7 @@ class ArchiveItem: CustomStringConvertible {
var dsaSignature: String?;
var edSignature: String?;
var downloadUrlPrefix: URL?;
init(version: String, shortVersion: String?, feedURL: URL?, minimumSystemVersion: String?, publicEdKey: String?, supportsDSA: Bool, appPath: URL, archivePath: URL) throws {
self.version = version;
@@ -125,8 +126,11 @@ class ArchiveItem: CustomStringConvertible {
guard let escapedFilename = self.archivePath.lastPathComponent.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) else {
return nil;
}
if let relative = self.feedURL {
return URL(string: escapedFilename, relativeTo: relative)
if let downloadUrlPrefix = self.downloadUrlPrefix {
// if a download url prefix was given use this one
return URL(string: escapedFilename, relativeTo: downloadUrlPrefix)
} else if let relativeFeedUrl = self.feedURL {
return URL(string: escapedFilename, relativeTo: relativeFeedUrl)
}
return URL(string: escapedFilename)
}
+54
View File
@@ -0,0 +1,54 @@
//
// URL+Hashing.swift
// generate_appcast
//
// Created by Nate Weaver on 2020-05-01.
// Copyright © 2020 Sparkle Project. All rights reserved.
//
import Foundation
import CommonCrypto
extension FileHandle {
/// Calculate the SHA-256 hash of the file referenced by the file handle.
///
/// - Returns: The SHA-256 hash of the file (as a hexadecimal string).
func sha256String() -> String {
// This uses CommonCrypto instead of CryptoKit so it can work on macOS < 10.15
var context = CC_SHA256_CTX()
CC_SHA256_Init(&context)
while true {
let data = self.readData(ofLength: 65_536)
guard data.count > 0 else { break }
let _ = data.withUnsafeBytes {
CC_SHA256_Update(&context, $0.baseAddress, numericCast($0.count))
}
}
let hash = UnsafeMutableBufferPointer<UInt8>.allocate(capacity: Int(CC_SHA256_DIGEST_LENGTH))
CC_SHA256_Final(hash.baseAddress, &context)
return hash.reduce("") { $0 + String(format: "%02x", $1) }
}
}
extension URL {
/// Calculates the SHA-256 hash of the file referened by the URL.
///
/// - Returns: The SHA-256 hash of the file (as a hexadecimal string), or `nil` if
/// the URL doesn't point to a file.
func sha256String() -> String? {
guard self.isFileURL else { return nil }
guard let filehandle = try? FileHandle(forReadingFrom: self) else { return nil }
return filehandle.sha256String()
}
}
+7 -1
View File
@@ -58,7 +58,13 @@ func unarchiveUpdates(archivesSourceDir: URL, archivesDestDir: URL, verbose: Boo
var running = 0;
for item in dir.filter({ !$0.hasPrefix(".") && !$0.hasSuffix(".delta") && !$0.hasSuffix(".xml") && !$0.hasSuffix(".html") }) {
let itemPath = archivesSourceDir.appendingPathComponent(item);
let archiveDestDir = archivesDestDir.appendingPathComponent(itemPath.lastPathComponent);
let archiveDestDir: URL
if let hash = itemPath.sha256String() {
archiveDestDir = archivesDestDir.appendingPathComponent(hash)
} else {
archiveDestDir = archivesDestDir.appendingPathComponent(itemPath.lastPathComponent)
}
var isDir:ObjCBool = false;
if (fileManager.fileExists(atPath: itemPath.path, isDirectory: &isDir) && isDir.boolValue) {
+149 -54
View File
@@ -25,6 +25,19 @@ func printUsage() {
)
}
func printHelp() {
let command = URL(fileURLWithPath: CommandLine.arguments.first!).lastPathComponent;
print(
"Usage: \(command) [OPTIONS] [ARCHIVES_FOLDER]\n",
"Options:\n",
"\t-f: provide the path to the private DSA key\n",
"\t-n: provide the name of the private DSA key. This option has to be used together with `-k`\n",
"\t-k: provide the name of the keychain. This option has to be used together with `-n`\n",
"\t-s: provide the path to the private EdDSA key\n",
"\t--download-url-prefix: provide a static url that will be used as prefix for the url from where updates will be downloaded\n"
)
}
func loadPrivateKeys(_ privateDSAKey: SecKey?, _ privateEdString: String?) -> PrivateKeys {
var privateEdKey: Data?;
var publicEdKey: Data?;
@@ -62,6 +75,129 @@ func loadPrivateKeys(_ privateDSAKey: SecKey?, _ privateEdString: String?) -> Pr
return PrivateKeys(privateDSAKey: privateDSAKey, privateEdKey: privateEdKey, publicEdKey: publicEdKey);
}
/**
* Parses all possible command line options and returns the values in a tuple.
*/
func parseCommandLineOptions(argumentList: [String]) -> (privateDSAKey: SecKey?, privateEdString: String?, downloadUrlPrefix: URL?, archivesSourceDir: URL) {
// if the option `-h` is in the argument list print the help dialog
if argumentList.contains("-h") {
printHelp()
exit(1)
}
// make a mutable copy of the argument list
var arguments = argumentList
// remove the first element since this is the path to executable which we don't need
arguments.removeFirst()
// define the variables for the possible argument values
var privateDSAKey: SecKey? = nil
var privateEdString: String? = nil
var downloadUrlPrefix: URL? = nil
var archivesSourceDir: URL
// check if the private dsa key option is present
if let privateDSAKeyOptionIndex = arguments.firstIndex(of: "-f") {
// check that when accessing the value of the option we don't get out of bounds
if privateDSAKeyOptionIndex + 1 >= arguments.count {
print("Too few arguments were given")
exit(1)
}
// get the private DSA key
let privateKeyUrl = URL(fileURLWithPath: arguments[privateDSAKeyOptionIndex + 1])
do {
privateDSAKey = try loadPrivateDSAKey(at: privateKeyUrl)
} catch {
print("Unable to load DSA private key from", privateKeyUrl.path, "\n", error)
exit(1)
}
// remove the already parsed arguments
arguments.remove(at: privateDSAKeyOptionIndex)
arguments.remove(at: privateDSAKeyOptionIndex + 1)
}
// check if the private dsa sould be loaded using the keyname and the name of the keychain
if let keyNameOptionIndex = arguments.firstIndex(of: "-n"), let keychainNameOptionIndex = arguments.firstIndex(of: "-k") {
// check that when accessing one of the values of the options we don't get out of bounds
if keyNameOptionIndex + 1 >= arguments.count || keychainNameOptionIndex + 1 >= arguments.count {
print("Too few arguments were given")
exit(1)
}
// get the keyname and the keychain url to load the private DSA key
let keyName: String = arguments[keyNameOptionIndex + 1]
let keychainUrl: URL = URL(fileURLWithPath: arguments[keychainNameOptionIndex + 1])
do {
privateDSAKey = try loadPrivateDSAKey(named: keyName, fromKeychainAt: keychainUrl)
} catch {
print("Unable to load DSA private key '\(keyName)' from keychain at", keychainUrl.path, "\n", error)
exit(1)
}
// remove the already parsed arguments
arguments.remove(at: keyNameOptionIndex + 1)
arguments.remove(at: keyNameOptionIndex)
arguments.remove(at: arguments.firstIndex(of: "-k")! + 1)
arguments.remove(at: keychainNameOptionIndex)
}
// check if the private EdDSA key string was given as an argument
if let privateEdDSAKeyOptionIndex = arguments.firstIndex(of: "-s") {
// check that when accessing the value of the option we don't get out of bounds
if privateEdDSAKeyOptionIndex + 1 >= arguments.count {
print("Too few arguments were given")
exit(1)
}
// get the private EdDSA key string
privateEdString = arguments[privateEdDSAKeyOptionIndex + 1]
// remove the already parsed argument
arguments.remove(at: privateEdDSAKeyOptionIndex + 1)
arguments.remove(at: privateEdDSAKeyOptionIndex)
}
// check if a prefix for the download url of the archives was given
if let downloadUrlPrefixOptionIndex = arguments.firstIndex(of: "--download-url-prefix") {
// check that when accessing the value of the option we don't get out of bounds
if downloadUrlPrefixOptionIndex + 1 >= arguments.count {
print("Too few arguments were given")
exit(1)
}
// get the download url prefix
downloadUrlPrefix = URL(string: arguments[downloadUrlPrefixOptionIndex + 1])
// remove the parsed argument
arguments.remove(at: downloadUrlPrefixOptionIndex + 1)
arguments.remove(at: downloadUrlPrefixOptionIndex)
}
// now that all command line options have been removed from the arguments array
// there should only be the path to the private DSA key (if provided) path to the archives dir left
if arguments.count == 2 {
// if there are two arguments left they are the private DSA key and the path to the archives directory (in this order)
// first get the private DSA key
let privateKeyUrl = URL(fileURLWithPath: arguments[0])
do {
privateDSAKey = try loadPrivateDSAKey(at: privateKeyUrl)
} catch {
print("Unable to load DSA private key from", privateKeyUrl.path, "\n", error)
exit(1)
}
// remove the parsed path to the DSA key
arguments.removeFirst()
}
// now only the archives source dir is left
archivesSourceDir = URL(fileURLWithPath: arguments[0], isDirectory: true)
return (privateDSAKey, privateEdString, downloadUrlPrefix, archivesSourceDir)
}
func main() {
let args = CommandLine.arguments;
if args.count < 2 {
@@ -71,66 +207,25 @@ func main() {
var privateDSAKey: SecKey? = nil;
var privateEdString: String? = nil;
// this was typical usage for DSA keys
if args.count == 3 || (args.count == 4 && args[1] == "-f") {
// private key specified by filename
let privateKeyURL = URL(fileURLWithPath: args.count == 3 ? args[1] : args[2])
do {
privateDSAKey = try loadPrivateDSAKey(at: privateKeyURL)
} catch {
print("Unable to load DSA private key from", privateKeyURL.path, "\n", error)
exit(1)
}
}
// this is legacy for DSA keychain; probably very rarely used
else if args.count == 6 && (args[1] == "-n" || args[1] == "-k") {
// private key specified by keychain + key name
let keyName: String
let keychainURL: URL
if args[1] == "-n" {
if args[3] != "-k" {
printUsage()
exit(1)
}
keyName = args[2]
keychainURL = URL(fileURLWithPath: args[4])
}
else {
if args[3] != "-n" {
printUsage()
exit(1)
}
keyName = args[4]
keychainURL = URL(fileURLWithPath: args[2])
}
do {
privateDSAKey = try loadPrivateDSAKey(named: keyName, fromKeychainAt: keychainURL)
} catch {
print("Unable to load DSA private key '\(keyName)' from keychain at", keychainURL.path, "\n", error)
exit(1)
}
}
// private + public EdDSA keys are provided via command line argument
else if args.count == 4 && args[1] == "-s" {
privateEdString = args[2]
}
else if args.count != 2 {
printUsage()
exit(1)
}
var downloadUrlPrefix: URL? = nil;
var archivesSourceDir: URL
(privateDSAKey, privateEdString, downloadUrlPrefix, archivesSourceDir) = parseCommandLineOptions(argumentList: args)
let archivesSourceDir = URL(fileURLWithPath: args.last!, isDirectory: true)
let keys = loadPrivateKeys(privateDSAKey, privateEdString)
do {
let allUpdates = try makeAppcast(archivesSourceDir: archivesSourceDir, keys: keys, verbose:verbose);
// if a download url prefix was provided set it for each archive item
if downloadUrlPrefix != nil {
for (_, archiveItems) in allUpdates {
for archiveItem in archiveItems {
archiveItem.downloadUrlPrefix = downloadUrlPrefix
}
}
}
for (appcastFile, updates) in allUpdates {
let appcastDestPath = URL(fileURLWithPath: appcastFile, relativeTo: archivesSourceDir);
try writeAppcast(appcastDestPath:appcastDestPath, updates:updates);