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 #172 from darrenldl/dev
Browse files Browse the repository at this point in the history
Minor fixes, CHANGELOG update, LICENSE year update, README contributions section update
  • Loading branch information
darrenldl committed Apr 17, 2019
2 parents 67336eb + 2a60b08 commit 73c1f83
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 27 deletions.
38 changes: 21 additions & 17 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
# Changelog

## 6.0.1

- Minor fixes for rescue and decode mode help messages

## 6.0.0

- Updated `calc` mode to use the same defaults as `encode` mode

- Bumped major version as this may break backward compatibility

- Fixed `check` and `sort` mode progress tracking when dealing with blank blocks

- Previously, blank blocks do not count toward progress made unless `--report-blank` is supplied

## 5.0.0
Expand All @@ -32,42 +36,42 @@
## 3.0.0

- Changed decode mode to use only file portion of stored file name in SBX container

- In previous versions, if the stored file name contains a path, then the entire path would be used, which can lead to unexpected output locations

- Added `--multi-pass` and `--multi-pass-no-skip` flag to the following modes

- decode
- sort mode
- This disables truncation, and allows updating the file gradually across multiple runs

- Upgraded stats tracking in sort mode

- Now it also tracks number of blocks in same order and in different order

- Added `--dry-run` flag to sort mode

- Combined with the improved stats tracking allows checking if the container is sorted or not

- Repalced `--to` with `--to-inc` and `--to-exc`

- This affects `rescue` and `show` mode

- Added `--from`, `--to-inc` and `--to-exc` to the following modes

- check
- decode
- encode
- sort

- Added `--ref-from`, `--ref-to-inc` and `--ref-to-exc` to the following modes

- check
- decode
- sort

- Added `--force-misalign` to the following modes

- check
- decode
- sort
Expand All @@ -77,26 +81,26 @@
- Updated burst error resistance level guessing to respect `--force-misalign`

- Updated decode mode stats output

- This results in potentially incompatible JSON output

- Fixed `misc_utils::calc_required_len_and_seek_to_from_byte_range`

- Sometimes off by one error occured

- Ran `rustfmt` for code formatting

- Ran `cargo fix --edition` to update to Rust 2018 edition

- Fixed potential integer overflow issues in decode and repair mode

- Previously, when output is stdout, block index and seq num counter in decode mode may be incremented even if already at max
- Previously, seq num counter in repair mode may be incremented even if already at max

- Updated burst error resistance level guessing code to respect `--from` and `--force-misalign` options

- Fixed potential incorrect behaviour when processed block is incomplete

- Rectified by adding `#[must_use]` to `Reader::ReadResult`, forcing all code paths to check read result instead of possibly ignoring it

## 2.2.0
Expand All @@ -120,15 +124,15 @@
## 2.0.0

- Dependencies upate

- Updated `rand` from `0.4` to `0.5.4`

- Switched from `ring` to `sha-1` and `sha2` crates

- See issue [#86](https://github.com/darrenldl/rust-SeqBox/issues/86)

- Doc fix

- Added space before parantheses in code comments, documentation and help messages

- Added stdin input option for encode mode
Expand Down
4 changes: 3 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "blkar"
version = "6.0.0"
version = "6.0.1"
authors = ["Darren Ldl <darrenldldev@gmail.com>"]
edition = "2018"
build = "build.rs"
Expand Down
4 changes: 2 additions & 2 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2017 Darren Ldl
Copyright (c) 2017-2019 Darren Ldl

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand All @@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
SOFTWARE.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ Feel free to join the [Gitter chat](https://gitter.im/blockyarchive/community) i

## Contributions

Contributions are welcome. Note that by submitting contributions, you agree to license your work under the same license used by this project (MIT).
Contributions are welcome. Note that by submitting contributions, you agree to license your work under the same license used by this project as stated in the LICENSE file.

## Acknowledgement

Expand Down
4 changes: 2 additions & 2 deletions src/cli_decode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,11 @@ pub fn decode<'a>(matches: &ArgMatches<'a>) -> i32 {
" Since output is stdout, blkar can only output data chunks in the";
" anticipated encoding order.";
"";
" For version with no RS enabled (version 1, 2, 3), this means blkar";
" For version with no FEC enabled (version 1, 2, 3), this means blkar";
" reads in the sequential pattern with optional metadata block and";
" outputs the data chunks.";
"";
" For version with RS enabled (version 17, 18, 19), this means blkar";
" For version with FEC enabled (version 17, 18, 19), this means blkar";
" first guesses the burst resistance level, then reads using the block";
" set interleaving pattern and outputs the data chunks.";
"";
Expand Down
2 changes: 1 addition & 1 deletion src/cli_rescue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ range specified in the initial run.",
.long("only-pick-block")
.takes_value(true)
.help(
"Only pick BLOCK-TYPE of blocks, one of :
"Only pick TYPE of blocks, one of :
any
meta
data",
Expand Down
7 changes: 5 additions & 2 deletions src/rescue_core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -222,13 +222,15 @@ pub fn rescue_from_file(param: &Param) -> Result<Stats, Error> {

let file_size = file_utils::get_file_size(&param.in_file)?;

// calulate length to read and position to seek to
// calulate length to read
let RequiredLenAndSeekTo { required_len, .. } =
misc_utils::calc_required_len_and_seek_to_from_byte_range(
param.from_pos,
param.to_pos,
param.force_misalign,
0,
// 0 is fine here as `bytes_so_far` doesn't affect calculation
// of the required length
PositionOrLength::Len(file_size),
None,
);
Expand Down Expand Up @@ -259,12 +261,13 @@ pub fn rescue_from_file(param: &Param) -> Result<Stats, Error> {

let mut buffer: [u8; SBX_LARGEST_BLOCK_SIZE] = [0; SBX_LARGEST_BLOCK_SIZE];

// read from log file if it exists
// read from log file and update stats if the log file exists
log_handler.read_from_file()?;

log_handler.start();
reporter.start();

// now calculate the position to seek to with the final bytes processed count
let RequiredLenAndSeekTo { seek_to, .. } =
misc_utils::calc_required_len_and_seek_to_from_byte_range(
param.from_pos,
Expand Down

0 comments on commit 73c1f83

Please sign in to comment.