Compare commits

..

No commits in common. "6d5171357bdeed0478779a25e33e6e2dfaa07a5b" and "16119a79435c7795de74122326e95839cd5937d4" have entirely different histories.

4 changed files with 26 additions and 22 deletions

View file

@ -10,14 +10,14 @@ members = [
default-members = [".", "members/libpt-core"] default-members = [".", "members/libpt-core"]
[workspace.package] [workspace.package]
publish = true publish = true
version = "0.3.10-alpha.1" version = "0.3.3"
edition = "2021" edition = "2021"
authors = ["Christoph J. Scherr <software@cscherr.de>"] authors = ["Christoph J. Scherr <software@cscherr.de>"]
license = "MIT" license = "MIT"
description = "Personal multitool" description = "Personal multitool"
readme = "README.md" readme = "README.md"
homepage = "https://git.cscherr.de/PlexSheep/pt" homepage = "https://git.cscherr.de/PlexSheep/libpt"
repository = "https://git.cscherr.de/PlexSheep/pt" repository = "https://git.cscherr.de/PlexSheep/libpt"
keywords = ["cli", "library"] keywords = ["cli", "library"]
categories = [ categories = [
"command-line-utilities", "command-line-utilities",
@ -28,11 +28,11 @@ categories = [
[workspace.dependencies] [workspace.dependencies]
anyhow = "1.0.79" anyhow = "1.0.79"
thiserror = "1.0.56" thiserror = "1.0.56"
libpt-core = { version = "0.3.10-alpha.1", path = "members/libpt-core", registry = "cscherr" } libpt-core = { version = "0.3.3", path = "members/libpt-core", registry = "cscherr" }
libpt-bintols = { version = "0.3.10-alpha.1", path = "members/libpt-bintols", registry = "cscherr" } libpt-bintols = { version = "0.3.3", path = "members/libpt-bintols", registry = "cscherr" }
libpt-log = { version = "0.3.10-alpha.1", path = "members/libpt-log", registry = "cscherr" } libpt-log = { version = "0.3.3", path = "members/libpt-log", registry = "cscherr" }
libpt-math = { version = "0.3.10-alpha.1", path = "members/libpt-math", registry = "cscherr" } libpt-math = { version = "0.3.3", path = "members/libpt-math", registry = "cscherr" }
libpt-net = { version = "0.3.10-alpha.1", path = "members/libpt-net", registry = "cscherr" } libpt-net = { version = "0.3.3", path = "members/libpt-net", registry = "cscherr" }
[package] [package]
name = "libpt" name = "libpt"

View file

@ -69,7 +69,6 @@ pub fn dump(data: &mut dyn DataSource, mut config: HeduConfig) -> Result<()> {
if config.skip > 0 { if config.skip > 0 {
data.skip(config.skip)?; data.skip(config.skip)?;
config.data_idx += config.skip; config.data_idx += config.skip;
config.data_idx += BYTES_PER_LINE - config.data_idx % BYTES_PER_LINE;
debug!("Skipped {}", humanbytes(config.skip)); debug!("Skipped {}", humanbytes(config.skip));
} }
@ -159,14 +158,19 @@ fn mask_chars(c: char) -> char {
} }
fn rd_data(data: &mut dyn DataSource, config: &mut HeduConfig) -> Result<()> { fn rd_data(data: &mut dyn DataSource, config: &mut HeduConfig) -> Result<()> {
config.rd_counter += config.len;
config.data_idx += config.len;
match data.read(&mut config.buf[config.alt_buf]) { match data.read(&mut config.buf[config.alt_buf]) {
Ok(mut len) => { Ok(mut len) => {
trace!( debug!(
conf = format!("{:?}", config), conf = format!("{:?}", config),
eval = config.limit != 0 && config.rd_counter >= config.limit, dif = (config.rd_counter as i64 - config.skip as i64),
eval = (config.rd_counter as i64 - config.skip as i64) as usize >= config.limit,
"reached limit?" "reached limit?"
); );
if config.limit != 0 && config.rd_counter + (BYTES_PER_LINE - 1) >= config.limit { if config.limit != 0
&& (config.rd_counter as i64 - config.skip as i64) as usize >= config.limit
{
trace!( trace!(
conf = format!("{:?}", config), conf = format!("{:?}", config),
nlen = (config.limit % BYTES_PER_LINE), nlen = (config.limit % BYTES_PER_LINE),
@ -176,8 +180,6 @@ fn rd_data(data: &mut dyn DataSource, config: &mut HeduConfig) -> Result<()> {
config.stop = true; config.stop = true;
} }
config.len = len; config.len = len;
config.rd_counter += config.len;
config.data_idx += config.len;
return Ok(()); return Ok(());
} }
Err(err) => { Err(err) => {

8
publish.sh Executable file
View file

@ -0,0 +1,8 @@
#!/bin/bash
set -e
PKGs=(libpt-{core,math,log,net,bintols,ccc,hedu,bin,py} libpt)
for PKG in "${PKGs[@]}"; do
echo "Package: $PKG"
cargo publish --registry cscherr -p "$PKG"
cargo publish -p "$PKG"
done

View file

@ -1,10 +1,4 @@
#!/bin/bash #!/bin/bash
set -e set -e
cargo check --all-features cargo ws publish --registry cscherr
cargo ws version --no-git-commit cargo publish --registry cscherr -p libpt
NEW_VERSION=$(cat Cargo.toml | rg '^\s*version\s*=\s*"([^"]*)"\s*$' -or '$1')
bash scripts/set_all_versions.sh $NEW_VERSION
git add -A
git commit -m "Release v$NEW_VERSION"
cargo ws publish --registry cscherr --amend --publish-as-is || cargo publish --registry cscherr -p libpt
git push