This commit is contained in:
parent
b115b91ecb
commit
e4eb85f535
7 changed files with 75 additions and 38 deletions
|
@ -37,8 +37,8 @@ pub enum InstallError {
|
|||
impl ToString for InstallError {
|
||||
fn to_string(&self) -> String {
|
||||
match self {
|
||||
InstallError::BuildError(e) => format!("Build error: {}", e),
|
||||
InstallError::BinError(e) => format!("Bin error: {}", e),
|
||||
InstallError::BuildError(e) => format!("Build error: \n{}", e),
|
||||
InstallError::BinError(e) => format!("Bin error: \n{}", e),
|
||||
InstallError::InvalidManifest => "Invalid manifest".to_string(),
|
||||
InstallError::Generic => "Install error".to_string(),
|
||||
}
|
||||
|
|
|
@ -38,7 +38,10 @@ impl PackageInstaller {
|
|||
return Err(BinError::UnpackError("package has no data".to_string()));
|
||||
}
|
||||
if std::path::Path::new(&path).exists() {
|
||||
return Err(BinError::UnpackError("path already exists".to_string()));
|
||||
return Err(BinError::UnpackError(format!(
|
||||
"path already exists: {}",
|
||||
path
|
||||
)));
|
||||
}
|
||||
tar::Archive::new(self.pkgfile.data.as_slice())
|
||||
.unpack(&path)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue