Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@mdanish-kh
Copy link
Contributor

@mdanish-kh mdanish-kh commented Jul 26, 2023

This change makes it so we take the last portion of the RelativeFilePath i.e., the file name and search that file name in the new archive for a match. If it is a unique match, we get its RelativeFilePath and use it for the update.

Known limitation is that there are some cases where there may be more than one match in the archive (An example of this being DynamoRIO.DynamoRIO package). This is not handled in this PR and we print out an appropriate message to the user. I'll create an issue for it if this PR gets accepted.

The change to use the whole NestedInstallerFile object instead of previous RelativeFilePaths is so that I can replace this whole object in UpdateInstallerMetadata() and have it updated.

Test packages

Somes packages I found to test this PR with

wingetcreate update Smallstep.step -v 18.0 --urls "https://github.com/smallstep/cli/releases/download/v0.24.4/step_windows_0.24.4_amd64.zip" "https://github.com/smallstep/cli/releases/download/v0.24.4/step_windows_0.24.4_arm64.zip"
wingetcreate update Genymobile.scrcpy -v 18.0 --urls "https://github.com/Genymobile/scrcpy/releases/download/v1.25/scrcpy-win64-v1.25.zip" "https://github.com/Genymobile/scrcpy/releases/download/v1.25/scrcpy-win32-v1.25.zip"

Multiple matches for RelativeFilePaths (not handled in this PR)

wingetcreate update DynamoRIO.DynamoRIO --version 18.0 --urls "https://github.com/DynamoRIO/dynamorio/releases/download/cronbuild-9.93.19557/DynamoRIO-Windows-9.93.19557.zip"

Microsoft Reviewers: codeflow:open?pullrequest=#415

@mdanish-kh mdanish-kh requested review from a team, ryfu-msft and yao-msft and removed request for a team July 26, 2023 18:34
@mdanish-kh mdanish-kh force-pushed the getMatchingRelativeFilePath branch from 7a411e9 to e229504 Compare July 26, 2023 18:35
@mdanish-kh
Copy link
Contributor Author

mdanish-kh commented Jul 26, 2023

The GitHub diffs are not correct after 83973aa. I modified the UpdateSingleInstallerInteractively method but that method had both mixed line endings (CRLF and LF) because of which the diffs are messed up. If you check out the changes in Visual Studio, it'll show you the correct diffs.

If you like I can fix the line endings for UpdateCommand.cs and PackageParser.cs in a new commit as they are the two most high traffic files, though that'll mess the diffs up even more for this PR

Copy link
Contributor

@ryfu-msft ryfu-msft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a couple nit comments

@ryfu-msft
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@ryfu-msft
Copy link
Contributor

The GitHub diffs are not correct after 83973aa. I modified the UpdateSingleInstallerInteractively method but that method had both mixed line endings (CRLF and LF) because of which the diffs are messed up. If you check out the changes in Visual Studio, it'll show you the correct diffs.

If you like I can fix the line endings for UpdateCommand.cs and PackageParser.cs in a new commit as they are the two most high traffic files, though that'll mess the diffs up even more for this PR

If you can do this in a separate PR (after this gets checked in) that would be a huge help! 🙏
That way we can link the related issue to that PR when it gets checked in.

@mdanish-kh
Copy link
Contributor Author

If you can do this in a separate PR (after this gets checked in) that would be a huge help! 🙏 That way we can link the related issue to that PR when it gets checked in.

Gotcha! Will do after this one. I was shying away from fixing the line endings since it'll mess up the git blame output but I guess fixing it has more value.

@ryfu-msft
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@ryfu-msft
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

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.

2 participants