diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 4d74868..4da0168 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,6 +1,6 @@ # Contributing -Thank you for considering to contribute to `pacdef`. The recommended workflow is +Thank you for considering to contribute to `metapac`. The recommended workflow is this: 1. Open a github issue, mention that you would like to fix the issue in a PR. diff --git a/Cargo.lock b/Cargo.lock index 616e35c..67ac420 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -507,6 +507,31 @@ version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" +[[package]] +name = "metapac" +version = "1.6.0" +dependencies = [ + "assert_cmd", + "clap", + "color-eyre", + "derive_more", + "dialoguer", + "dirs", + "home", + "hostname", + "itertools", + "libc", + "log", + "pretty_env_logger", + "regex", + "serde", + "serde-inline-default", + "serde_json", + "toml", + "toml_edit", + "walkdir", +] + [[package]] name = "miniz_oxide" version = "0.7.4" @@ -543,31 +568,6 @@ version = "3.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c1b04fb49957986fdce4d6ee7a65027d55d4b6d2265e5848bbb507b58ccfdb6f" -[[package]] -name = "pacdef" -version = "1.6.0" -dependencies = [ - "assert_cmd", - "clap", - "color-eyre", - "derive_more", - "dialoguer", - "dirs", - "home", - "hostname", - "itertools", - "libc", - "log", - "pretty_env_logger", - "regex", - "serde", - "serde-inline-default", - "serde_json", - "toml", - "toml_edit", - "walkdir", -] - [[package]] name = "pin-project-lite" version = "0.2.14" diff --git a/Cargo.toml b/Cargo.toml index 9a20380..2a0d34a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,10 +1,10 @@ [package] -name = "pacdef" +name = "metapac" description = "multi-backend declarative package manager" version = "1.6.0" edition = "2021" license = "GPL-3.0-or-later" -repository = "https://github.com/steven-omaha/pacdef" +repository = "https://github.com/steven-omaha/metapac" readme = "README.md" keywords = ["package-manager", "linux", "declarative", "cli"] categories = ["command-line-utilities"] @@ -18,7 +18,7 @@ log = { version = "0.4.22", features = ["std"] } serde = { version = "1.0.210", features = ["derive"] } serde_json = "1.0.131" toml = "0.8.19" -derive_more = {version = "1.0.0", features = ["full"]} +derive_more = { version = "1.0.0", features = ["full"] } itertools = "0.13.0" dirs = "5.0.1" home = "0.5.9" diff --git a/README.md b/README.md index ae52433..2bc6344 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# pacdef +# metapac multi-backend declarative package manager @@ -6,29 +6,29 @@ multi-backend declarative package manager ### Cargo -To install `pacdef` using cargo: +To install `metapac` using cargo: ```bash -cargo install pacdef --git https://github.com/ripytide/pacdef +cargo install metapac --git https://github.com/ripytide/metapac ``` ## Use-case -`pacdef` allows the user to have consistent packages among multiple +`metapac` allows the user to have consistent packages among multiple Linux machines and different backends by managing packages in group files. The idea is that (1) any package in the group files ("managed packages") will be installed explicitly, and (2) explicitly installed packages _not_ found in any of the group files ("unmanaged packages") -will be removed. The group files are maintained outside of `pacdef` by +will be removed. The group files are maintained outside of `metapac` by any VCS, like git. If you work with multiple Linux machines and have asked yourself "_Why do I have the program that I use every day on my other machine not -installed here?_", then `pacdef` is the tool for you. +installed here?_", then `metapac` is the tool for you. ## Multi-Backend -`pacdef` is a sort of meta package manager in that it does not +`metapac` is a sort of meta package manager in that it does not directly possess the functionality to install packages on your system, instead it provides a single standardised interface for a whole bunch of other non-meta package managers. See the [Supported @@ -37,13 +37,13 @@ supported backend package managers. ## Declarative -`pacdef` is a declarative package manager, that means that you declare +`metapac` is a declarative package manager, that means that you declare in `.toml` group files the packages you would like installed on your -system and then run one of the `pacdef` commands which read these +system and then run one of the `metapac` commands which read these group files and then operate on your system to do some function such as install packages in your group files that are not present on your -system yet (`pacdef sync`), or remove packages present on your system -but not in your group files (`pacdef clean`). +system yet (`metapac sync`), or remove packages present on your system +but not in your group files (`metapac clean`). ## Supported Backends @@ -64,17 +64,17 @@ additional backends are welcome! ## Config ```toml -# The pacdef config.toml file is expected in the -# XDG_CONFIG_HOME/pacdef directory (usually ~/.config/pacdef/config.toml) +# The metapac config.toml file is expected in the +# XDG_CONFIG_HOME/metapac directory (usually ~/.config/metapac/config.toml) # unless using the --config-dir cli option. # To decide which group files are relevant for the current machine -# pacdef uses the machine's hostname in the hostname_groups table in +# metapac uses the machine's hostname in the hostname_groups table in # the config file to get a list of group file names. # Since pacman, yay and paru all operate on the same package database # they are mutually exclusive and so you must pick which one you want -# pacdef to use. +# metapac to use. # Must be one of: ["pacman", "paru", "yay"] # Default: "pacman" arch_package_manager = "paru" @@ -83,7 +83,7 @@ arch_package_manager = "paru" # Default: true flatpak_systemwide = true -# Backends to disable from all pacdef behavior. See the README.md for +# Backends to disable from all metapac behavior. See the README.md for # the list of backend names # Default: [] disabled_backends = ["apt"] @@ -106,7 +106,7 @@ server = ["example_group"] ```toml # Group files (like this one) should be placed in the -# XDG_CONFIG_HOME/pacdef directory (usually ~/.config/pacdef/config.toml) +# XDG_CONFIG_HOME/metapac directory (usually ~/.config/metapac/config.toml) # unless using the --config-dir cli option. # # The packages for each backend in group files can come in two formats, short-form @@ -120,40 +120,40 @@ server = ["example_group"] # # For example, the following two packages are equivalent: # arch = [ -# "pacdef", -# { package = "pacdef" } +# "metapac", +# { package = "metapac" } # ] arch = [ - "pacdef", + "metapac", # optional_deps: additional packages to install with this package, short-form syntax only - { package = "pacdef", optional_deps = ["git"] } + { package = "metapac", optional_deps = ["git"] } ] cargo = [ - "pacdef", + "metapac", # see cargo docs for info on the options - { package = "pacdef", git = "https://github.com/ripytide/pacdef", all_features = true, no_default_features = false, features = [ "feature1", ] }, + { package = "metapac", git = "https://github.com/ripytide/metapac", all_features = true, no_default_features = false, features = [ "feature1", ] }, ] pipx = [ - "pacdef", - { package = "pacdef" } + "metapac", + { package = "metapac" } ] apt = [ - "pacdef", - { package = "pacdef" } + "metapac", + { package = "metapac" } ] xbps = [ - "pacdef", - { package = "pacdef" } + "metapac", + { package = "metapac" } ] flatpak = [ - "pacdef", - { package = "pacdef" } + "metapac", + { package = "metapac" } ] dnf = [ - "pacdef", + "metapac", # see dnf docs for more info on these options - { package = "pacdef", repo = "/etc/yum.repos.d/fedora_extras.repo" }, + { package = "metapac", repo = "/etc/yum.repos.d/fedora_extras.repo" }, ] rustup = [ "stable", @@ -164,12 +164,12 @@ rustup = [ ## Commands -Run `pacdef -h` to see an overview of the commands available with -`pacdef`. +Run `metapac -h` to see an overview of the commands available with +`metapac`. ## Naming -`pacdef` combines the words "package" and "define". +`metapac` combines the words "package" and "define". ## Backend Pitfalls diff --git a/config.toml b/config.toml index 1721400..205ce70 100644 --- a/config.toml +++ b/config.toml @@ -1,14 +1,14 @@ -# The pacdef config.toml file is expected in the -# XDG_CONFIG_HOME/pacdef directory (usually ~/.config/pacdef/config.toml) +# The metapac config.toml file is expected in the +# XDG_CONFIG_HOME/metapac directory (usually ~/.config/metapac/config.toml) # unless using the --config-dir cli option. # To decide which group files are relevant for the current machine -# pacdef uses the machine's hostname in the hostname_groups table in +# metapac uses the machine's hostname in the hostname_groups table in # the config file to get a list of group file names. # Since pacman, yay and paru all operate on the same package database # they are mutually exclusive and so you must pick which one you want -# pacdef to use. +# metapac to use. # Must be one of: ["pacman", "paru", "yay"] # Default: "pacman" arch_package_manager = "paru" @@ -17,7 +17,7 @@ arch_package_manager = "paru" # Default: true flatpak_systemwide = true -# Backends to disable from all pacdef behavior. See the README.md for +# Backends to disable from all metapac behavior. See the README.md for # the list of backend names # Default: [] disabled_backends = ["apt"] diff --git a/groups/example_group.toml b/groups/example_group.toml index 77d61d8..d7e07f7 100644 --- a/groups/example_group.toml +++ b/groups/example_group.toml @@ -1,5 +1,5 @@ # Group files (like this one) should be placed in the -# XDG_CONFIG_HOME/pacdef directory (usually ~/.config/pacdef/config.toml) +# XDG_CONFIG_HOME/metapac directory (usually ~/.config/metapac/config.toml) # unless using the --config-dir cli option. # # The packages for each backend in group files can come in two formats, short-form @@ -13,40 +13,40 @@ # # For example, the following two packages are equivalent: # arch = [ -# "pacdef", -# { package = "pacdef" } +# "metapac", +# { package = "metapac" } # ] arch = [ - "pacdef", + "metapac", # optional_deps: additional packages to install with this package, short-form syntax only - { package = "pacdef", optional_deps = ["git"] } + { package = "metapac", optional_deps = ["git"] } ] cargo = [ - "pacdef", + "metapac", # see cargo docs for info on the options - { package = "pacdef", git = "https://github.com/ripytide/pacdef", all_features = true, no_default_features = false, features = [ "feature1", ] }, + { package = "metapac", git = "https://github.com/ripytide/metapac", all_features = true, no_default_features = false, features = [ "feature1", ] }, ] pipx = [ - "pacdef", - { package = "pacdef" } + "metapac", + { package = "metapac" } ] apt = [ - "pacdef", - { package = "pacdef" } + "metapac", + { package = "metapac" } ] xbps = [ - "pacdef", - { package = "pacdef" } + "metapac", + { package = "metapac" } ] flatpak = [ - "pacdef", - { package = "pacdef" } + "metapac", + { package = "metapac" } ] dnf = [ - "pacdef", + "metapac", # see dnf docs for more info on these options - { package = "pacdef", repo = "/etc/yum.repos.d/fedora_extras.repo" }, + { package = "metapac", repo = "/etc/yum.repos.d/fedora_extras.repo" }, ] rustup = [ "stable", diff --git a/src/cli.rs b/src/cli.rs index 3b7bb81..490d118 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -74,5 +74,5 @@ pub struct SyncCommand { #[derive(Args)] #[command(visible_alias("u"))] -/// show explicitly installed packages not managed by pacdef +/// show explicitly installed packages not managed by metapac pub struct UnmanagedCommand {} diff --git a/src/config.rs b/src/config.rs index 1b0f032..fa2b982 100644 --- a/src/config.rs +++ b/src/config.rs @@ -34,8 +34,8 @@ impl Default for Config { } impl Config { - pub fn load(pacdef_dir: &Path) -> Result { - let config_file_path = pacdef_dir.join("config.toml"); + pub fn load(config_dir: &Path) -> Result { + let config_file_path = config_dir.join("config.toml"); if !config_file_path.is_file() { log::trace!( diff --git a/src/core.rs b/src/core.rs index 7f78a0d..380d578 100644 --- a/src/core.rs +++ b/src/core.rs @@ -23,8 +23,8 @@ impl MainArguments { x } else { dirs::config_dir() - .map(|path| path.join("pacdef/")) - .ok_or(eyre!("getting the default pacdef config directory"))? + .map(|path| path.join("metapac/")) + .ok_or(eyre!("getting the default metapac config directory"))? }; let group_dir = config_dir.join("groups/"); diff --git a/src/main.rs b/src/main.rs index 256e633..a959a7b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,4 +1,4 @@ -//! Main program for `pacdef`. +//! Main program for `metapac`. #![warn( clippy::as_conversions, @@ -16,7 +16,7 @@ use clap::Parser; use color_eyre::Result; -use pacdef::MainArguments; +use metapac::MainArguments; fn main() -> Result<()> { pretty_env_logger::formatted_builder() diff --git a/tests/cli_tests.rs b/tests/cli_tests.rs index 2dbaa7e..b249dca 100644 --- a/tests/cli_tests.rs +++ b/tests/cli_tests.rs @@ -3,7 +3,7 @@ use std::process::Command; #[test] fn unmanaged() { - let mut cmd = Command::cargo_bin("pacdef").unwrap(); + let mut cmd = Command::cargo_bin("metapac").unwrap(); cmd.args(["--hostname", "pc", "--config-dir", ".", "unmanaged"]); cmd.assert().success(); }