This commit is contained in:
Dr. Matthias Ratajczak
2022-12-02 16:29:01 +01:00
parent ef20514d1c
commit 7cd415985d
5 changed files with 13 additions and 14 deletions
+1 -2
View File
@@ -1,5 +1,4 @@
use clap::Arg; use clap::{Arg, Command};
use clap::Command;
pub const EDIT: &str = "edit"; pub const EDIT: &str = "edit";
pub const GROUPS: &str = "groups"; pub const GROUPS: &str = "groups";
+4 -2
View File
@@ -1,7 +1,9 @@
use crate::Package; use std::collections::HashSet;
use alpm::Alpm; use alpm::Alpm;
use alpm::PackageReason::Explicit; use alpm::PackageReason::Explicit;
use std::collections::HashSet;
use crate::Package;
pub fn get_all_installed_packages() -> HashSet<Package> { 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_alpm())
+2 -1
View File
@@ -1,10 +1,11 @@
use crate::package::Package;
use std::collections::HashSet; use std::collections::HashSet;
use std::fs::File; use std::fs::File;
use std::hash::Hash; use std::hash::Hash;
use std::io::BufRead; use std::io::BufRead;
use std::{io::BufReader, path::PathBuf}; use std::{io::BufReader, path::PathBuf};
use crate::package::Package;
pub const GROUPS_DIR: &str = "/home/ratajc72/.config/pacdef/groups"; pub const GROUPS_DIR: &str = "/home/ratajc72/.config/pacdef/groups";
#[derive(Debug)] #[derive(Debug)]
+4 -5
View File
@@ -1,16 +1,15 @@
use pacdef::db::get_all_installed_packages;
use pacdef::group::GROUPS_DIR;
use std::io::BufRead; use std::io::BufRead;
use std::io::Write; use std::io::Write;
use std::os::unix::process::CommandExt; use std::os::unix::process::CommandExt;
use std::path::Path; use std::path::{Path, PathBuf};
use std::path::PathBuf;
use std::process::exit; use std::process::exit;
use std::{collections::HashSet, process::Command}; use std::{collections::HashSet, process::Command};
use clap::ArgMatches; use clap::ArgMatches;
use pacdef::args; use pacdef::args;
use pacdef::db::get_explicitly_installed_packages; use pacdef::db::{get_all_installed_packages, get_explicitly_installed_packages};
use pacdef::group::GROUPS_DIR;
use pacdef::Group; use pacdef::Group;
use pacdef::Package; use pacdef::Package;
+2 -4
View File
@@ -1,10 +1,8 @@
use std::collections::HashSet; use std::collections::HashSet;
use std::fmt::Display; use std::fmt::{Display, Write};
use std::fmt::Write;
use std::fs::File; use std::fs::File;
use std::hash::Hash; use std::hash::Hash;
use std::io::BufReader; use std::io::{BufReader, Lines};
use std::io::Lines;
#[derive(Debug, Eq, PartialOrd, Ord)] #[derive(Debug, Eq, PartialOrd, Ord)]
pub struct Package { pub struct Package {