Skip to content
This repository has been archived by the owner on Jun 7, 2022. It is now read-only.

Commit

Permalink
Merge pull request #101 from darrenldl/dev
Browse files Browse the repository at this point in the history
Progress on renaming, output message spacing fix, added warning message about renaming
  • Loading branch information
darrenldl committed Dec 19, 2018
2 parents f1e35ea + 8652c09 commit 1ddf819
Show file tree
Hide file tree
Showing 11 changed files with 78 additions and 33 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ path = "src/bin/main.rs"
doc = false

[lib]
name = "rsbx_lib"
name = "blkar_lib"
path = "src/lib.rs"
doc = false

Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# blockyarchive

[![Build Status](https://travis-ci.org/darrenldl/rust-SeqBox.svg?branch=master)](https://travis-ci.org/darrenldl/rust-SeqBox)
[![Build status](https://ci.appveyor.com/api/projects/status/ho6v99qysi9l8p6d?svg=true)](https://ci.appveyor.com/project/darrenldl/rust-seqbox)
[![codecov](https://codecov.io/gh/darrenldl/rust-SeqBox/branch/master/graph/badge.svg)](https://codecov.io/gh/darrenldl/rust-SeqBox)
[![Coverage Status](https://coveralls.io/repos/github/darrenldl/rust-SeqBox/badge.svg?branch=master)](https://coveralls.io/github/darrenldl/rust-SeqBox?branch=master)
[![Build Status](https://travis-ci.org/darrenldl/blockyarchive.svg?branch=master)](https://travis-ci.org/darrenldl/blockyarchive)
[![Build status](https://ci.appveyor.com/api/projects/status/i4dxpldp4t312gtv?svg=true)](https://ci.appveyor.com/project/darrenldl/blockyarchive)
[![codecov](https://codecov.io/gh/darrenldl/blockyarchive/branch/master/graph/badge.svg)](https://codecov.io/gh/darrenldl/blockyarchive)
[![Coverage Status](https://coveralls.io/repos/github/darrenldl/blockyarchive/badge.svg?branch=master)](https://coveralls.io/github/darrenldl/blockyarchive?branch=master)
[![Crates](https://img.shields.io/crates/v/rsbx.svg)](https://crates.io/crates/rsbx)
[![dependency status](https://deps.rs/repo/github/darrenldl/rsbx/status.svg)](https://deps.rs/repo/github/darrenldl/rsbx)

Expand All @@ -23,7 +23,7 @@ Please visit the official [SeqBox](https://github.com/MarcoPon/SeqBox) repo for

## Comparison to the original SeqBox implementation/design

The original SeqBox implementation and format does not support repairing of data, only sector level recoverability.
The original SeqBox implementation and format does not support repairing of data, only sector level recoverability. Blkar is also more robust compared to the original SeqBox implementation, as it does not assume the SBX container to be well formed, and makes as few assumptions about the SBX container as possible, if at all.

Blockyarchive allows repairs to be made by adding forward error correction (Reed-Solomon erasure code) to extended versions of SeqBox format, and also allows arranging the blocks in a burst error resistant pattern.

Expand Down
29 changes: 17 additions & 12 deletions src/bin/main.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
extern crate clap;
use clap::*;

extern crate rsbx_lib;
use rsbx_lib::*;
extern crate blkar_lib;
use blkar_lib::*;

fn real_main () -> i32 {
let matches = App::new("rsbx")
.version(env!("CARGO_PKG_VERSION"))
.author("Darren Ldl <darrenldldev@gmail.com>")
.about("Enhanced implementation of SeqBox in Rust")
.about("Archive with forward error correction and sector level recoverability
===== IMPORTANT =====
Please note that this is the last version of this software to be released under the name rsbx,
future releases will be published under the name blkar. See project repo for details.
=====================")
.subcommand(cli_encode::sub_command())
.subcommand(cli_decode::sub_command())
.subcommand(cli_rescue::sub_command())
Expand All @@ -20,31 +25,31 @@ fn real_main () -> i32 {
.get_matches();

if let Some(matches) = matches.subcommand_matches("encode") {
rsbx_lib::cli_encode::encode(matches)
cli_encode::encode(matches)
}
else if let Some(matches) = matches.subcommand_matches("decode") {
rsbx_lib::cli_decode::decode(matches)
cli_decode::decode(matches)
}
else if let Some(matches) = matches.subcommand_matches("rescue") {
rsbx_lib::cli_rescue::rescue(matches)
cli_rescue::rescue(matches)
}
else if let Some(matches) = matches.subcommand_matches("show") {
rsbx_lib::cli_show::show(matches)
cli_show::show(matches)
}
else if let Some(matches) = matches.subcommand_matches("repair") {
rsbx_lib::cli_repair::repair(matches)
cli_repair::repair(matches)
}
else if let Some(matches) = matches.subcommand_matches("check") {
rsbx_lib::cli_check::check(matches)
cli_check::check(matches)
}
else if let Some(matches) = matches.subcommand_matches("sort") {
rsbx_lib::cli_sort::sort(matches)
cli_sort::sort(matches)
}
else if let Some(matches) = matches.subcommand_matches("calc") {
rsbx_lib::cli_calc::calc(matches)
cli_calc::calc(matches)
}
else {
exit_with_msg!(ok rsbx_lib::json_printer::JSONPrinter::new(false, rsbx_lib::output_channel::OutputChannel::Stdout)
exit_with_msg!(ok json_printer::JSONPrinter::new(false, output_channel::OutputChannel::Stdout)
=> "Invoke with -h or --help for help message\n");
}
}
Expand Down
21 changes: 13 additions & 8 deletions src/cli_calc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,12 @@ use clap::*;
use cli_utils::*;
pub fn sub_command<'a, 'b>() -> App<'a, 'b> {
SubCommand::with_name("calc")
.about("Calculate and display detailed information given an encoding configuration")
.about("Calculate and display detailed information given an encoding configuration
===== IMPORTANT =====
Please note that this is the last version of this software to be released under the name rsbx,
future releases will be published under the name blkar. See project repo for details.
=====================")
.arg(Arg::with_name("in_file_size")
.value_name("INFILE-SIZE")
.required(true)
Expand Down Expand Up @@ -137,14 +142,14 @@ pub fn calc<'a>(matches : &ArgMatches<'a>) -> i32 {

let block_size = ver_to_block_size(version);

print!("Error correction parameters interpretation");
println!("Error correction parameters interpretation");
println!("========================================");
if burst == 0 {
print_block!(
" The container can tolerate {} SBX block corruptions", par;
" in any block set.";
"";
" A block set consists of {} blocks({} bytes).", (data + par), (data + par) * block_size;
" A block set consists of {} blocks ({} bytes).", (data + par), (data + par) * block_size;
"";
" In total, {} blocks({} bytes) may be corrupted in", par, par * block_size;
" any block set.";
Expand All @@ -164,15 +169,15 @@ pub fn calc<'a>(matches : &ArgMatches<'a>) -> i32 {
let super_block_set_size = (data + par) * burst;

print_block!(" The container can tolerate {} burst SBX block corruptions in", par;
" any super block set({} interleaved block sets).", burst;
" any super block set ({} interleaved block sets).", burst;
"";
" A block set consists of {} blocks({} bytes).", block_set_size, block_set_size * block_size;
" A block set consists of {} blocks ({} bytes).", block_set_size, block_set_size * block_size;
"";
" A super block set consists of {} blocks({} bytes).", super_block_set_size, super_block_set_size * block_size;
" A super block set consists of {} blocks ({} bytes).", super_block_set_size, super_block_set_size * block_size;
"";
" Each burst error may be up to {} blocks({} bytes) in size.", burst, burst * block_size;
" Each burst error may be up to {} blocks ({} bytes) in size.", burst, burst * block_size;
"";
" In total, {} sets of {} consecutive blocks({} bytes) may be", par, burst, burst * block_size;
" In total, {} sets of {} consecutive blocks ({} bytes) may be", par, burst, burst * block_size;
" corrupted in any super block set.";
"";
" The sets of corrupted blocks may be connected as well, so the";
Expand Down
7 changes: 6 additions & 1 deletion src/cli_check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@ use json_printer::BracketType;

pub fn sub_command<'a, 'b>() -> App<'a, 'b> {
SubCommand::with_name("check")
.about("Check integrity of SBX blocks in container")
.about("Check integrity of SBX blocks in container
===== IMPORTANT =====
Please note that this is the last version of this software to be released under the name rsbx,
future releases will be published under the name blkar. See project repo for details.
=====================")
.arg(in_file_arg()
.help("SBX container to check"))
.arg(no_meta_arg())
Expand Down
7 changes: 6 additions & 1 deletion src/cli_decode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,12 @@ use std::sync::Arc;

pub fn sub_command<'a, 'b>() -> App<'a, 'b> {
SubCommand::with_name("decode")
.about("Decode SBX container")
.about("Decode SBX container
===== IMPORTANT =====
Please note that this is the last version of this software to be released under the name rsbx,
future releases will be published under the name blkar. See project repo for details.
=====================")
.arg(in_file_arg()
.help("SBX container to decode"))
.arg(out_arg()
Expand Down
7 changes: 6 additions & 1 deletion src/cli_encode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,12 @@ use cli_utils::*;

pub fn sub_command<'a, 'b>() -> App<'a, 'b> {
SubCommand::with_name("encode")
.about("Encode file")
.about("Encode file
===== IMPORTANT =====
Please note that this is the last version of this software to be released under the name rsbx,
future releases will be published under the name blkar. See project repo for details.
=====================")
.arg(in_file_arg()
.help("File to encode. Supply - to use STDIN as input."))
.arg(out_arg()
Expand Down
7 changes: 6 additions & 1 deletion src/cli_repair.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,12 @@ use json_printer::BracketType;

pub fn sub_command<'a, 'b>() -> App<'a, 'b> {
SubCommand::with_name("repair")
.about("Repair SBX container")
.about("Repair SBX container
===== IMPORTANT =====
Please note that this is the last version of this software to be released under the name rsbx,
future releases will be published under the name blkar. See project repo for details.
=====================")
.arg(in_file_arg()
.help("SBX container to repair"))
.arg(pr_verbosity_level_arg())
Expand Down
7 changes: 6 additions & 1 deletion src/cli_rescue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,12 @@ use cli_utils::*;

pub fn sub_command<'a, 'b>() -> App<'a, 'b> {
SubCommand::with_name("rescue")
.about("Rescue SBX blocks from file/block device, essentially ddrescue but for SBX blocks")
.about("Rescue SBX blocks from file/block device, essentially ddrescue but for SBX blocks
===== IMPORTANT =====
Please note that this is the last version of this software to be released under the name rsbx,
future releases will be published under the name blkar. See project repo for details.
=====================")
.arg(in_file_arg()
.help("File/block device to rescue sbx data from"))
.arg(out_dir_arg()
Expand Down
7 changes: 6 additions & 1 deletion src/cli_show.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,12 @@ use cli_utils::*;

pub fn sub_command<'a, 'b>() -> App<'a, 'b> {
SubCommand::with_name("show")
.about("Search for and print metadata in file")
.about("Search for and print metadata in file
===== IMPORTANT =====
Please note that this is the last version of this software to be released under the name rsbx,
future releases will be published under the name blkar. See project repo for details.
=====================")
.arg(in_file_arg()
.help("SBX container to search for metadata"))
.arg(Arg::with_name("show_all")
Expand Down
7 changes: 6 additions & 1 deletion src/cli_sort.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,12 @@ use json_printer::BracketType;

pub fn sub_command<'a, 'b>() -> App<'a, 'b> {
SubCommand::with_name("sort")
.about("Sort SBX blocks in container, can also readjust burst error resistance level")
.about("Sort SBX blocks in container, can also readjust burst error resistance level
===== IMPORTANT =====
Please note that this is the last version of this software to be released under the name rsbx,
future releases will be published under the name blkar. See project repo for details.
=====================")
.arg(in_file_arg()
.help("SBX container to sort"))
.arg(out_file_arg()
Expand Down

0 comments on commit 1ddf819

Please sign in to comment.