Split download verify parts of download_sysext into separate module#87
Split download verify parts of download_sysext into separate module#87dongsupark merged 1 commit intomainfrom
Conversation
15d3757 to
a356548
Compare
|
A manual test passed. so no regression. |
There was a problem hiding this comment.
Seems sensible to extract to a new struct as method, with changes. However, there will be conflicts with my #88 if that is approved.
| pub data: File, | ||
| } | ||
|
|
||
| pub fn hash_on_disk<T: omaha::HashAlgo>(path: &Path, maxlen: Option<usize>) -> Result<omaha::Hash<T>> { |
There was a problem hiding this comment.
Nice pattern to use a generic of <P: AsRef<Path>> when args are something that should be a path.
There was a problem hiding this comment.
Sounds like a nice improvement, but that results in a huge change, so I would do in a separate PR.
There was a problem hiding this comment.
Yes i would recommend it elsewhere in the codebase as well where appropriate so valid in separate pr
james-parky
left a comment
There was a problem hiding this comment.
Will have conflicts I imagine with #88. But I agree with the changes and don't mind which is merged first.
To be able to make package-related structs and enums public, Package and PackageStatus, create a new module download, move download.rs to download/mod.rs, create download/packge.rs that includes all package-related structs and enums. To make download and verify functions usable by other modules, move most code parts into the new download module. Signed-off-by: Dongsu Park <dongsu@dpark.io>
aa2d002 to
a5ae9b6
Compare
|
Squashed commits. Thanks! |
PR flatcar#87 created the download crate which caused merge conflicts with flatcar#88.
PR flatcar#87 created the download crate which caused merge conflicts with flatcar#88. Signed-off-by: james-parky <72101291+james-parky@users.noreply.github.com>
Pulls in flatcar/ue-rs#72, flatcar/ue-rs#74, flatcar/ue-rs#84, flatcar/ue-rs#85, flatcar/ue-rs#87, flatcar/ue-rs#88. Signed-off-by: Dongsu Park <dongsu@dpark.io>
Pulls in flatcar/ue-rs#72, flatcar/ue-rs#74, flatcar/ue-rs#84, flatcar/ue-rs#85, flatcar/ue-rs#87, flatcar/ue-rs#88. Signed-off-by: Dongsu Park <dongsu@dpark.io>
Pulls in flatcar/ue-rs#72, flatcar/ue-rs#84, flatcar/ue-rs#85, flatcar/ue-rs#87, flatcar/ue-rs#88. Signed-off-by: Dongsu Park <dongsu@dpark.io>
Before PR #87, target_filename was almost always `None`, which had covered an issue of setting pkg_verified. In case of target_filename being a valid String, for example "oem-azure.gz", pkg_verified ended up having an extension `.gz`, which is not expected. Now that the PR was merged, DownloadVerify module gets created with .target_filename(args.target_filename.unwrap_or(TARGET_FILENAME_DEFAULT.into())), where TARGET_FILENAME_DEFAULT is with ".gz" extension. That uncovered the hidden issue. Fix that with explicitly setting extension ".raw" for both a valid String and None for the input string. Signed-off-by: Dongsu Park <dongsu@dpark.io>
Pulls in flatcar/ue-rs#72, flatcar/ue-rs#84, flatcar/ue-rs#85, flatcar/ue-rs#87, flatcar/ue-rs#88, flatcar/ue-rs#90. Signed-off-by: Dongsu Park <dongsu@dpark.io>
Pulls in flatcar/ue-rs#72, flatcar/ue-rs#84, flatcar/ue-rs#85, flatcar/ue-rs#87, flatcar/ue-rs#88, flatcar/ue-rs#90. Signed-off-by: Dongsu Park <dongsu@dpark.io>
Pulls in flatcar/ue-rs#72, flatcar/ue-rs#84, flatcar/ue-rs#85, flatcar/ue-rs#87, flatcar/ue-rs#88, flatcar/ue-rs#90. Signed-off-by: Dongsu Park <dongsu@dpark.io>
Pulls in flatcar/ue-rs#72, flatcar/ue-rs#84, flatcar/ue-rs#85, flatcar/ue-rs#87, flatcar/ue-rs#88, flatcar/ue-rs#90. Signed-off-by: Dongsu Park <dongsu@dpark.io>
Pulls in flatcar/ue-rs#72, flatcar/ue-rs#84, flatcar/ue-rs#85, flatcar/ue-rs#87, flatcar/ue-rs#88, flatcar/ue-rs#90. Signed-off-by: Dongsu Park <dongsu@dpark.io>
When --input-xml is on and --payload-url is off to pass XML data offline, we need to set payload_url to None and continue running the DownloadVerify builder instead of returning there. It is necessary to fix regressions of #87. Signed-off-by: Dongsu Park <dongsu@dpark.io>
Before PR #87, target_filename was almost always `None`, which had covered an issue of setting pkg_verified. In case of target_filename being a valid String, for example "oem-azure.gz", pkg_verified ended up having an extension `.gz`, which is not expected. Now that the PR was merged, DownloadVerify module gets created with .target_filename(args.target_filename.unwrap_or(TARGET_FILENAME_DEFAULT.into())), where TARGET_FILENAME_DEFAULT is with ".gz" extension. That uncovered the hidden issue. Fix that with explicitly setting extension ".raw" for both a valid String and None for the input string. Signed-off-by: Dongsu Park <dongsu@dpark.io>
When --input-xml is on and --payload-url is off to pass XML data offline, we need to set payload_url to None and continue running the DownloadVerify builder instead of returning there. It is necessary to fix regressions of #87. Signed-off-by: Dongsu Park <dongsu@dpark.io>
To be able to make package-related structs and enums public,
PackageandPackageStatus, create a new moduledownload, movedownload.rstodownload/mod.rs, createdownload/packge.rsthat includes all package-related structs and enums.To make download and verify functions of
download_sysextusable by other modules, move most code parts into the newdownloadmodule.It is a preparation for the server-client architecture issue, #75 which I am working on.