Fixed problems with uploads from relative repository paths

pull/10/head
Dennis Schwerdel 6 years ago
parent e7cc3ed331
commit 2b2454ea77

@ -259,7 +259,7 @@ impl BundleDb {
}
let (folder, filename) = self.layout.remote_bundle_path(self.remote_bundles.len());
let dst_path = folder.join(filename);
let src_path = bundle.path;
let src_path = self.layout.base_path().join(bundle.path);
bundle.path = dst_path.clone();
if self.uploader.is_none() {
self.uploader = Some(BundleUploader::new(5));

@ -101,7 +101,7 @@ impl BundleWriter {
if let Some(ref encryption) = self.encryption {
chunk_data = try!(self.crypto.lock().unwrap().encrypt(&encryption, &chunk_data));
}
let path = db.layout.temp_bundle_path();
let mut path = db.layout.temp_bundle_path();
let mut file = BufWriter::new(try!(File::create(&path).context(&path as &Path)));
try!(file.write_all(&HEADER_STRING).context(&path as &Path));
try!(file.write_all(&[HEADER_VERSION]).context(&path as &Path));
@ -128,6 +128,7 @@ impl BundleWriter {
try!(file.write_all(&info_data).context(&path as &Path));
try!(file.write_all(&chunk_data).context(&path as &Path));
try!(file.write_all(&self.data).context(&path as &Path));
path = path.strip_prefix(db.layout.base_path()).unwrap().to_path_buf();
Ok(StoredBundle { path: path, info: info })
}

Loading…
Cancel
Save