diff options
author | Shaun Taheri <github@taheris.co.uk> | 2016-10-19 16:57:54 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-10-19 16:57:54 +0200 |
commit | f01087b25987fd6e7b356c7a62c9f49c720be825 (patch) | |
tree | 1c9497eb1c4cb09b8f0125d9fbb1852340fa5213 /src/sota.rs | |
parent | c6d3bb27c6e794f124259b8f7e749df1687f28b0 (diff) | |
parent | 41db1050631cfe0aaca8922ec4a58a0f2109ac5d (diff) | |
download | rvi_sota_client-f01087b25987fd6e7b356c7a62c9f49c720be825.tar.gz |
Merge pull request #132 from advancedtelematic/bugfix/PRO-1601/fix-sota-toml
Fix config generation
Diffstat (limited to 'src/sota.rs')
-rw-r--r-- | src/sota.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/sota.rs b/src/sota.rs index 9ea615e..57f9308 100644 --- a/src/sota.rs +++ b/src/sota.rs @@ -1,6 +1,6 @@ use rustc_serialize::json; +use std::{fs, io}; use std::fs::File; -use std::io; use std::path::PathBuf; use datatype::{Config, DeviceReport, DownloadComplete, Error, Package, @@ -75,6 +75,7 @@ impl<'c, 'h> Sota<'c, 'h> { let ref pacman = self.config.device.package_manager; let path = self.package_path(id.clone()).expect("install_update expects a valid path"); pacman.install_package(&path).and_then(|(code, output)| { + let _ = fs::remove_file(&path).unwrap_or_else(|err| error!("couldn't remove installed package: {}", err)); Ok(UpdateReport::single(id.clone(), code, output)) }).or_else(|(code, output)| { Err(UpdateReport::single(id.clone(), code, output)) |