Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create valid xar files #1906

Merged
merged 2 commits into from
Jul 24, 2021
Merged

Create valid xar files #1906

merged 2 commits into from
Jul 24, 2021

Conversation

zorgiepoo
Copy link
Member

@zorgiepoo zorgiepoo commented Jul 24, 2021

Create valid xar files by creating file nodes, eg Contents -> Resources -> foo.txt
Before we were just creating all top-level items with paths that had multiple path components, instead of any parent entries, but doing this was wrong.

I also noticed and fixed some incorrect logic determining file equality in creation by the file hash. Now it makes sure the file/symlink contents are equal or they're both directory entires.

This does not break older clients. The applying logic was fortunately written in a way where no changes there are required.
We thus do not need to bump the major version, but we are bumping the minor version of the format here.

I will cherry-pick this change to 1.x once approved / merged.

Fixes #1899

Checklist:

  • My change is being tested and reviewed against the Sparkle 2.x branch. New changes must be developed on the 2.x development branch first.
  • My change is being backported to master branch (Sparkle 1.x). Please create a separate pull request for 1.x, should it be backported. Note 1.x is feature frozen and is only taking bug fixes, localization updates, and critical OS adoption enhancements.
  • I have reviewed and commented my code, particularly in hard-to-understand areas.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • My change is or requires a documentation or localization update

Testing

I tested and verified my change by using one or multiple of these methods:

  • Sparkle Test App
  • Unit Tests
  • My own app
  • Other (please specify)

All unit tests pass.
Tested creating and applying new binary delta files between two different versions of an app.
Tested applying a newly generated binary delta file using an older binary delta version works.

Tested both of these combinations on Big Sur and Monterey beta machines.

macOS version tested:
11.5 (20G71)
12.0 Beta (21A5284e)

@zorgiepoo zorgiepoo merged commit 29a2fa7 into 2.x Jul 24, 2021
@zorgiepoo zorgiepoo deleted the valid-xar branch July 24, 2021 16:04
zorgiepoo added a commit that referenced this pull request Jul 24, 2021
* Create xar files with valid directory/filename structure

* Don't use file hash for determining if files are equal or not
@ZhuoxingGuo
Copy link

Great! Thank you

mherrmann pushed a commit to brave/Sparkle that referenced this pull request Dec 23, 2022
* Create xar files with valid directory/filename structure

* Don't use file hash for determining if files are equal or not
mherrmann pushed a commit to brave/Sparkle that referenced this pull request Jan 5, 2023
* Create xar files with valid directory/filename structure

* Don't use file hash for determining if files are equal or not
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BinaryDelta doesn't work in Mac monterey
3 participants