Skip to content

Commit

Permalink
rename pacdef to metapac
Browse files Browse the repository at this point in the history
  • Loading branch information
ripytide committed Oct 20, 2024
1 parent bc5b4de commit 02aabad
Show file tree
Hide file tree
Showing 11 changed files with 95 additions and 95 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
50 changes: 25 additions & 25 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -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"]
Expand All @@ -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"
Expand Down
72 changes: 36 additions & 36 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
# pacdef
# metapac

multi-backend declarative package manager

## Installation

### 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
Expand All @@ -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

Expand All @@ -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"
Expand All @@ -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"]
Expand All @@ -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
Expand All @@ -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",
Expand All @@ -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

Expand Down
10 changes: 5 additions & 5 deletions config.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand All @@ -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"]
Expand Down
34 changes: 17 additions & 17 deletions groups/example_group.toml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {}
4 changes: 2 additions & 2 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ impl Default for Config {
}

impl Config {
pub fn load(pacdef_dir: &Path) -> Result<Self> {
let config_file_path = pacdef_dir.join("config.toml");
pub fn load(config_dir: &Path) -> Result<Self> {
let config_file_path = config_dir.join("config.toml");

if !config_file_path.is_file() {
log::trace!(
Expand Down
4 changes: 2 additions & 2 deletions src/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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/");
Expand Down
Loading

0 comments on commit 02aabad

Please sign in to comment.