Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package roast for openSUSE:Factory checked in at 2025-06-20 16:49:37 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/roast (Old) and /work/SRC/openSUSE:Factory/.roast.new.31170 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "roast" Fri Jun 20 16:49:37 2025 rev:11 rq:1286895 version:8.1.5 Changes: -------- --- /work/SRC/openSUSE:Factory/roast/roast.changes 2025-06-18 17:59:22.484120429 +0200 +++ /work/SRC/openSUSE:Factory/.roast.new.31170/roast.changes 2025-06-20 16:51:16.320882318 +0200 @@ -1,0 +2,33 @@ +Thu Jun 19 10:15:20 UTC 2025 - Soc Virnyl Estela <uncomfyhaloma...@opensuse.org> + +- Update to version 8.1.5: + * chore(release): bump to v8.1.5 + * fix: just add one newline lol + +------------------------------------------------------------------- +Thu Jun 19 09:44:04 UTC 2025 - Soc Virnyl Estela <uncomfyhaloma...@opensuse.org> + +- Update to version 8.1.4: + * chore(release): v8.1.4 + * fix: finally properly fix adding the newline. + * chore(release): v8.1.3 + * fix: add newline at the end of the file properly + * chore(release): bump to v8.1.2 + * tests: switch test case from deno to river + * format: run `cargo +nightly fmt` + * tests: add deno and jay, they're known to contain submodules + * fix: update submodule logic if in case the submodule path does not exist. + +------------------------------------------------------------------- +Thu Jun 19 08:28:04 UTC 2025 - Soc Virnyl Estela <uncomfyhaloma...@opensuse.org> + +- Update to version 8.1.1: + * chore(release): bump to v8.1.1 + * docs: renaming scheme is now "better" + * docs: the `.changes` filename is based on the filename without the version part. + * docs: clarify what the header is for + * docs: fix grammar here + * docs: update README + * docs: fix README.md. `obs` feature flag only updates the version in the specfile. + +------------------------------------------------------------------- @@ -332,2 +364,0 @@ - - Old: ---- roast-8.1.0.tar.zst New: ---- roast-8.1.5.tar.zst ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ roast.spec ++++++ --- /var/tmp/diff_new_pack.26OyvH/_old 2025-06-20 16:51:17.040912096 +0200 +++ /var/tmp/diff_new_pack.26OyvH/_new 2025-06-20 16:51:17.044912262 +0200 @@ -17,7 +17,7 @@ Name: roast -Version: 8.1.0 +Version: 8.1.5 Release: 0 Summary: Simpler tar archiver and extractor License: MPL-2.0 ++++++ _service ++++++ --- /var/tmp/diff_new_pack.26OyvH/_old 2025-06-20 16:51:17.080913751 +0200 +++ /var/tmp/diff_new_pack.26OyvH/_new 2025-06-20 16:51:17.080913751 +0200 @@ -1,7 +1,7 @@ <services> <service name="cargo_vendor" mode="manual"> <param name="url">https://codeberg.org/Rusty-Geckos/roast</param> - <param name="revision">v8.1.0</param> + <param name="revision">main</param> <param name="versionrewriteregex">v(.*)</param> <param name="versionrewritepattern">${1}</param> <param name="changesgenerate">true</param> ++++++ roast-8.1.0.tar.zst -> roast-8.1.5.tar.zst ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/roast-8.1.0/CHANGELOG.md new/roast-8.1.5/CHANGELOG.md --- old/roast-8.1.0/CHANGELOG.md 1970-01-01 01:00:00.000000000 +0100 +++ new/roast-8.1.5/CHANGELOG.md 1970-01-01 01:00:00.000000000 +0100 @@ -2,6 +2,66 @@ All notable changes to this project will be documented in this file. +## [8.1.5] - 2025-06-19 + +### Bug Fixes + +- Just add one newline lol [d237ec6](https://codeberg.org/Rusty-Geckos/roast/commit/d237ec6be30eb4c6e373a73987059461e6b776b8) + +## [8.1.4] - 2025-06-19 + +### Bug Fixes + +- Finally properly fix adding the newline. [5815417](https://codeberg.org/Rusty-Geckos/roast/commit/58154175cfe07c9bd10673db1a45788f88bf3d32) + +### Miscellaneous Tasks + +- V8.1.4 [8bc664a](https://codeberg.org/Rusty-Geckos/roast/commit/8bc664a58f9f8d0645cb7816bd2dcb0f3900afbc) + +## [8.1.3] - 2025-06-19 + +### Bug Fixes + +- Add newline at the end of the file properly [f131e45](https://codeberg.org/Rusty-Geckos/roast/commit/f131e455890bf2162898685cdc53655cf905e140) + +### Miscellaneous Tasks + +- V8.1.3 [e540816](https://codeberg.org/Rusty-Geckos/roast/commit/e5408167c6cb2214d9fc3b826d618502b25f44fd) + +## [8.1.2] - 2025-06-18 + +### Bug Fixes + +- Update submodule logic if in case the submodule path does not exist. [987695b](https://codeberg.org/Rusty-Geckos/roast/commit/987695be719e62d857503a2b649722c72a04bf53) + +### Miscellaneous Tasks + +- Bump to v8.1.2 [3655a2a](https://codeberg.org/Rusty-Geckos/roast/commit/3655a2a9c03014b446db028a5c19bf223b0a5b3d) + +### Other + +- Run `cargo +nightly fmt` [aafe93e](https://codeberg.org/Rusty-Geckos/roast/commit/aafe93e697fb829b5f6add2beda5bd5d6065c4b8) + +### Testing + +- Switch test case from deno to river [eb5f1ff](https://codeberg.org/Rusty-Geckos/roast/commit/eb5f1ff4f08c666b145015441d6fa0d20734baff) +- Add deno and jay, they're known to contain submodules [d923e42](https://codeberg.org/Rusty-Geckos/roast/commit/d923e428f2b62697df0b2d267ded8a05c12b5286) + +## [8.1.1] - 2025-06-15 + +### Documentation + +- Renaming scheme is now "better" [abe7353](https://codeberg.org/Rusty-Geckos/roast/commit/abe735342639007f70634564e4978f654f9c4350) +- The `.changes` filename is based on the filename without the version part. [91a6658](https://codeberg.org/Rusty-Geckos/roast/commit/91a66583a4e4a1f74b15f5e339aa4427c93f4ef1) +- Clarify what the header is for [4db561a](https://codeberg.org/Rusty-Geckos/roast/commit/4db561a5bd54e61527a90411a908e9aa84c54bb3) +- Fix grammar here [03d2d42](https://codeberg.org/Rusty-Geckos/roast/commit/03d2d426faf87f49c0b214597add3ea5224f5ae9) +- Update README [d31b41a](https://codeberg.org/Rusty-Geckos/roast/commit/d31b41a541a5c323d5faf67dde82c5b79d4d68de) +- Fix README.md. `obs` feature flag only updates the version in the specfile. [cd865b8](https://codeberg.org/Rusty-Geckos/roast/commit/cd865b858a52cc3575a449613c2864cfaef469b5) + +### Miscellaneous Tasks + +- Bump to v8.1.1 [df1f31c](https://codeberg.org/Rusty-Geckos/roast/commit/df1f31cd04308302555f97f67650d1f20322df09) + ## [8.1.0] - 2025-06-15 ### Bug Fixes @@ -27,6 +87,10 @@ - Feature obs will just call `set_version_in_specfile`. [2cee767](https://codeberg.org/Rusty-Geckos/roast/commit/2cee7671bc5fd132c4ed31fd1df5ce351d42c54e) +### Miscellaneous Tasks + +- Bump to v8.1.0 [8a7e57f](https://codeberg.org/Rusty-Geckos/roast/commit/8a7e57fab8e2350374ff0f3c19b5b7630fa91628) + ### Other - Run `cargo +nightly fmt` [75fe51a](https://codeberg.org/Rusty-Geckos/roast/commit/75fe51acfdd3f7d35d6ebdd12a14a52a2244308f) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/roast-8.1.0/Cargo.lock new/roast-8.1.5/Cargo.lock --- old/roast-8.1.0/Cargo.lock 1970-01-01 01:00:00.000000000 +0100 +++ new/roast-8.1.5/Cargo.lock 1970-01-01 01:00:00.000000000 +0100 @@ -78,9 +78,9 @@ [[package]] name = "autocfg" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" +checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" [[package]] name = "backtrace" @@ -655,9 +655,9 @@ [[package]] name = "libc" -version = "0.2.173" +version = "0.2.174" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8cfeafaffdbc32176b64fb251369d52ea9f0a8fbc6f8759edffef7b525d64bb" +checksum = "1171693293099992e19cddea4e8b849964e9846f4acee11b3948bcc337be8776" [[package]] name = "libgit2-sys" @@ -692,7 +692,7 @@ [[package]] name = "libroast" -version = "8.1.0" +version = "8.1.5" dependencies = [ "bzip2", "clap", @@ -961,9 +961,9 @@ [[package]] name = "r-efi" -version = "5.2.0" +version = "5.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74765f6d916ee2faa39bc8e68e4f3ed8949b48cccdac59983d287a7cb71ce9c5" +checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" [[package]] name = "rand" @@ -1055,7 +1055,7 @@ [[package]] name = "roast-cli" -version = "8.1.0" +version = "8.1.5" dependencies = [ "clap", "libroast", @@ -1319,9 +1319,9 @@ [[package]] name = "tracing-attributes" -version = "0.1.29" +version = "0.1.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b1ffbcf9c6f6b99d386e7444eb608ba646ae452a36b39737deb9663b610f662" +checksum = "81383ab64e72a7a8b8e13130c49e3dab29def6d0c7d76a03087b3cf71c5c6903" dependencies = [ "proc-macro2", "quote", diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/roast-8.1.0/Cargo.toml new/roast-8.1.5/Cargo.toml --- old/roast-8.1.0/Cargo.toml 1970-01-01 01:00:00.000000000 +0100 +++ new/roast-8.1.5/Cargo.toml 1970-01-01 01:00:00.000000000 +0100 @@ -1,6 +1,6 @@ [workspace.package] authors = ["Soc Virnyl Estela"] -version = "8.1.0" +version = "8.1.5" edition = "2024" license = "MPL-2.0" repository = "https://codeberg.org/Rusty-Geckos/roast" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/roast-8.1.0/README.md new/roast-8.1.5/README.md --- old/roast-8.1.0/README.md 1970-01-01 01:00:00.000000000 +0100 +++ new/roast-8.1.5/README.md 1970-01-01 01:00:00.000000000 +0100 @@ -78,24 +78,29 @@ ## Roast SCM - How it works `roast_scm` is an extended utility of `roast`. Its purpose is to create tarballs from a -remote repository. The behaviour is similar to `roast` but only at some point. +remote repository. It uses `roast` under the hood. -### With OBS Feature enabled +### Naming and Versioning > [!NOTE] -> This feature is to be used only for [OBS](https://openbuildservice.org/) and only affects -> the `roast_scm` library and binary. +> The naming mechanism follows a certain logic: +> - get the last segment of the git URL e.g. <https://codeberg.org/Rusty-Geckos/roast.git>'s last segment is "roast". `.git` will be removed. +> - get the recent git tag if there is, otherwise, get the number of commits since revision. Format it to follow <https://en.opensuse.org/openSUSE:Package_versioning_guidelines>. > -> Do remember that `raw`, `roast`, and `recomprizz` can be used for OBS even without the feature flag. +> **The explanation is done in reverse as you read further below so you can easily grasp the logic**. -If `roast-cli` was compiled with `obs` feature, you can *rewrite* the "revision" part -of the filename. Since versions in a specfile should be in this format, `a.b.c`, where -`a` must be a numeric string while `b` and `c` can be alphanumeric, a revision such -as a tag with names like `v7.0.0` is not considered a valid version string, despite -that it obviously indicates a version. +You can *rewrite* the "revision" part of the filename. Since versions in +a specfile should be in this format, `a.b.c`, where `a` must be a numeric +string while `b` and `c` can be alphanumeric, a revision such as a tag with +names like `v7.0.0` is not considered a valid version string, despite that +it obviously indicates a version. + +> A **specfile or RPM specfile** is a packaging build "recipe", specifically tailored for RPM-based +> distributions such as openSUSE, and Fedora. It contains metadata and instructions of how +> a software is packaged into the distribution. To make it a valid version string for a specfile, the `versionrewriteregex` -must have a value like `^v?(.*)` (cause sometimes, the developer forgots to add a letter "v"). +must have a value like `^v?(.*)` (cause sometimes, the developer forgets to add a letter "v"). Then rearrange the string based on the regex by indicating the capture groups. You can pass this pattern of rearrangement to replace the old string value to `versionrewritepattern`. The value for `versionrewritepattern` is "$1". @@ -108,8 +113,8 @@ > Capture groups are denoted by `$` and a number based on their position > from other capture groups starting from the left-most side of the string. -Since `roast_scm` is intended to be an OBS Service, -an example `_service` file for this scenario will look like this. +Since `roast_scm` is intended to be an OBS Service, an example `_service` file for +this scenario will look like this. ```xml <services> @@ -122,34 +127,51 @@ </services> ``` +> A service file is another kind of "recipe". It contains a set of services with options configured in XML format. +> Each service has parameters to pass values that change how the command behaves. + In case that it is impossible to create a valid version, you can hard-code it using the `set-version` flag. There is also a `set-name` flag to hard-code the filename. This will only rename the filename excluding the file extension. +The resulting hard-coded name and version will follow the format like this: +`<set-name>-<set-version>.tar.gz`, without the angled brackets. + +If the set-name value is missing, then it will try to set the name from the **last +segment** of the Git URL. For example, the URL <https://codeberg.org/Rusty-Geckos/roast> +and <https://codeberg.org/Rusty-Geckos/roast.git> will both have a "roast" name. + +If the set-version value is missing, it will try to either create a +version from a recent git tag. Otherwise, it will be just the number of +commits since revision with a format `0+git<N>` where `N` is the number of +commits, and without the angled brackets. The versioning format follows the +<https://en.opensuse.org/openSUSE:Package_versioning_guidelines>. > [!NOTE] > One can use `outfile` flag to hard code the FULL filename. -#### Changelog generation +> [!WARNING] +> There are some projects that do not follow the convention that git tags +> are for versions e.g. [wezterm](https://github.com/wezterm/wezterm). If that's +> the case, your best option for setting the version in the output tarball's filename +> is to hard-code the version. + +### Changelog generation Optionally, you can pass a value to `changesgenerate`, either `true` or `false`. -If set to `true`, one must provide a value to `changesauthor`. This is to create -a timestamp + author as a changelog header. This contains a record of who generated -the tarball. There is an optional `changesemail` flag that you can use to pass -an email address as well. - -Just below the changelog header are the list of commit summaries from the git -repository. The list starts from the target revision until the most recent -tag. If there is no tag at all, it starts from the target revision until +If set to `true`, one must provide a value to `changesauthor`. This is to create a timestamp + author as a changelog +header. This contains a record of who recently modified the package sources. There is an optional `changesemail` +flag that you can use to pass an email address as well. + +Just below the changelog header are the list of commit summaries from the git repository. The list starts from +the target revision until the most recent tag. If there is no tag at all, it starts from the target revision until the first initial commit. -The resulting changelog filename is based on the resulting filename of the -generated tarball e.g. `source.tar.zst` will have a changelog filename of -`source.changes`. You can hard-code a full filename by passing a value to +The resulting changelog filename is based on the resulting filename EXCLUDING THE VERSION part of the generated tarball e.g. `source-1.0.1.tar.zst` +will have a changelog filename of `source.changes`. You can hard-code a full filename by passing a value to `changesoutfile`. -If the destination `.changes` file exists, the new changelog will be prepended -with the old contents of the file. +If the destination `.changes` file exists, the new changelog will be prepended with the old contents of the file. ## Raw - How it works @@ -160,7 +182,7 @@ `recomprizz` is a recompression utility. It utilises `roast` and `raw` under the hood. It extracts the target tarball before it creates a new tarball of a different compression option e.g. `source.tar.gz` -to `source.tar.zst`. The renaming scheme is too dumb and simple though, and not perfect—see note below. +to `source.tar.zst`. You might want to _rename_ the resulting output file with `recomprizz`. There are two flags you should know: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/roast-8.1.0/libroast/src/operations/roast_scm/mod.rs new/roast-8.1.5/libroast/src/operations/roast_scm/mod.rs --- old/roast-8.1.0/libroast/src/operations/roast_scm/mod.rs 1970-01-01 01:00:00.000000000 +0100 +++ new/roast-8.1.5/libroast/src/operations/roast_scm/mod.rs 1970-01-01 01:00:00.000000000 +0100 @@ -30,6 +30,7 @@ Object, Repository, Submodule, + SubmoduleUpdateOptions, build::RepoBuilder, }; use regex::Regex; @@ -323,21 +324,78 @@ io::Error::other(err.to_string()) })?; - submodules.iter_mut().try_for_each(|subm| update_submodule(subm))?; + submodules.iter_mut().try_for_each(|subm| update_submodule(&local_repository, subm))?; changelog_details_generate(&local_repository, &resulting_git_object) } -fn update_submodule(subm: &mut Submodule) -> io::Result<()> +fn update_submodule(local_repository: &Repository, subm: &mut Submodule) -> io::Result<()> { - subm.update(true, None).map_err(|err| { + let Some(local_clone_dir) = local_repository.workdir() + else + { + return Err(io::Error::new(io::ErrorKind::NotFound, "Repository workdir not found!")); + }; + let submodule_path_in_workdir = local_clone_dir.join(subm.path()); + info!("Cloning submodule at path: `{}`", submodule_path_in_workdir.display()); + let mut submodule_update_options = SubmoduleUpdateOptions::default(); + if !submodule_path_in_workdir.exists() + { + subm.init(true).map_err(|err| { + error!(?err); + error!("Error happened here in init"); + io::Error::other(err) + })?; + subm.repo_init(true).map_err(|err| { + error!(?err); + error!("Error happened here in repo init"); + io::Error::other(err) + })?; + subm.clone(Some(&mut submodule_update_options)).map_err(|err| { + error!(?err); + error!("Error happened here in clone"); + io::Error::other(err) + })?; + subm.add_finalize().map_err(|err| { + error!(?err); + error!("Error happened here in add_finalize"); + io::Error::other(err) + })?; + subm.sync().map_err(|err| { + error!(?err); + error!("Error happened here in add_finalize"); + io::Error::other(err) + })?; + subm.add_to_index(true).map_err(|err| { + error!(?err); + error!("Error happened here in index"); + io::Error::other(err) + })?; + } + else + { + // NOTE: The reason it's inside else-block is because + // the parent repository has not committed the "new" submodule. + // If we do remove put this outside the else-block, it will + // error that it could not find the ID of the submodule + subm.update(true, Some(&mut submodule_update_options)).map_err(|err| { + error!(?err); + error!("Error happened here in update"); + io::Error::other(err) + })?; + } + let subm_repo = subm.open().map_err(|err| { error!(?err); - io::Error::other(err.to_string()) + error!("Error happened here in open"); + io::Error::other(err) })?; - subm.open().map_err(|err| { + let mut subm_repo_submodules = subm_repo.submodules().map_err(|err| { error!(?err); - io::Error::other(err.to_string()) + io::Error::other(err) })?; + subm_repo_submodules + .iter_mut() + .try_for_each(|subm_repo_submodule| update_submodule(&subm_repo, subm_repo_submodule))?; Ok(()) } @@ -839,17 +897,17 @@ }?; let new_changes_to_append = format!("{}\n{}", update_statement, final_changelog_lines); + let mut final_changes_string_for_file: String; if !changes_string_from_file.contains(&new_changes_to_append) { - let mut final_changes_string_for_file = format!( + final_changes_string_for_file = format!( "{}\n\n{}{}", changelog_header, new_changes_to_append, changes_string_from_file ); + final_changes_string_for_file = + final_changes_string_for_file.trim_end().to_string(); + final_changes_string_for_file.push('\n'); - if !changes_string_from_file.trim().is_empty() - { - final_changes_string_for_file.push('\n'); - } std::fs::write(changesoutfile, &final_changes_string_for_file).inspect(|_| { info!( "🗒️ Successfully generated changelog to `{}`.", @@ -862,13 +920,11 @@ let lines_from_changes_file = changes_string_from_file.lines(); let new_changes_string_without_header_yet = lines_from_changes_file.skip(2).collect::<Vec<&str>>().join("\n"); - let mut final_changes_string_for_file = + final_changes_string_for_file = format!("{}\n{}", changelog_header, new_changes_string_without_header_yet); - - if !changes_string_from_file.trim().is_empty() - { - final_changes_string_for_file.push('\n'); - } + final_changes_string_for_file = + final_changes_string_for_file.trim_end().to_string(); + final_changes_string_for_file.push('\n'); std::fs::write(changesoutfile, &final_changes_string_for_file).inspect(|_| { info!( diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/roast-8.1.0/libroast/tests/scm.rs new/roast-8.1.5/libroast/tests/scm.rs --- old/roast-8.1.0/libroast/tests/scm.rs 1970-01-01 01:00:00.000000000 +0100 +++ new/roast-8.1.5/libroast/tests/scm.rs 1970-01-01 01:00:00.000000000 +0100 @@ -166,3 +166,163 @@ assert_eq!(hasher1.finalize(), hasher2.finalize()); Ok(()) } + +#[test] +fn repo_with_submodules_1() -> io::Result<()> +{ + let tmp_binding1 = tempfile::TempDir::new().map_err(|err| { + error!(?err, "Failed to create temporary directory"); + err + })?; + let tmp_binding2 = tempfile::TempDir::new().map_err(|err| { + error!(?err, "Failed to create temporary directory"); + err + })?; + let mut hasher1 = Keccak256::new(); + let mut hasher2 = Keccak256::new(); + let outdir1 = tmp_binding1.path(); + let outdir2 = tmp_binding2.path(); + let r1 = RoastScmArgs { + set_version: None, + set_name: None, + changesgenerate: false, + changesauthor: None, + changesemail: None, + changesoutfile: None, + git_repository_url: "https://codeberg.org/river/river".to_string(), + exclude: None, + revision: "v0.2.2".to_string(), + versionrewriteregex: None, + versionrewritepattern: None, + depth: 0, + is_temporary: true, + outfile: None, + outdir: Some(outdir1.to_path_buf()), + reproducible: true, + ignore_git: true, + ignore_hidden: false, + compression: libroast::common::Compression::default(), + }; + libroast::operations::roast_scm::roast_scm_opts(None, &r1, false)?; + let r2 = RoastScmArgs { + set_version: None, + set_name: None, + changesgenerate: false, + changesauthor: None, + changesemail: None, + changesoutfile: None, + git_repository_url: "https://codeberg.org/river/river".to_string(), + exclude: None, + revision: "v0.2.2".to_string(), + versionrewriteregex: None, + versionrewritepattern: None, + depth: 0, + is_temporary: true, + outfile: None, + outdir: Some(outdir2.to_path_buf()), + reproducible: true, + ignore_git: true, + ignore_hidden: false, + compression: libroast::common::Compression::default(), + }; + libroast::operations::roast_scm::roast_scm_opts(None, &r2, false)?; + let read_dir1 = read_dir(outdir1)?; + let read_dir2 = read_dir(outdir2)?; + let Some(file1) = read_dir1.flatten().find(|entry| entry.path().is_file()) + else + { + return Err(io::Error::new(io::ErrorKind::NotFound, "file1 not found.")); + }; + let Some(file2) = read_dir2.flatten().find(|entry| entry.path().is_file()) + else + { + return Err(io::Error::new(io::ErrorKind::NotFound, "file2 not found.")); + }; + assert_eq!(file1.file_name(), file2.file_name()); + let hash1 = read(file1.path())?; + let hash2 = read(file2.path())?; + hasher1.update(hash1); + hasher2.update(hash2); + assert_eq!(hasher1.finalize(), hasher2.finalize()); + Ok(()) +} + +#[test] +fn repo_with_submodules_2() -> io::Result<()> +{ + let tmp_binding1 = tempfile::TempDir::new().map_err(|err| { + error!(?err, "Failed to create temporary directory"); + err + })?; + let tmp_binding2 = tempfile::TempDir::new().map_err(|err| { + error!(?err, "Failed to create temporary directory"); + err + })?; + let mut hasher1 = Keccak256::new(); + let mut hasher2 = Keccak256::new(); + let outdir1 = tmp_binding1.path(); + let outdir2 = tmp_binding2.path(); + let r1 = RoastScmArgs { + set_version: None, + set_name: None, + changesgenerate: false, + changesauthor: None, + changesemail: None, + changesoutfile: None, + git_repository_url: "https://github.com/mahkoh/jay".to_string(), + exclude: None, + revision: "master".to_string(), + versionrewriteregex: None, + versionrewritepattern: None, + depth: 0, + is_temporary: true, + outfile: None, + outdir: Some(outdir1.to_path_buf()), + reproducible: true, + ignore_git: true, + ignore_hidden: false, + compression: libroast::common::Compression::default(), + }; + libroast::operations::roast_scm::roast_scm_opts(None, &r1, false)?; + let r2 = RoastScmArgs { + set_version: None, + set_name: None, + changesgenerate: false, + changesauthor: None, + changesemail: None, + changesoutfile: None, + git_repository_url: "https://github.com/mahkoh/jay".to_string(), + exclude: None, + revision: "master".to_string(), + versionrewriteregex: None, + versionrewritepattern: None, + depth: 0, + is_temporary: true, + outfile: None, + outdir: Some(outdir2.to_path_buf()), + reproducible: true, + ignore_git: true, + ignore_hidden: false, + compression: libroast::common::Compression::default(), + }; + libroast::operations::roast_scm::roast_scm_opts(None, &r2, false)?; + let read_dir1 = read_dir(outdir1)?; + let read_dir2 = read_dir(outdir2)?; + let Some(file1) = read_dir1.flatten().find(|entry| entry.path().is_file()) + else + { + return Err(io::Error::new(io::ErrorKind::NotFound, "file1 not found.")); + }; + let Some(file2) = read_dir2.flatten().find(|entry| entry.path().is_file()) + else + { + return Err(io::Error::new(io::ErrorKind::NotFound, "file2 not found.")); + }; + assert_eq!(file1.file_name(), file2.file_name()); + let hash1 = read(file1.path())?; + let hash2 = read(file2.path())?; + hasher1.update(hash1); + hasher2.update(hash2); + assert_eq!(hasher1.finalize(), hasher2.finalize()); + Ok(()) +} ++++++ vendor.tar.zst ++++++ /work/SRC/openSUSE:Factory/roast/vendor.tar.zst /work/SRC/openSUSE:Factory/.roast.new.31170/vendor.tar.zst differ: char 7, line 1