This commit is contained in:
Dr. Matthias Ratajczak
2022-12-02 17:01:31 +01:00
parent 6719010c5e
commit 8c383799d4
+9 -7
View File
@@ -5,11 +5,17 @@ use alpm::PackageReason::Explicit;
use crate::Package;
/// Get all packages that are installed in the system.
pub fn get_all_installed_packages() -> HashSet<Package> {
convert_to_pacdef_packages(get_all_installed_packages_alpm())
convert_to_pacdef_packages(get_all_installed_packages_from_alpm())
}
fn get_all_installed_packages_alpm() -> HashSet<String> {
/// Get all packages that were installed in the system explicitly.
pub fn get_explicitly_installed_packages() -> HashSet<Package> {
convert_to_pacdef_packages(get_explicitly_installed_packages_from_alpm())
}
fn get_all_installed_packages_from_alpm() -> HashSet<String> {
let db = Alpm::new("/", "/var/lib/pacman").unwrap();
db.localdb()
.pkgs()
@@ -18,11 +24,7 @@ fn get_all_installed_packages_alpm() -> HashSet<String> {
.collect()
}
pub fn get_explicitly_installed_packages() -> HashSet<Package> {
convert_to_pacdef_packages(get_explicitly_installed_packages_alpm())
}
fn get_explicitly_installed_packages_alpm() -> HashSet<String> {
fn get_explicitly_installed_packages_from_alpm() -> HashSet<String> {
let db = Alpm::new("/", "/var/lib/pacman").unwrap();
db.localdb()
.pkgs()