Probably wrong file locations, but mostly complete

This commit is contained in:
Beefki 2017-10-26 01:15:04 -05:00
parent 45eeb69bda
commit ec50d9c6b1

View File

@ -86,6 +86,83 @@ impl<'a> PackageManager<'a> {
exe: PathBuf::from("bin/xbps-install"), exe: PathBuf::from("bin/xbps-install"),
} }
} }
pub fn brew() -> PackageManager<'a> {
PackageManager{
name: "brew",
search: Some(vec!["brew", "search"]),
install: Some(vec!["brew", "install"]),
uninstall: Some(vec!["brew", "uninstall"]),
sup: Some(vec!["brew", "update", "upgrade"]),
purge: Some(vec!["brew", "remove"]),
upgrade: Some(vec!["brew", "upgrade"]),
update: Some(vec!["brew", "update"]),
cache_clear: Some(vec!["brew", "cleanup"]),
complete_cache_clear: None,
exe: PathBuf::from("/bin/brew/"),
}
}
pub fn dnf() -> PackageManager<'a> {
PackageManager{
name: "dnf",
search: Some(vec!["dnf", "search"]),
install: Some(vec!["dnf", "install"]),
uninstall: Some(vec!["dnf", "remove"]),
sup: Some(vec!["dnf", "--refresh upgrade"]),
purge: Some(vec!["dnf", "autoremove"]),
upgrade: Some(vec!["dnf", "upgrade"]),
update: Some(vec!["dnf", "--refresh check-update"]),
cache_clear: Some(vec!["dnf", "clean all"]),
complete_cache_clear: None,
exe: PathBuf::from("/bin/dnf"),
}
}
pub fn eopkg() -> PackageManager<'a> {
PackageManager{
name: "eopkg",
search: Some(vec!["eopkg", "sr"]),
install: Some(vec!["eopkg", "it"]),
uninstall: Some(vec!["eopkg", "rm"]),
sup: Some(vec!["eopkg", "up"]),
purge: Some(vec!["eopkg", "rm --purge"]),
upgrade: Some(vec!["eopkg", "up"]),
update: Some(vec!["eopkg", "ur"]),
cache_clear: Some(vec!["eopkg", "dc"]),
complete_cache_clear: None,
exe: PathBuf::from("/bin/eopkg"),
}
}
pub fn yum() -> PackageManager<'a> {
PackageManager{
name: "yum",
search: Some(vec!["yum", "search"]),
install: Some(vec!["yum", "install"]),
uninstall: Some(vec!["yum", "remove"]),
sup: Some(vec!["yum", "check-update", "update"]),
purge: Some(vec!["yum", "remove"]),
upgrade: Some(vec!["yum", "update"]),
update: Some(vec!["yum", "check-update"]),
cache_clear: Some(vec!["yum", "autoremove"]),
complete_cache_clear: None,
exe: PathBuf::from("/bin/yum"),
}
}
/* Template to copy paste the bare minimum
pub fn name() -> PackageManager<'a> {
PackageManager{
name: "",
search: Some(vec![]),
install: Some(vec![]),
uninstall: Some(vec![]),
sup: Some(vec![]),
purge: Some(vec![]),
upgrade: Some(vec![]),
update: Some(vec![]),
cache_clear: Some(vec![]),
complete_cache_clear: Some(vec![]),
exe: PathBuf::from(""),
}
}
*/
// Allows setting the default in rux.conf // Allows setting the default in rux.conf
pub fn set_default(&self) -> std::io::Result<()> { pub fn set_default(&self) -> std::io::Result<()> {
let mut home = match env::home_dir() { let mut home = match env::home_dir() {
@ -109,8 +186,12 @@ impl<'a> PackageManager<'a> {
let pacman = PackageManager::pacman(); let pacman = PackageManager::pacman();
let aptget = PackageManager::apt(); let aptget = PackageManager::apt();
let xbps = PackageManager::xbps(); let xbps = PackageManager::xbps();
let brew = PackageManager::brew();
let dnf = PackageManager::dnf();
let eopkg = PackageManager::eopkg();
let yum = PackageManager::yum();
vec![pacmatic, pacman, aptget, xbps] vec![pacmatic, pacman, aptget, xbps, brew, dnf, eopkg, yum]
} }
} }