refactor
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user