Create genesis.tar.bz2 in solana-genesis (#7039)

* Use clap_utils

* Create genesis.tar.bz2 in solana-genesis

* Remove shell-based genesis.tar.bz2 generation

* Make Option=>Result conv more rusty

* stop using solana_logger

* Simplify by just using vec!

* clean up abit
This commit is contained in:
Ryo Onodera
2019-11-22 02:57:27 +09:00
committed by Michael Vines
parent 79199711b8
commit 8cbc450192
5 changed files with 57 additions and 36 deletions

View File

@ -92,12 +92,14 @@ impl SnapshotPackagerService {
// Tar the staging directory into the archive at `archive_path`
let archive_path = tar_dir.join("new_state.tar.bz2");
let mut args = vec!["jcfhS"];
args.push(archive_path.to_str().unwrap());
args.push("-C");
args.push(staging_dir.path().to_str().unwrap());
args.push(TAR_ACCOUNTS_DIR);
args.push(TAR_SNAPSHOTS_DIR);
let args = vec![
"jcfhS",
archive_path.to_str().unwrap(),
"-C",
staging_dir.path().to_str().unwrap(),
TAR_ACCOUNTS_DIR,
TAR_SNAPSHOTS_DIR,
];
let output = std::process::Command::new("tar").args(&args).output()?;
if !output.status.success() {