From 1b7b08d6c35bcb14482357fef67058259ab0d04d Mon Sep 17 00:00:00 2001 From: Wildan M Date: Sun, 2 Nov 2025 18:57:30 +0700 Subject: [PATCH 1/2] Set default GNU FTP mirror --- README.md | 5 +++-- recipes/libs/libiconv/recipe.toml | 2 +- recipes/tools/gettext/recipe.toml | 2 +- recipes/wip/dev/other/gperf/recipe.toml | 2 +- src/config.rs | 8 ++++++++ 5 files changed, 14 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 04e10b340..2c5a6da37 100644 --- a/README.md +++ b/README.md @@ -41,9 +41,10 @@ Cookbook has special config to avoid repetitive args, place this file into `cook #verbose = true [mirrors] +# The uncommented option below is the default if [mirrors] is not set # see list of GNU FTP mirrors at https://www.gnu.org/prep/ftp.en.html -"ftp.gnu.org/gnu" = "example.com/gnu" -"github.com/foo/bar" = "github.com/baz/bar" +"ftp.gnu.org/gnu" = "mirrors.ocf.berkeley.edu/gnu" +# "github.com/foo/bar" = "github.com/baz/bar" ``` ### Recipe Categories diff --git a/recipes/libs/libiconv/recipe.toml b/recipes/libs/libiconv/recipe.toml index bce6869a8..a70ef8268 100644 --- a/recipes/libs/libiconv/recipe.toml +++ b/recipes/libs/libiconv/recipe.toml @@ -1,5 +1,5 @@ [source] -tar = "https://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.17.tar.gz" +tar = "https://ftp.gnu.org/gnu/libiconv/libiconv-1.17.tar.gz" blake3 = "820b3b9fd3e2181bfb95475f01e9a3451e6d751e4f8c98ebcdcca1d8aa720f7f" patches = [ "01_redox.patch" diff --git a/recipes/tools/gettext/recipe.toml b/recipes/tools/gettext/recipe.toml index c50a5fb1c..af6676d16 100644 --- a/recipes/tools/gettext/recipe.toml +++ b/recipes/tools/gettext/recipe.toml @@ -1,7 +1,7 @@ # GNU gettext utilities are a set of tools that provides a framework to help # other GNU packages produce multi-lingual messages. [source] -tar = "https://ftp.gnu.org/pub/gnu/gettext/gettext-0.22.5.tar.gz" +tar = "https://ftp.gnu.org/gnu/gettext/gettext-0.22.5.tar.gz" blake3 = "cb3f3a34da7ce1a92746df81f5b78c5d53841973a24eb80ab76537263d380ec0" patches = [ "redox.patch" diff --git a/recipes/wip/dev/other/gperf/recipe.toml b/recipes/wip/dev/other/gperf/recipe.toml index ff3a4c0bb..d15f30a48 100644 --- a/recipes/wip/dev/other/gperf/recipe.toml +++ b/recipes/wip/dev/other/gperf/recipe.toml @@ -1,5 +1,5 @@ #TODO compiled but not fully tested [source] -tar = "http://ftp.gnu.org/pub/gnu/gperf/gperf-3.1.tar.gz" +tar = "https://ftp.gnu.org/gnu/gperf/gperf-3.1.tar.gz" [build] template = "configure" diff --git a/src/config.rs b/src/config.rs index 27e42dd76..460fa43d0 100644 --- a/src/config.rs +++ b/src/config.rs @@ -84,6 +84,14 @@ pub fn init_config() { if config.cook_opt.nonstop.is_none() { config.cook_opt.nonstop = Some(extract_env("COOKBOOK_NONSTOP", false)); } + if config.mirrors.len() == 0 { + // The GNU FTP mirror below is automatically inserted for convenience + // You can choose other mirrors by setting it on cookbook.toml + config.mirrors.insert( + "ftp.gnu.org/gnu".to_string(), + "mirrors.ocf.berkeley.edu/gnu".to_string(), + ); + } config.cook = CookConfig::from(config.cook_opt.clone()); From 4453cb54cb6e7fe0ec7fa3294a73a28e85529539 Mon Sep 17 00:00:00 2001 From: Wildan M Date: Sun, 2 Nov 2025 19:03:55 +0700 Subject: [PATCH 2/2] Fix fmt --- src/bin/repo_builder.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bin/repo_builder.rs b/src/bin/repo_builder.rs index adcc2c713..400391bd5 100644 --- a/src/bin/repo_builder.rs +++ b/src/bin/repo_builder.rs @@ -126,7 +126,7 @@ fn publish_packages(recipe_list: Vec, repo_dir: String) -> anyhow::Resul pkgar::create( format!("{}/build/id_ed25519.toml", root), &appstream_pkg, - &appstream_root + &appstream_root, )?; } }