before index-conflict changes
This commit is contained in:
@ -1,11 +1,12 @@
|
||||
use std::path::PathBuf;
|
||||
use std::fs;
|
||||
use crate::utils::deletecopy::deletecopy;
|
||||
use crate::utils::fs::deletecopy::deletecopy;
|
||||
use crate::utils::shell::*;
|
||||
|
||||
pub fn disable(repo: &String, pkgname: &String) -> Result<(), String> {
|
||||
let source = PathBuf::from("/pkg").join(repo).join(pkgname);
|
||||
let _ = fs::File::create(&source.join("disabled"));
|
||||
let source = crate::commands::get_aeropkg_base().join(repo).join(pkgname);
|
||||
|
||||
if source.join("disabled").exists() { return Ok(()) };
|
||||
|
||||
let destination = source.parent()
|
||||
.ok_or("Failed to get parent directory for path")?
|
||||
.to_path_buf();
|
||||
@ -31,5 +32,6 @@ pub fn disable(repo: &String, pkgname: &String) -> Result<(), String> {
|
||||
mount_overlay(&destination)?;
|
||||
shell_update()?;
|
||||
|
||||
fs::File::create(&source.join("disabled")).ok();
|
||||
Ok(())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user