Favor sparkle:version and sparkle:shortVersionString elements over enclosure attributes #1878
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We should recommend using sparkle:version and sparkle:shortVersionString elements inside the appcast item instead of their corresponding attributes inside the enclosure for consistency.
Delta updates do not need to specify sparkle:version or sparkle:shortVersionString, and can inherit the top level elements. This clears up some confusion and reduces duplication (and reduces error proneness / saves work when switching between specific features).
This is also consistent with informational updates. Regardless whether you want to make an update informational only or not (or omit the enclosure), the sparkle:version / sparkle:shortVersionString 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 / sparkle:shortVersionString as top level items. Winsparkle supports it as well because it's needed for info-only updates.
This is only changing what we recommend / standardize. Developers can still use the attribute variants in the enclosure if they want to.
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, eg for major upgrades, anyway).
I updated generate_appcast to prefer the element variants and updated the tool so it understands them (this was a bug). I looked at the code that was looking for minimumSystemVersion and copied that.
Fixes #1207 as well.
Checklist:
Type of change
Testing
I tested and verified my change by using one or multiple of these methods:
Added couple unit tests to make sure versions (element and attribute variants) are parseable.
Tested generate_appcast making sure it writes new entries with element variant, and that it can look up both attribute & element version variants from existing entries.
macOS version tested: 11.5 Beta (20G5042c)