From bcefc4969aa4e40d8c5c158a2b7a26d73fc47f37 Mon Sep 17 00:00:00 2001 From: innocentzero Date: Fri, 12 Apr 2024 17:54:48 +0530 Subject: [PATCH] docs(fedora): Switches and show_package_info Add docstrings for the query switches and show_package_info functions. Signed-off-by: innocentzero --- crates/pacdef_core/src/backend/actual/fedora.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/crates/pacdef_core/src/backend/actual/fedora.rs b/crates/pacdef_core/src/backend/actual/fedora.rs index 0074065..c88915a 100644 --- a/crates/pacdef_core/src/backend/actual/fedora.rs +++ b/crates/pacdef_core/src/backend/actual/fedora.rs @@ -25,6 +25,8 @@ const SWITCHES_REMOVE: Switches = &["remove"]; const SUPPORTS_AS_DEPENDENCY: bool = false; +/// These switches are responsible for +/// getting the packages explicitly installed by the user const SWITCHES_FETCH_USER: Switches = &[ "repoquery", "--userinstalled", @@ -32,6 +34,8 @@ const SWITCHES_FETCH_USER: Switches = &[ "%{from_repo}/%{name}", ]; +/// These switches are responsible for +/// getting all the packages installed on the system const SWITCHES_FETCH_GLOBAL: Switches = &[ "repoquery", "--installed", @@ -39,7 +43,8 @@ const SWITCHES_FETCH_GLOBAL: Switches = &[ "%{from_repo}/%{name}", ]; -/// fill stuff here +/// These repositories are ignored when storing the packages +/// as these are present by default on any sane fedora system const DEFAULT_REPOS: [&str; 5] = ["koji", "fedora", "updates", "anaconda", "@"]; impl Backend for Fedora { @@ -89,6 +94,7 @@ impl Backend for Fedora { run_external_command(cmd) } + /// Show information from package manager for package. fn remove_packages(&self, packages: &[Package], noconfirm: bool) -> Result<()> { let mut cmd = Command::new("sudo"); cmd.arg(self.get_binary());