fix(fedora): AS_DEPENDENCY and package_info

Set SUPPORTS_AS_DEPENDENCY and rewrite show_package_info for dnf

Signed-off-by: innocentzero <isfarulhaque@proton.me>
This commit is contained in:
innocentzero
2024-04-12 17:48:28 +05:30
parent 4fe2b0597d
commit b3263b02a7
@@ -23,6 +23,7 @@ const SWITCHES_MAKE_DEPENDENCY: Switches = &[];
const SWITCHES_NOCONFIRM: Switches = &["--assumeyes"];
const SWITCHES_REMOVE: Switches = &["remove"];
const SUPPORTS_AS_DEPENDENCY: bool = false;
const SWITCHES_FETCH_USER: Switches = &[
"repoquery",
@@ -38,7 +39,6 @@ const SWITCHES_FETCH_GLOBAL: Switches = &[
"%{from_repo}/%{name}",
];
const SUPPORTS_AS_DEPENDENCY: bool = true;
/// fill stuff here
const DEFAULT_REPOS: [&str; 5] = ["koji", "fedora", "updates", "anaconda", "@"];
@@ -105,6 +105,14 @@ impl Backend for Fedora {
run_external_command(cmd)
}
fn show_package_info(&self, package: &Package) -> Result<()> {
let mut cmd = Command::new(self.get_binary());
cmd.args(self.get_switches_info());
cmd.arg(&package.name);
run_external_command(cmd)
}
fn make_dependency(&self, _: &[Package]) -> Result<()> {
panic!("Not supported by the package manager!")
}