diff --git a/examples/repository/mlc.toml b/examples/repository/mlc.toml index 2a921f3..d2d37a4 100644 --- a/examples/repository/mlc.toml +++ b/examples/repository/mlc.toml @@ -20,5 +20,5 @@ repos = [ ] [repositories.urls] -crs = "https://github.com/crystal-linux/%repo%" -pkg = "https://github.com/crystal-linux/pkgbuild.%repo%" +crs = "https://github.com/crystal-linux/{}" +pkg = "https://github.com/crystal-linux/pkgbuild.{}" diff --git a/examples/workspace/mlc.toml b/examples/workspace/mlc.toml index f29b013..7c1a7d6 100644 --- a/examples/workspace/mlc.toml +++ b/examples/workspace/mlc.toml @@ -22,6 +22,6 @@ repos = [ ] [repositories.urls] -crs = "https://github.com/crystal-linux/%repo%" -aur = "https://aur.archlinux.org/%repo%" -nms = "https://github.com/not-my-segfault/%repo%" +crs = "https://github.com/crystal-linux/{}" +aur = "https://aur.archlinux.org/{}" +nms = "https://github.com/not-my-segfault/{}" diff --git a/src/internal/read.rs b/src/internal/read.rs index 4110d57..9a33bca 100644 --- a/src/internal/read.rs +++ b/src/internal/read.rs @@ -81,7 +81,7 @@ pub fn parse_cfg(verbose: bool) -> Config { urls_vec.push(url); } } - let url = urls_vec[0].replace("%repo%", &name); + let url = urls_vec[0].replace("{}", &name); // Counts instances of ! in the name, and totals a priority accordingly let priority = &split_struct.name.matches('!').count(); diff --git a/src/repository/config.rs b/src/repository/config.rs index 863d837..08b7150 100644 --- a/src/repository/config.rs +++ b/src/repository/config.rs @@ -14,31 +14,30 @@ mode = "" smart_pull = true [mode.repository] -# Only required when in repository mode, decides what to call the repository and relevant files +# Decides what to call the repository and relevant files name = "" -# Only required when in repository mode, decides whether to PGP sign built packages -sign = true -# Only required when in repository mode, decides whether to build packages if pull is successful +# Decides whether to build packages if package repo is updated on pull build_on_update = false +[mode.repository.signing] +# Decides whether or not to sign packages +enabled = true + [mode.workspace] # There are currently no options for workspace mode [repositories] -# An array of Git repositories to clone from, formatted url_index::repo_name(!) -# e.g. if you had URLs = [ "https://example.com/%repo%.git" ], 1::package would expand to https://example.com/package.git -# Repository mode only: Depending on the number of "!"s appended to the name, the priority of the package will be determined. More "!"s = higher priority = built first. -name = [ - "", - "" +# List of repositories formatted as id:name (priority is decided by the ! suffix, and decides package build order) +repos = [ + "aur:hello!", + "crs:malachite" ] -# An array of URLs to clone from, in the format https://example.com/%repo% (the %repo% is NOT optional and will be replaced with the name of the repository) -urls = [ - "", - "" -]"#; - +[repositories.urls] +# URL keys for repositories, with {} where the repository name would go +crs = "https://github.com/crystal-linux/{}" +aur = "https://aur.archlinux.org/{}" +"#; pub fn create(verbose: bool) { // Ensure current directory is empty if env::current_dir()