Skip to content

Commit

Permalink
release: 0.2.4
Browse files Browse the repository at this point in the history
  • Loading branch information
joshstoik1 committed Feb 8, 2024
2 parents a089b59 + 4366bf7 commit 4fe9e9b
Show file tree
Hide file tree
Showing 8 changed files with 72 additions and 103 deletions.
32 changes: 11 additions & 21 deletions CREDITS.md
Original file line number Diff line number Diff line change
@@ -1,46 +1,36 @@
# Project Dependencies
Package: riprip
Version: 0.2.3
Generated: 2023-12-28 19:36:37 UTC
Version: 0.2.4
Generated: 2024-02-08 20:31:27 UTC

| Package | Version | Author(s) | License |
| ---- | ---- | ---- | ---- |
| [ahash](https://github.com/tkaitchuck/ahash) | 0.8.6 | [Tom Kaitchuck](mailto:tom.kaitchuck@gmail.com) | Apache-2.0 or MIT |
| [argyle](https://github.com/Blobfolio/argyle) | 0.6.8 | [Blobfolio, LLC.](mailto:hello@blobfolio.com) | WTFPL |
| [base64](https://github.com/marshallpierce/rust-base64) | 0.21.5 | [Alice Maz](mailto:alice@alicemaz.com) and [Marshall Pierce](mailto:marshall@mpierce.org) | Apache-2.0 or MIT |
| [ahash](https://github.com/tkaitchuck/ahash) | 0.8.7 | [Tom Kaitchuck](mailto:tom.kaitchuck@gmail.com) | Apache-2.0 or MIT |
| [argyle](https://github.com/Blobfolio/argyle) | 0.7.1 | [Blobfolio, LLC.](mailto:hello@blobfolio.com) | WTFPL |
| [block-buffer](https://github.com/RustCrypto/utils) | 0.10.4 | RustCrypto Developers | Apache-2.0 or MIT |
| [bytecount](https://github.com/llogiq/bytecount) | 0.6.7 | [Andre Bogus](mailto:bogusandre@gmail.de) and [Joshua Landau](mailto:joshua@landau.ws) | Apache-2.0 or MIT |
| [cdtoc](https://github.com/Blobfolio/cdtoc) | 0.3.4 | [Blobfolio, LLC.](mailto:hello@blobfolio.com) | WTFPL |
| [cdtoc](https://github.com/Blobfolio/cdtoc) | 0.3.5 | [Blobfolio, LLC.](mailto:hello@blobfolio.com) | WTFPL |
| [cfg-if](https://github.com/alexcrichton/cfg-if) | 1.0.0 | [Alex Crichton](mailto:alex@alexcrichton.com) | Apache-2.0 or MIT |
| [crc32fast](https://github.com/srijs/rust-crc32fast) | 1.3.2 | [Sam Rijs](mailto:srijs@airpost.net) and [Alex Crichton](mailto:alex@alexcrichton.com) | Apache-2.0 or MIT |
| [crypto-common](https://github.com/RustCrypto/traits) | 0.1.6 | RustCrypto Developers | Apache-2.0 or MIT |
| [ctrlc](https://github.com/Detegr/rust-ctrlc.git) | 3.4.2 | [Antti Keränen](mailto:detegr@gmail.com) | Apache-2.0 or MIT |
| [dactyl](https://github.com/Blobfolio/dactyl) | 0.6.0 | [Blobfolio, LLC.](mailto:hello@blobfolio.com) | WTFPL |
| [dactyl](https://github.com/Blobfolio/dactyl) | 0.7.0 | [Blobfolio, LLC.](mailto:hello@blobfolio.com) | WTFPL |
| [digest](https://github.com/RustCrypto/traits) | 0.10.7 | RustCrypto Developers | Apache-2.0 or MIT |
| [faster-hex](https://github.com/NervosFoundation/faster-hex) | 0.9.0 | [zhangsoledad](mailto:787953403@qq.com) | MIT |
| [fastrand](https://github.com/smol-rs/fastrand) | 2.0.1 | [Stjepan Glavina](mailto:stjepang@gmail.com) | Apache-2.0 or MIT |
| [form_urlencoded](https://github.com/servo/rust-url) | 1.2.1 | The rust-url developers | Apache-2.0 or MIT |
| [fyi_msg](https://github.com/Blobfolio/fyi) | 0.11.8 | [Blobfolio, LLC.](mailto:hello@blobfolio.com) | WTFPL |
| [fyi_msg](https://github.com/Blobfolio/fyi) | 0.12.0 | [Blobfolio, LLC.](mailto:hello@blobfolio.com) | WTFPL |
| [generic-array](https://github.com/fizyk20/generic-array.git) | 0.14.7 | [Bartłomiej Kamiński](mailto:fizyk20@gmail.com) and [Aaron Trent](mailto:novacrazy@gmail.com) | MIT |
| [idna](https://github.com/servo/rust-url/) | 0.5.0 | The rust-url developers | Apache-2.0 or MIT |
| [itoa](https://github.com/dtolnay/itoa) | 1.0.10 | [David Tolnay](mailto:dtolnay@gmail.com) | Apache-2.0 or MIT |
| [libcdio-sys](https://github.com/gmes78/libcdio-sys) | 0.5.0 | [Joaquim Monteiro](mailto:joaquim.monteiro@protonmail.com) | GPL-3.0+ |
| [log](https://github.com/rust-lang/log) | 0.4.20 | The Rust Project Developers | Apache-2.0 or MIT |
| [once_cell](https://github.com/matklad/once_cell) | 1.19.0 | [Aleksey Kladov](mailto:aleksey.kladov@gmail.com) | Apache-2.0 or MIT |
| [minreq](https://github.com/neonmoe/minreq) | 2.11.0 | [Jens Pitkanen](mailto:jens@neon.moe) | ISC |
| [oxford_join](https://github.com/Blobfolio/oxford_join) | 0.2.9 | [Blobfolio, LLC.](mailto:hello@blobfolio.com) | WTFPL |
| [percent-encoding](https://github.com/servo/rust-url/) | 2.3.1 | The rust-url developers | Apache-2.0 or MIT |
| [riprip_core](https://github.com/Blobfolio/riprip) | 0.2.3 | [Josh Stoik](mailto:josh@blobfolio.com) | WTFPL |
| [riprip_core](https://github.com/Blobfolio/riprip) | 0.2.4 | [Josh Stoik](mailto:josh@blobfolio.com) | WTFPL |
| [sha1](https://github.com/RustCrypto/hashes) | 0.10.6 | RustCrypto Developers | Apache-2.0 or MIT |
| [tempfile](https://github.com/Stebalien/tempfile) | 3.9.0 | [Steven Allen](mailto:steven@stebalien.com), The Rust Project Developers, [Ashley Mannix](mailto:ashleymannix@live.com.au), and [Jason White](mailto:me@jasonwhite.io) | Apache-2.0 or MIT |
| [tempfile](https://github.com/Stebalien/tempfile) | 3.10.0 | [Steven Allen](mailto:steven@stebalien.com), The Rust Project Developers, [Ashley Mannix](mailto:ashleymannix@live.com.au), and [Jason White](mailto:me@jasonwhite.io) | Apache-2.0 or MIT |
| [term_size](https://github.com/kbknapp/term_size-rs.git) | 0.3.2 | [Kevin K.](mailto:kbknapp@gmail.com) and [Benjamin Sago](mailto:ogham@bsago.me) | Apache-2.0 or MIT |
| [tinyvec](https://github.com/Lokathor/tinyvec) | 1.6.0 | [Lokathor](mailto:zefria@gmail.com) | Apache-2.0, MIT, or Zlib |
| [tinyvec_macros](https://github.com/Soveu/tinyvec_macros) | 0.1.1 | [Soveu](mailto:marx.tomasz@gmail.com) | Apache-2.0, MIT, or Zlib |
| [trimothy](https://github.com/Blobfolio/trimothy) | 0.2.2 | [Blobfolio, LLC.](mailto:hello@blobfolio.com) | WTFPL |
| [typenum](https://github.com/paholg/typenum) | 1.17.0 | [Paho Lurie-Gregg](mailto:paho@paholg.com) and [Andre Bogus](mailto:bogusandre@gmail.com) | Apache-2.0 or MIT |
| [unicode-bidi](https://github.com/servo/unicode-bidi) | 0.3.14 | The Servo Project Developers | Apache-2.0 or MIT |
| [unicode-normalization](https://github.com/unicode-rs/unicode-normalization) | 0.1.22 | [kwantam](mailto:kwantam@gmail.com) and [Manish Goregaokar](mailto:manishsmail@gmail.com) | Apache-2.0 or MIT |
| [unicode-width](https://github.com/unicode-rs/unicode-width) | 0.1.11 | [kwantam](mailto:kwantam@gmail.com) and [Manish Goregaokar](mailto:manishsmail@gmail.com) | Apache-2.0 or MIT |
| [ureq](https://github.com/algesten/ureq) | 2.9.1 | [Martin Algesten](mailto:martin@algesten.se) and [Jacob Hoffman-Andrews](mailto:ureq@hoffman-andrews.com) | Apache-2.0 or MIT |
| [url](https://github.com/servo/rust-url) | 2.5.0 | The rust-url developers | Apache-2.0 or MIT |
| [utc2k](https://github.com/Blobfolio/utc2k) | 0.7.0 | [Blobfolio, LLC.](mailto:hello@blobfolio.com) | WTFPL |
| [utc2k](https://github.com/Blobfolio/utc2k) | 0.8.0 | [Blobfolio, LLC.](mailto:hello@blobfolio.com) | WTFPL |
| [zerocopy](https://github.com/google/zerocopy) | 0.7.32 | [Joshua Liebow-Feeser](mailto:joshlf@google.com) | Apache-2.0, BSD-2-Clause, or MIT |
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ cargo build --release

See also: [CREDITS.md](CREDITS.md)

Copyright © 2023 [Blobfolio, LLC](https://blobfolio.com) <hello@blobfolio.com>
Copyright © 2024 [Blobfolio, LLC](https://blobfolio.com) <hello@blobfolio.com>

This work is free. You can redistribute it and/or modify it under the terms of the Do What The Fuck You Want To Public License, Version 2.

Expand Down
12 changes: 4 additions & 8 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,13 @@ pkg_dir1 := justfile_directory() + "/riprip"
pkg_dir2 := justfile_directory() + "/riprip_core"

cargo_dir := "/tmp/" + pkg_id + "-cargo"
cargo_bin := cargo_dir + "/x86_64-unknown-linux-gnu/release/" + pkg_id
cargo_bin := cargo_dir + "/release/" + pkg_id
data_dir := "/tmp/bench-data"
doc_dir := justfile_directory() + "/doc"
release_dir := justfile_directory() + "/release"

export RUSTFLAGS := "-C target-cpu=x86-64-v3"



# Build Release!
Expand All @@ -34,7 +36,6 @@ release_dir := justfile_directory() + "/release"
--bin "{{ pkg_id }}" \
-p "{{ pkg_id }}" \
--release \
--target x86_64-unknown-linux-gnu \
--target-dir "{{ cargo_dir }}"


Expand Down Expand Up @@ -72,7 +73,6 @@ release_dir := justfile_directory() + "/release"
--release \
--workspace \
--all-features \
--target x86_64-unknown-linux-gnu \
--target-dir "{{ cargo_dir }}"


Expand All @@ -89,12 +89,11 @@ release_dir := justfile_directory() + "/release"
--release \
--workspace \
--no-deps \
--target x86_64-unknown-linux-gnu \
--target-dir "{{ cargo_dir }}"

# Move the docs and clean up ownership.
[ ! -d "{{ doc_dir }}" ] || rm -rf "{{ doc_dir }}"
mv "{{ cargo_dir }}/x86_64-unknown-linux-gnu/doc" "{{ justfile_directory() }}"
mv "{{ cargo_dir }}/doc" "{{ justfile_directory() }}"
just _fix-chown "{{ doc_dir }}"

exit 0
Expand All @@ -105,7 +104,6 @@ release_dir := justfile_directory() + "/release"
cargo run \
--bin "{{ pkg_id }}" \
--release \
--target x86_64-unknown-linux-gnu \
--target-dir "{{ cargo_dir }}" \
-- {{ ARGS }}

Expand All @@ -115,12 +113,10 @@ release_dir := justfile_directory() + "/release"
clear
cargo test \
--workspace \
--target x86_64-unknown-linux-gnu \
--target-dir "{{ cargo_dir }}"
cargo test \
--release \
--workspace \
--target x86_64-unknown-linux-gnu \
--target-dir "{{ cargo_dir }}"


Expand Down
4 changes: 2 additions & 2 deletions release/man/riprip.1
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.TH "RIP RIP HOORAY!" "1" "December 2023" "Rip Rip Hooray! v0.2.3" "User Commands"
.TH "RIP RIP HOORAY!" "1" "February 2024" "Rip Rip Hooray! v0.2.4" "User Commands"
.SH NAME
Rip Rip Hooray! \- Manual page for riprip v0.2.3.
Rip Rip Hooray! \- Manual page for riprip v0.2.4.
.SH DESCRIPTION
A specialized audio CD\-ripper optimized for incremental data recovery.
.SS USAGE:
Expand Down
14 changes: 7 additions & 7 deletions riprip/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "riprip"
version = "0.2.3"
version = "0.2.4"
license = "WTFPL"
authors = ["Josh Stoik <josh@blobfolio.com>"]
edition = "2021"
Expand All @@ -12,7 +12,7 @@ publish = false

[package.metadata.deb]
maintainer = "Josh Stoik <hello@blobfolio.com>"
copyright = "2022, Blobfolio, LLC <hello@blobfolio.com>"
copyright = "2024, Blobfolio, LLC <hello@blobfolio.com>"
license-file = ["../LICENSE", "0"]
revision = "1"
depends = "$auto"
Expand All @@ -21,7 +21,7 @@ extended-description = """\
.\n\
Rip Rip Hooray! is an audio CD-ripper optimized for incremental data recovery."""
assets = [
["../target/x86_64-unknown-linux-gnu/release/riprip", "usr/bin/", "755"],
["../target/release/riprip", "usr/bin/", "755"],
["../release/completions/riprip.bash", "etc/bash_completion.d/", "644"],
["../release/man/riprip.1.gz", "usr/share/man/man1/", "644"],
]
Expand Down Expand Up @@ -127,15 +127,15 @@ description = "Rip one or more specific tracks (rather than the whole disc). Mul
duplicate = true

[dependencies]
argyle = "0.6.*"
argyle = "0.7.*"
ctrlc = "3.4.*"
dactyl = "0.6.*"
dactyl = "0.7.*"
oxford_join = "0.2.*"
trimothy = "0.2.*"
utc2k = "0.7.*"
utc2k = "0.8.*"

[dependencies.fyi_msg]
version = "0.11.*"
version = "0.12.*"
features = [ "progress" ]

[dependencies.riprip_core]
Expand Down
20 changes: 10 additions & 10 deletions riprip_core/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "riprip_core"
version = "0.2.3"
version = "0.2.4"
license = "WTFPL"
authors = ["Josh Stoik <josh@blobfolio.com>"]
edition = "2021"
Expand All @@ -13,37 +13,37 @@ publish = false
[dependencies]
cdtoc = "0.3.*"
crc32fast = "1.3.2"
dactyl = "0.6.*"
dactyl = "0.7.*"
tempfile = "3.8.0"
trimothy = "0.2.*"
utc2k = "0.7.*"
utc2k = "0.8.*"

[dependencies.argyle]
version = "0.6.*"
version = "0.7.*"
optional = true

[dependencies.fyi_msg]
version = "0.11.*"
version = "0.12.*"
features = [ "progress" ]

[dependencies.libcdio-sys]
version = "=0.5.0"
default-features = false
features = [ "cdio" ]

[dependencies.ureq]
version = "2.7.0"
[dependencies.minreq]
version = "2.11.*"
default-features = false
# Neither AccurateRip nor CTDB use SSL for whatever
# reason so we don't need any ureq features at all!
# reason so we don't need any minreq features at all!

[build-dependencies.cdtoc]
version = "0.3.*"
default-features = false
features = [ "accuraterip" ]

[build-dependencies.ureq]
version = "2.7.0"
[build-dependencies.minreq]
version = "2.11.*"
default-features = false

[dev-dependencies]
Expand Down
19 changes: 9 additions & 10 deletions riprip_core/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,7 @@ use std::{
File,
Metadata,
},
io::{
Read,
Write,
},
io::Write,
path::{
Path,
PathBuf,
Expand Down Expand Up @@ -67,15 +64,17 @@ fn fetch_offsets() -> Vec<u8> {
if let Some(x) = try_cache(&cache) { return x; }

// Download it fresh.
let res = ureq::get(AccurateRip::DRIVE_OFFSET_URL)
.set("user-agent", "Mozilla/5.0")
.call()
let res = minreq::get(AccurateRip::DRIVE_OFFSET_URL)
.with_header("user-agent", "Mozilla/5.0")
.send()
.expect("Unable to download AccurateRip drive offsets.");

let mut out: Vec<u8> = Vec::new();
res.into_reader().read_to_end(&mut out)
.expect("Unable to read the AccurateRip drive offset server response.");
// Only accept happy response codes with sized bodies.
if ! (200..=399).contains(&res.status_code) {
panic!("AccurateRip returned {}.", res.status_code);
}

let out = res.into_bytes();
if out.is_empty() {
panic!("The AccurateRip drive offset server response was empty.");
}
Expand Down
72 changes: 28 additions & 44 deletions riprip_core/src/chk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,26 +26,23 @@ use std::{
Ordering::Relaxed,
},
Mutex,
OnceLock,
},
time::Duration,
};
use ureq::{
Agent,
AgentBuilder,
};



/// # Connection Agent.
static AGENT: OnceLock<Agent> = OnceLock::new();

/// # Maximum CTDB Offset Shift (in bytes).
const CTDB_WIGGLE: usize = CTDB_WIGGLE_SAMPLES * BYTES_PER_SAMPLE as usize;

/// # Maximum CTDB Offset Shift (in samples).
const CTDB_WIGGLE_SAMPLES: usize = SAMPLE_OVERREAD as usize;

/// # User Agent.
const UA: &str = concat!(
"Mozilla/5.0 (X11; Linux x86_64; rv:",
env!("CARGO_PKG_VERSION"),
") RipRip/",
env!("CARGO_PKG_VERSION"),
);



/// # Verify w/ AccurateRip.
Expand Down Expand Up @@ -309,45 +306,32 @@ pub(crate) fn chk_ctdb(toc: &Toc, track: Track, data: &[RipSample]) -> Option<u1



/// # Connection Agent.
///
/// Storing the agent statically saves a little bit of overhead on reuse. Since
/// the checksums are cached locally, this may not get called at all.
fn agent() -> &'static Agent {
AGENT.get_or_init(||
AgentBuilder::new()
.timeout(Duration::from_secs(15))
.user_agent(concat!(
"Mozilla/5.0 (X11; Linux x86_64; rv:",
env!("CARGO_PKG_VERSION"),
") RipRip/",
env!("CARGO_PKG_VERSION"),
))
.max_idle_connections(0)
.build()
)
}

/// # Download.
///
/// Download and return the data!
fn download(url: &str, dst: &Path) -> Option<Vec<u8>> {
use std::io::Write;

// Download the data into a vector.
let res = agent().get(url).call().ok()?;
let mut out = Vec::new();
res.into_reader().read_to_end(&mut out).ok()?;

if out.is_empty() { None }
else {
// Cache the contents for next time.
let _res = CacheWriter::new(dst).ok()
.and_then(|mut writer| {
writer.writer().write_all(&out).ok()?;
writer.finish().ok()
});

Some(out)
let res = minreq::get(url)
.with_header("user-agent", UA)
.with_timeout(15)
.send()
.ok()?;

// Only accept happy response codes with sized bodies.
if (200..=399).contains(&res.status_code) {
let out = res.into_bytes();
if ! out.is_empty() {
// Cache the contents for next time.
let _res = CacheWriter::new(dst).ok()
.and_then(|mut writer| {
writer.writer().write_all(&out).ok()?;
writer.finish().ok()
});
return Some(out);
}
}

None
}

0 comments on commit 4fe9e9b

Please sign in to comment.