Commit Graph
84 Commits
Author SHA1 Message Date
Zorg bd90fb7b18 Filter for archive files in generate_appcast more intelligently (#2448) 2023-10-08 09:38:50 -07:00
Zorg c9c08b7f42 Report an error when detecting duplicate updates in generate_appcast (#2407) 2023-07-22 16:25:38 -07:00
Zorg 39495fd562 Remove redundant codesign check (#2341) 2023-03-12 19:44:50 -07:00
Zorg 60568b82ba Don't allow DSA-only updates to pass if DSA is disabled (#2340) 2023-03-12 07:59:03 -07:00
Zorg 9ab2c0d58c Hide impractical compression options only useful for debugging (#2335) 2023-03-04 18:03:45 -08:00
Zorg 362f50a8a1 Exit with an error if generate_appcast cannot sign an update (#2322) 2023-02-25 13:18:03 -08:00
Zorg ffc203b89a Add support for plain text release notes view (#2315)
This also allows embedded release notes to be plain text using sparkle:format="plain-text" attribute.

Also, Catalyst apps only support plain text release notes (compared to before where release notes weren't supported for Catalyst apps).
2023-02-11 19:34:26 -08:00
Zorg be7f6952c2 Reduce code size and make codebase more consistent (#2305) 2022-12-27 12:03:03 -08:00
Zorg 1b1a7db1ac Expose maximum-versions option to preserve in feed per branch (#2259) 2022-09-05 16:20:35 -07:00
Zorg 1c560652e7 Remove ed25519 git submodule (#2244)
Also allow release scripts to work without git repository and bump the Sparkle versions.
2022-08-27 10:46:29 -07:00
Zorg fbfcec3453 Fix recently introduced bugs in generate_appcast with multiple feeds (#2232)
We fix the validation check for using the output option when multiple feeds are present, fix not generating new feeds when no prior feed is available, and fix incorrect logic with cleaning up delta files when multiple feeds are present.
2022-08-19 21:36:50 -07:00
Zorg 8f77f066c1 Add delta update attributes for validating an app hasn't been stripped (#2231) 2022-08-19 20:48:52 -07:00
Zorg 80a5b80ade Move old updates to old_updates in generate_appcast (#2228)
Document --versions in generate_appcast better and add comments to explain why certain policies were made.

Add separate option to automatically pruned old update files. Now we only automatically move old update files aside. If the user passes --auto-prune-update-files we will also remove the old update files automatically.

Move old release notes files too.

Don't make old-updates directory hidden.
2022-08-14 19:07:48 -07:00
Zorg 37ef179284 Prune and preserve necessary updates in generate_appcast (#2218)
We preserve a batch of updates for each branch point (defined by an update's {majorVersion, minSystemVersion, maxSystemVersion, channel}). The latest for each branch point is used for generating delta updates.

We prune older update items that are no longer needed in the feed or needed for generating delta updates from newer items. We move pruned update files into a separate hidden directory, which is later garbage collected after a couple weeks based on each file's last modification date.

To insert new update items that are older than the latest update in the feed, --version flag needs to be used.

The overall goal is to have the feed only keep a small window of updates to serve to the user. This will also ease future processing generate_appcast needs to do and ensure the cache's directory doesn't blow up by pruning old updates.
2022-08-07 19:13:20 -07:00
Zorg 372f0504a5 Bump minimum deployment target to macOS 10.13 (#2196) 2022-07-17 16:43:24 -07:00
Zorg 14e511f901 Fix memory leaks when using generate_appcast (#2193)
We fix one memory leak when calculating sha's, one memory leak in the xar delta applying path, and avoid creating Bundles for reading the Sparkle framework version.

There are some other small leaks with the xar delta creation/applying code but since it's a legacy implementation and the APIs are undocumented I don't want to touch it too much.

The biggest culprit here is the leak when calculating sha's I believe, if you have many archive items.
2022-07-09 12:22:36 -07:00
Zorg e64b7649f2 Deprecate -s flag and add --ed-key-file option to generate_appcast (#2170) 2022-06-24 21:19:10 -07:00
Eitot 180f8975cf Replace deprecated code with newer APIs (#2112)
* Use UniformTypeIdentifiers framework to replace deprecated types

kUTType* constants are deprecated since macOS 12. The UniformTypeIdentifiers framework is available since the macOS 11 SDK.

* Replace renamed constants

* Use API_AVAILABLE macro instead of __OSX_AVAILABLE
2022-04-24 16:51:48 -07:00
Zorg e8fea3481a Add generate_appcast support for recent features (#2082)
We add support for:
* <sparkle:belowVersion> in <sparkle:informationalUpdate>
* <sparkle:ignoreSkippedUpgradesBelowVersion>
2022-01-30 15:20:55 -08:00
Zorg 91bccdf0ad Verify code signing in generate_appcast (#2077)
In generate_appcast we:

* Validate code signing integrity of new updates
* Add hidden flag to disable checking for nested code during validation
* Warn if new and old apps have differing signing identities when generating deltas
2022-01-23 14:46:52 -08:00
Zorg 89e20a490d Add hidden option to generate_appcast to set max CDATA threshold (#2075) 2022-01-22 20:58:53 -08:00
Zorg 9e45a78e6f Verify applying delta patch in generate_appcast (#2076) 2022-01-22 20:14:45 -08:00
Zorg 92d8b2bee6 Add verify and account options for signing updates (#2074)
Accounts are intended to be used for when working on products that belong to different organizations. This way multiple keys related to Sparkle can be stored in the keychain.

We also add a --verify option to sign_update which allows verifying that updates are signed correctly.
2022-01-22 18:48:02 -08:00
Zorg 41f953d77b Fix minor binary delta issues and make version 3 the default (#2055) 2022-01-08 21:23:15 -08:00
Zorg 71fc8d7b11 Add additional options to delta tools (#2052) 2022-01-04 00:14:45 -08:00
Zorg 23fc577184 Add new version 3 binary delta archive format (#2051)
This new format introduces:

* A new container format which stores metadata in a way that is more efficient for compression, decompression, and size. Creation time can be 2x faster, apply time can be a few seconds faster, size savings can be 500 KB - couple of MB due to metadata alone.
* An array of supported compression formats including lzma, bzip2, zlib and more. We now default to lzma which is as competitive as bzip2 (which we were using in version 2 format) in applying/creation times, but can save several MB on size.
* Tracking of files from an old app being replicated in different locations in the new app. This can track unchanged files being renamed and can result in significant savings if the files are large.

Version 2 format is still the default. To use version 3, pass --version=3 to BinaryDelta when creating a patch. We will switch the default to version 3 later. generate_appcast support is upcoming.
2022-01-02 11:35:51 -08:00
Zorg 4b9388d9aa Add full release notes link flag to generate_appcast (#2015) 2021-11-07 19:52:03 -08:00
Zorg a81f8f3d2d Add safer handling for applying binary delta files (#1988) 2021-10-29 12:14:23 -07:00
Zorg 3de3591d13 Fix order of inserting new appcast items in generate_appcast (#1982)
When we don't have any information for existing items, we have been appending new items below the existing ones. We should insert new items such that new items are inserted in order of version descending.
2021-10-23 20:21:54 -07:00
Mayur Pawashe 6b9981f567 Add generation of API docs (#1915) 2021-08-09 18:27:44 -07:00
Mayur Pawashe 34fcb8784b Support appcast selection features in generate_appcast (#1914)
Add generate_appcast options for appcast selection features

We can now supply for new update items:

* Link
* Channel name
* Last major version / minimum autoupdate version
* Phased rollout interval
* Last critical update version
* Originating informational update versions

We can also specify the maximum number of delta items to generate.

Lastly we can specify which versions to create new items for now. This allows applying flags for only specific versions, or for exceptional cases allows adding old versions that do not meet the most recent updates threshold (maxNewVersionsInFeed) -- think for updates for a prior OS or for a prior major version.

We do not override the minimum system version element on already existing items now, if the element already exists. Apps don't strictly need to specify LSMinimumSystemVersion and this allows users specifying it themselves in the feed.

The help page for generate_appcast was expanded with how the archive directory looks like, how release notes work, that old entries are kept in tact, and how extracted archives are cached..

We now write out the number of new updates written and the number of existing items updated, to make the generated result be less confusing.

Bug fixes:

* The scheme now builds for Debug so I can properly debug generate_appcast from within Xcode (distribution builds are still in Release)
* Newly generated items were appended at the end of the appcast and not necessarily inserted in the correct order (on top). As a workaround when we process existing items, we remove them, and re-add them.
* Fixed an off-by-one error for maximum number of delta files we can generate.

Fixes #1903
2021-08-08 09:07:27 -07:00
Mayur Pawashe 4f7ed347ab Adopt Swift Argument parser for Swift tools (#1913)
Also remove the deprecated usage of passing DSA key as an argument, because it can just be provided as an option (-f)
2021-08-01 08:56:18 -07:00
Sungbin Jo 119766a650 Fix appcast pubDate tag generation in different locales
Fixes #1900
2021-07-21 15:11:21 +01:00
Zorg ccd8886bfd Adopt sparkle:version and sparkle:shortVersionString elements
We should recommend using sparkle:version and sparkle:shortVersionString elements inside the appcast item instead of inside the enclosure for consistency.

Delta updates do not need to specify sparkle:version, and can inherit the top level element. This clears up some confusion and reduces duplication (and reduces error proneness / saves me work when testing delta / info-only features).

This is also consistent with informational updates. Regardless whether you want to make an update informational only or not, the sparkle:version stays in the same top-level place.

This is a backwards compatible change. Very old versions of Sparkle (possibly up to a decade or more ago) have supported specifying sparkle:version as a top level item. Winsparkle supports it as well because it's needed for info-only updates.

This is only changing what we recommend / standardize. The attribute variants are still usable.

External tools relying on Sparkle's feed format may have to adapt to this standardization (they have always needed to support info-only updates with a missing enclosure which apps do leverage anyway).

I updated generate_appcast to prefer the element variants and updated the tool so it understands them (this was a bug).
2021-06-26 21:01:39 -07:00
Zorg 57b39fc1e5 Update and remove 10.9 and 10.10 references 2021-05-27 21:39:24 -07:00
Lance Lovette 0e26a3e27a Correct generate_appcast -s command line argument usage help
Fixes sparkle-project/Sparkle#1766
2021-02-20 19:46:34 -08:00
Lance Lovette 16dc6c2b5b Fix -f command line argument handling
https://github.com/sparkle-project/Sparkle/issues/1763
2021-02-17 20:14:34 -08:00
Zorg afe03b7161 Fix compile errors in generate_appcast 2021-01-30 23:24:50 -08:00
Gwynne Raskind 93e4fd9424 Fix generate_appcast so links to localized release notes are embedded as full URLs instead of unescaped filenames. This makes them load reliably in complex contexts (such as the presence of characters like spaces in the filenames). 2020-10-12 12:43:43 -05:00
Denis Dzyubenko 6f1fceb7d4 generate_appcast follow symbolic links
When archives are stored as symlinks e.g. due to storing binary files in a
git-annex repository, everything works file except file size in the generate
feed xml file. This patch makes generate_appcast correctly determine file size
by following the symlink

(cherry picked from commit 7233bb93e7)
2020-09-23 07:28:12 -05:00
Brad Andalman 65cab6a14d generate_appcast can update the release notes element’s URL when required
Previously, generate_appcast could only add or remove the release notes element for an update. This was probably fine, because it was unlikely to change: the release notes URL was determined by the SUFeedURL.

However, now that —release-notes-url-prefix was added, the release notes element CAN change. So, with this commit, if the release notes element is present for an update, the URL will be set correctly.

(cherry picked from commit 7c7e924ed4)
2020-09-23 07:26:54 -05:00
Kornel 923f15220f Merge pull request #1648 from oneeightyg/feature-1646-generate-appcast-output-filename 2020-09-23 07:26:36 -05:00
Kornel 5fcc9a8aa9 Merge pull request #1644 from oneeightyg/feature-1642-release-notes-url-prefix
Add —release-notes-url-prefix to generate_appcast

(cherry picked from commit 7ea72a2af4)
2020-09-23 07:24:03 -05:00
Gwynne Raskind a95f1592cd Fix several dozen warnings. Fix several things to actually respect the 10.9 minimum of the beta. 2020-07-25 02:19:50 -05:00
Gwynne Raskind 9422bf16ae Forward-port improvements to generate_appcast from main branch (overridable download URL prefixes, extracting archives to uniqued output directory names during generation, -h flag to print usage, support for specifying Ed25519 key as string on command line, much smarter args parsing, ability to override keychain used to find signing keys) 2020-07-24 20:43:22 -05:00
Gwynne Raskind 418068e902 Forward-port PR #1499 (localized release notes in appcast) to 2.x 2020-07-24 20:33:35 -05:00
Kornel 0900d09ab3 Run swiftlint 2020-06-10 12:19:02 +01:00
Rajiv Shah 1755a3da05 Silence two warnings 2020-06-10 12:17:38 +01:00
Rajiv Shah bb56b5b259 Run SwifLint autocorrect 2020-06-10 12:15:34 +01:00
Jordan Rose a9ba760d6e Rename generate_appcast briding header to match standard naming 2020-06-10 12:14:30 +01:00