From 007ee0bc3534218b2d084f368444d96c16d9d7f9 Mon Sep 17 00:00:00 2001 From: Namilskyy Date: Sat, 27 Dec 2025 22:26:52 +0300 Subject: An integrated i2p router is being developed --- src/pkgtoolkit/build.rs | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) (limited to 'src/pkgtoolkit/build.rs') diff --git a/src/pkgtoolkit/build.rs b/src/pkgtoolkit/build.rs index a37cb05..8c5119c 100644 --- a/src/pkgtoolkit/build.rs +++ b/src/pkgtoolkit/build.rs @@ -110,7 +110,6 @@ impl BuildOperations for Package { Ok(()) } - /// Finds the build system file (e.g. Makefile, meson.build, CMakeLists.txt, Cargo.toml) /// based on the build system specified in the build metadata. /// @@ -123,19 +122,25 @@ impl BuildOperations for Package { /// /// A `Result` containing an `Option` which is `Some` if the build /// system file is found, and `None` otherwise. - fn find_makefile(&self, build_meta: &Build, search_dir: &Path) -> std::io::Result> { + fn find_makefile( + &self, + build_meta: &Build, + search_dir: &Path, + ) -> std::io::Result> { let (patterns, recursive) = match build_meta.build_system { BuildSystems::Make => (vec!["Makefile", "makefile", "GNUmakefile"], false), BuildSystems::Meson => (vec!["meson.build", "meson_options.txt"], true), BuildSystems::CMake => (vec!["CMakeLists.txt"], true), BuildSystems::Cargo => (vec!["Cargo.toml"], false), - _ => return Ok(None), }; for pattern in &patterns { - let glob_pattern = if recursive { - search_dir.join("**").join(pattern).to_string_lossy().into_owned() + search_dir + .join("**") + .join(pattern) + .to_string_lossy() + .into_owned() } else { search_dir.join(pattern).to_string_lossy().into_owned() }; @@ -144,13 +149,14 @@ impl BuildOperations for Package { .map_err(|e| std::io::Error::other(format!("Invalid glob pattern: {}", e)))?; for entry in entries { - let path = entry.map_err(|e| std::io::Error::other(format!("Glob error: {}", e)))?; + let path = + entry.map_err(|e| std::io::Error::other(format!("Glob error: {}", e)))?; return Ok(Some(path)); } } Ok(None) -} + } /// Execute the build script for the package. /// -- cgit v1.2.3