mirror of
https://github.com/TECHNOFAB11/pay-respects.git
synced 2026-02-02 15:45:11 +01:00
fix: change dpkg to apt-file
This commit is contained in:
parent
faa7623411
commit
02d9cf0754
1 changed files with 3 additions and 3 deletions
|
|
@ -27,16 +27,16 @@ pub fn get_packages(
|
||||||
let shell = &data.shell.clone();
|
let shell = &data.shell.clone();
|
||||||
match package_manager {
|
match package_manager {
|
||||||
"apt" => {
|
"apt" => {
|
||||||
if !data.has_executable("dpkg") {
|
if !data.has_executable("apt-file") {
|
||||||
return None;
|
return None;
|
||||||
}
|
}
|
||||||
let result = command_output(shell, &format!("dpkg -S '*/bin/{}'", executable));
|
let result = command_output(shell, &format!("apt-file find --regexp '.*/bin/{}$'", executable));
|
||||||
if result.is_empty() {
|
if result.is_empty() {
|
||||||
return None;
|
return None;
|
||||||
}
|
}
|
||||||
let packages: Vec<String> = result
|
let packages: Vec<String> = result
|
||||||
.lines()
|
.lines()
|
||||||
.map(|line| line[..line.find(':').unwrap()].to_string())
|
.map(|line| line.split_once(':').unwrap().0.to_string())
|
||||||
.collect();
|
.collect();
|
||||||
|
|
||||||
if packages.is_empty() {
|
if packages.is_empty() {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue