Squashed commit of the following:
commit8b7e357c0e
Author: JMARyA <jmarya@hydrar.de> Date: Sat Jan 18 19:12:11 2025 +0100 add more package info commitbf9813b7a4
Author: JMARyA <jmarya@hydrar.de> Date: Fri Jan 17 22:48:19 2025 +0100 add display for man entries + config files commit6c1ca1e8c0
Author: JMARyA <jmarya@hydrar.de> Date: Fri Jan 17 17:52:28 2025 +0100 finish ui commit36128864aa
Author: JMARyA <jmarya@hydrar.de> Date: Wed Jan 15 22:46:25 2025 +0100 refactor
This commit is contained in:
parent
92cefff212
commit
380352dd07
6 changed files with 635 additions and 272 deletions
|
@ -192,6 +192,82 @@ impl Package {
|
|||
Some(base)
|
||||
}
|
||||
|
||||
pub fn man_entries(&self) -> Vec<String> {
|
||||
let files = self.file_list();
|
||||
files
|
||||
.into_iter()
|
||||
.filter(|x| x.starts_with("usr/share/man"))
|
||||
.map(|x| {
|
||||
x.trim_start_matches("usr/share/man/")
|
||||
.trim_end_matches(".gz")
|
||||
.to_string()
|
||||
})
|
||||
.collect()
|
||||
}
|
||||
|
||||
pub fn kernel_modules(&self) -> Vec<String> {
|
||||
let files = self.file_list();
|
||||
files
|
||||
.into_iter()
|
||||
.filter(|x| x.starts_with("usr/lib/modules"))
|
||||
.map(|x| {
|
||||
x.trim_start_matches("usr/lib/modules/")
|
||||
.trim_end_matches(".zst")
|
||||
.to_string()
|
||||
})
|
||||
.collect()
|
||||
}
|
||||
|
||||
pub fn firmware(&self) -> Vec<String> {
|
||||
let files = self.file_list();
|
||||
files
|
||||
.into_iter()
|
||||
.filter(|x| x.starts_with("usr/lib/firmware"))
|
||||
.map(|x| {
|
||||
x.trim_start_matches("usr/lib/firmware/")
|
||||
.trim_end_matches(".zst")
|
||||
.to_string()
|
||||
})
|
||||
.collect()
|
||||
}
|
||||
|
||||
pub fn keyrings(&self) -> Vec<String> {
|
||||
let files = self.file_list();
|
||||
files
|
||||
.into_iter()
|
||||
.filter(|x| x.starts_with("usr/share/pacman/keyrings"))
|
||||
.map(|x| {
|
||||
x.trim_start_matches("usr/share/pacman/keyrings/")
|
||||
.to_string()
|
||||
})
|
||||
.collect()
|
||||
}
|
||||
|
||||
pub fn shared_objects(&self) -> Vec<String> {
|
||||
list_tar_file(&self.base_path().join(self.file_name()))
|
||||
.unwrap_or_default()
|
||||
.into_iter()
|
||||
.filter(|x| {
|
||||
let file_name = x.split("/").last().unwrap();
|
||||
file_name.contains(".so.") || file_name.ends_with(".so")
|
||||
})
|
||||
.collect()
|
||||
}
|
||||
|
||||
pub fn icons(&self) -> Vec<String> {
|
||||
let files = self.file_list();
|
||||
files
|
||||
.into_iter()
|
||||
.filter(|x| x.starts_with("usr/share/icons"))
|
||||
.map(|x| x.trim_start_matches("usr/share/icons/").to_string())
|
||||
.collect()
|
||||
}
|
||||
|
||||
pub fn etc_entries(&self) -> Vec<String> {
|
||||
let files = self.file_list();
|
||||
files.into_iter().filter(|x| x.starts_with("etc")).collect()
|
||||
}
|
||||
|
||||
pub fn systemd_units(&self) -> Vec<String> {
|
||||
// TODO : Extract unit infos
|
||||
list_tar_file(&self.base_path().join(self.file_name()))
|
||||
|
@ -199,7 +275,7 @@ impl Package {
|
|||
.into_iter()
|
||||
.filter(|x| {
|
||||
let ext = x.split(".").last().unwrap();
|
||||
ext == "service" || ext == "timer" || ext == "mount"
|
||||
ext == "service" || ext == "timer" || ext == "mount" || ext == "socket"
|
||||
})
|
||||
.collect()
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue