Skip to content

Commit

Permalink
release: 0.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
joshstoik1 committed Jan 30, 2025
2 parents dc8c109 + ebe0774 commit d0cb346
Show file tree
Hide file tree
Showing 11 changed files with 46 additions and 102 deletions.
35 changes: 17 additions & 18 deletions CREDITS.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,31 @@
# Project Dependencies
Package: riprip
Version: 0.2.12
Version: 0.3.0
Target: x86_64-unknown-linux-gnu
Generated: 2025-01-09 19:53:56 UTC
Generated: 2025-01-30 20:21:42 UTC

| Package | Version | Author(s) | License |
| ---- | ---- | ---- | ---- |
| [**argyle**](https://github.com/Blobfolio/argyle) | 0.10.1 | [Josh Stoik](mailto:[email protected]) | WTFPL |
| [bindgen](https://github.com/rust-lang/rust-bindgen) ⚒️ | 0.71.1 | [Jyun-Yan You](mailto:[email protected]), [Emilio Cobos Álvarez](mailto:[email protected]), [Nick Fitzgerald](mailto:[email protected]), and The Servo project developers | BSD-3-Clause |
| [bitflags](https://github.com/bitflags/bitflags) | 2.6.0 | The Rust Project Developers | MIT OR Apache-2.0 |
| [bitflags](https://github.com/bitflags/bitflags) | 2.8.0 | The Rust Project Developers | MIT OR Apache-2.0 |
| [block-buffer](https://github.com/RustCrypto/utils) | 0.10.4 | RustCrypto Developers | MIT OR Apache-2.0 |
| [byteorder](https://github.com/BurntSushi/byteorder) | 1.5.0 | [Andrew Gallant](mailto:[email protected]) | Unlicense OR MIT |
| [**cdtoc**](https://github.com/Blobfolio/cdtoc) | 0.6.1 | [Josh Stoik](mailto:[email protected]) | WTFPL |
| [cexpr](https://github.com/jethrogb/rust-cexpr) ⚒️ | 0.6.0 | [Jethro Beekman](mailto:[email protected]) | Apache-2.0 OR MIT |
| [cfg-if](https://github.com/alexcrichton/cfg-if) | 1.0.0 | [Alex Crichton](mailto:[email protected]) | MIT OR Apache-2.0 |
| [cfg_aliases](https://github.com/katharostech/cfg_aliases) ⚒️ | 0.2.1 | [Zicklag](mailto:[email protected]) | MIT |
| [clang-sys](https://github.com/KyleMayes/clang-sys) ⚒️ | 1.8.1 | [Kyle Mayes](mailto:[email protected]) | Apache-2.0 |
| [cpufeatures](https://github.com/RustCrypto/utils) | 0.2.16 | RustCrypto Developers | MIT OR Apache-2.0 |
| [cpufeatures](https://github.com/RustCrypto/utils) | 0.2.17 | RustCrypto Developers | MIT OR Apache-2.0 |
| [**crc32fast**](https://github.com/srijs/rust-crc32fast) | 1.4.2 | [Sam Rijs](mailto:[email protected]) and [Alex Crichton](mailto:[email protected]) | MIT OR Apache-2.0 |
| [crypto-common](https://github.com/RustCrypto/traits) | 0.1.6 | RustCrypto Developers | MIT OR Apache-2.0 |
| [**ctrlc**](https://github.com/Detegr/rust-ctrlc.git) | 3.4.5 | [Antti Keränen](mailto:[email protected]) | MIT OR Apache-2.0 |
| [**dactyl**](https://github.com/Blobfolio/dactyl) | 0.9.1 | [Josh Stoik](mailto:[email protected]) | WTFPL |
| [digest](https://github.com/RustCrypto/traits) | 0.10.7 | RustCrypto Developers | MIT OR Apache-2.0 |
| [either](https://github.com/rayon-rs/either) ⚒️ | 1.13.0 | bluss | MIT OR Apache-2.0 |
| [faster-hex](https://github.com/NervosFoundation/faster-hex) | 0.10.0 | [zhangsoledad](mailto:[email protected]) | MIT |
| [fastrand](https://github.com/smol-rs/fastrand) | 2.3.0 | [Stjepan Glavina](mailto:[email protected]) | Apache-2.0 OR MIT |
| [**fyi_msg**](https://github.com/Blobfolio/fyi) | 1.5.0 | [Josh Stoik](mailto:[email protected]) | WTFPL |
| [**fyi_msg**](https://github.com/Blobfolio/fyi) | 1.6.1 | [Josh Stoik](mailto:[email protected]) | WTFPL |
| [generic-array](https://github.com/fizyk20/generic-array.git) | 0.14.7 | [Bartłomiej Kamiński](mailto:[email protected]) and [Aaron Trent](mailto:[email protected]) | MIT |
| [getrandom](https://github.com/rust-random/getrandom) | 0.2.15 | The Rand Project Developers | MIT OR Apache-2.0 |
| [getrandom](https://github.com/rust-random/getrandom) | 0.3.1 | The Rand Project Developers | MIT OR Apache-2.0 |
| [glob](https://github.com/rust-lang/glob) ⚒️ | 0.3.2 | The Rust Project Developers | MIT OR Apache-2.0 |
| [hash32](https://github.com/japaric/hash32) | 0.3.1 | [Jorge Aparicio](mailto:[email protected]) | MIT OR Apache-2.0 |
| [heapless](https://github.com/rust-embedded/heapless) | 0.8.0 | [Jorge Aparicio](mailto:[email protected]), [Per Lindgren](mailto:[email protected]), and [Emil Fresk](mailto:[email protected]) | MIT OR Apache-2.0 |
Expand All @@ -37,32 +35,33 @@
| [**libcdio-sys**](https://github.com/MonterraByte/libcdio-sys) | 0.5.2 | [Joaquim Monteiro](mailto:[email protected]) | GPL-3.0+ |
| [libloading](https://github.com/nagisa/rust_libloading/) ⚒️ | 0.8.6 | [Simonas Kazlauskas](mailto:[email protected]) | ISC |
| [linux-raw-sys](https://github.com/sunfishcode/linux-raw-sys) | 0.4.15 | [Dan Gohman](mailto:[email protected]) | Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT |
| [log](https://github.com/rust-lang/log) | 0.4.22 | The Rust Project Developers | MIT OR Apache-2.0 |
| [log](https://github.com/rust-lang/log) | 0.4.25 | The Rust Project Developers | MIT OR Apache-2.0 |
| [memchr](https://github.com/BurntSushi/memchr) ⚒️ | 2.7.4 | [Andrew Gallant](mailto:[email protected]) and bluss | Unlicense OR MIT |
| [minimal-lexical](https://github.com/Alexhuszagh/minimal-lexical) ⚒️ | 0.2.1 | [Alex Huszagh](mailto:[email protected]) | MIT OR Apache-2.0 |
| [**minreq**](https://github.com/neonmoe/minreq) | 2.13.0 | [Jens Pitkanen](mailto:[email protected]) | ISC |
| [nix](https://github.com/nix-rust/nix) | 0.29.0 | The nix-rust Project Developers | MIT |
| [**minreq**](https://github.com/neonmoe/minreq) | 2.13.2 | [Jens Pitkanen](mailto:[email protected]) | ISC |
| [nom](https://github.com/Geal/nom) ⚒️ | 7.1.3 | [email protected] | MIT |
| [once_cell](https://github.com/matklad/once_cell) | 1.20.2 | [Aleksey Kladov](mailto:[email protected]) | MIT OR Apache-2.0 |
| [**oxford_join**](https://github.com/Blobfolio/oxford_join) | 0.4.2 | [Josh Stoik](mailto:[email protected]) | WTFPL |
| [prettyplease](https://github.com/dtolnay/prettyplease) ⚒️ | 0.2.27 | [David Tolnay](mailto:[email protected]) | MIT OR Apache-2.0 |
| [proc-macro2](https://github.com/dtolnay/proc-macro2) ⚒️ | 1.0.92 | [David Tolnay](mailto:[email protected]) and [Alex Crichton](mailto:[email protected]) | MIT OR Apache-2.0 |
| [prettyplease](https://github.com/dtolnay/prettyplease) ⚒️ | 0.2.29 | [David Tolnay](mailto:[email protected]) | MIT OR Apache-2.0 |
| [proc-macro2](https://github.com/dtolnay/proc-macro2) ⚒️ | 1.0.93 | [David Tolnay](mailto:[email protected]) and [Alex Crichton](mailto:[email protected]) | MIT OR Apache-2.0 |
| [quote](https://github.com/dtolnay/quote) ⚒️ | 1.0.38 | [David Tolnay](mailto:[email protected]) | MIT OR Apache-2.0 |
| [regex](https://github.com/rust-lang/regex) ⚒️ | 1.11.1 | The Rust Project Developers and [Andrew Gallant](mailto:[email protected]) | MIT OR Apache-2.0 |
| [regex-automata](https://github.com/rust-lang/regex/tree/master/regex-automata) ⚒️ | 0.4.9 | The Rust Project Developers and [Andrew Gallant](mailto:[email protected]) | MIT OR Apache-2.0 |
| [regex-syntax](https://github.com/rust-lang/regex/tree/master/regex-syntax) ⚒️ | 0.8.5 | The Rust Project Developers and [Andrew Gallant](mailto:[email protected]) | MIT OR Apache-2.0 |
| [**riprip_core**](https://github.com/Blobfolio/riprip) | 0.2.12 | [Josh Stoik](mailto:[email protected]) | WTFPL |
| [**riprip_core**](https://github.com/Blobfolio/riprip) | 0.3.0 | [Josh Stoik](mailto:[email protected]) | WTFPL |
| [rustc-hash](https://github.com/rust-lang/rustc-hash) ⚒️ | 2.1.0 | The Rust Project Developers | Apache-2.0 OR MIT |
| [rustix](https://github.com/bytecodealliance/rustix) | 0.38.43 | [Dan Gohman](mailto:[email protected]) and [Jakub Konka](mailto:[email protected]) | Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT |
| [rustix](https://github.com/bytecodealliance/rustix) | 0.38.44 | [Dan Gohman](mailto:[email protected]) and [Jakub Konka](mailto:[email protected]) | Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT |
| [sha1](https://github.com/RustCrypto/hashes) | 0.10.6 | RustCrypto Developers | MIT OR Apache-2.0 |
| [shlex](https://github.com/comex/rust-shlex) ⚒️ | 1.3.0 | [comex](mailto:[email protected]), [Fenhl](mailto:[email protected]), [Adrian Taylor](mailto:[email protected]), [Alex Touchet](mailto:[email protected]), [Daniel Parks](mailto:dp+[email protected]), and [Garrett Berg](mailto:[email protected]) | MIT OR Apache-2.0 |
| [signal-hook](https://github.com/vorner/signal-hook) | 0.3.17 | [Michal 'vorner' Vaner](mailto:[email protected]) and [Thomas Himmelstoss](mailto:[email protected]) | Apache-2.0 OR MIT |
| [signal-hook-registry](https://github.com/vorner/signal-hook) | 1.4.2 | [Michal 'vorner' Vaner](mailto:[email protected]) and [Masaki Hara](mailto:[email protected]) | Apache-2.0 OR MIT |
| [stable_deref_trait](https://github.com/storyyeller/stable_deref_trait) | 1.2.0 | [Robert Grosse](mailto:[email protected]) | MIT OR Apache-2.0 |
| [syn](https://github.com/dtolnay/syn) ⚒️ | 2.0.95 | [David Tolnay](mailto:[email protected]) | MIT OR Apache-2.0 |
| [**tempfile**](https://github.com/Stebalien/tempfile) | 3.15.0 | [Steven Allen](mailto:[email protected]), The Rust Project Developers, [Ashley Mannix](mailto:[email protected]), and [Jason White](mailto:[email protected]) | MIT OR Apache-2.0 |
| [syn](https://github.com/dtolnay/syn) ⚒️ | 2.0.96 | [David Tolnay](mailto:[email protected]) | MIT OR Apache-2.0 |
| [**tempfile**](https://github.com/Stebalien/tempfile) | 3.16.0 | [Steven Allen](mailto:[email protected]), The Rust Project Developers, [Ashley Mannix](mailto:[email protected]), and [Jason White](mailto:[email protected]) | MIT OR Apache-2.0 |
| [terminal_size](https://github.com/eminence/terminal-size) | 0.4.1 | [Andrew Chin](mailto:[email protected]) | MIT OR Apache-2.0 |
| [**trimothy**](https://github.com/Blobfolio/trimothy) | 0.6.1 | [Josh Stoik](mailto:[email protected]) | WTFPL |
| [typenum](https://github.com/paholg/typenum) | 1.17.0 | [Paho Lurie-Gregg](mailto:[email protected]) and [Andre Bogus](mailto:[email protected]) | MIT OR Apache-2.0 |
| [unicode-ident](https://github.com/dtolnay/unicode-ident) ⚒️ | 1.0.14 | [David Tolnay](mailto:[email protected]) | (MIT OR Apache-2.0) AND Unicode-3.0 |
| [unicode-ident](https://github.com/dtolnay/unicode-ident) ⚒️ | 1.0.16 | [David Tolnay](mailto:[email protected]) | (MIT OR Apache-2.0) AND Unicode-3.0 |
| [unicode-width](https://github.com/unicode-rs/unicode-width) | 0.2.0 | [kwantam](mailto:[email protected]) and [Manish Goregaokar](mailto:[email protected]) | MIT OR Apache-2.0 |
| [**utc2k**](https://github.com/Blobfolio/utc2k) | 0.11.2 | [Josh Stoik](mailto:[email protected]) | WTFPL |
| [version_check](https://github.com/SergioBenitez/version_check) ⚒️ | 0.9.5 | [Sergio Benitez](mailto:[email protected]) | MIT OR Apache-2.0 |
Expand Down
10 changes: 4 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,14 +170,12 @@ Debian and Ubuntu users can just grab the pre-built `.deb` package from the [rel
While specifically written for use on x86-64 Linux systems, both [Rust](https://www.rust-lang.org/) and [libcdio](https://www.gnu.org/software/libcdio/) are cross-platform, so you may well be able to build it from source on other 64-bit Unixish systems using `cargo`:

```bash
# Clone the repository:
git clone https://github.com/Blobfolio/riprip

# The libcdio development headers are required when building from source;
# Debian/Ubuntu users, for example, could run the following:
sudo apt-get install libcdio-dev

# Run Cargo build from the project root:
cd riprip
cargo build --release
# See "cargo install --help" for more options.
cargo install \
--git https://github.com/Blobfolio/riprip.git \
--bin riprip
```
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" "January 2025" "riprip v0.2.12" "User Commands"
.TH "RIP RIP HOORAY!" "1" "January 2025" "riprip v0.3.0" "User Commands"
.SH NAME
RIP RIP HOORAY! \- Manual page for riprip v0.2.12.
RIP RIP HOORAY! \- Manual page for riprip v0.3.0.
.SH DESCRIPTION
A specialized audio CD\-ripper optimized for incremental data recovery.
.SS USAGE:
Expand Down
7 changes: 3 additions & 4 deletions riprip/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "riprip"
version = "0.2.12"
version = "0.3.0"
license = "WTFPL"
authors = ["Josh Stoik <[email protected]>"]
edition = "2021"
Expand Down Expand Up @@ -130,14 +130,13 @@ argyle = "0.10.*"

[dependencies]
argyle = "0.10.*"
ctrlc = "=3.4.5"
dactyl = "0.9.*"
oxford_join = "0.4.*"
utc2k = "0.11.*"

[dependencies.fyi_msg]
version = "1.5.*"
features = [ "progress" ]
version = "1.6.*"
features = [ "signals" ]

[dependencies.riprip_core]
path = "../riprip_core"
Expand Down
55 changes: 3 additions & 52 deletions riprip/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,16 +72,6 @@ use riprip_core::{
use std::{
borrow::Cow,
fmt,
sync::{
atomic::{
AtomicBool,
Ordering::{
Relaxed,
SeqCst,
},
},
Arc,
},
};
use utc2k::FmtUtc2k;

Expand Down Expand Up @@ -145,12 +135,11 @@ fn main__() -> Result<(), RipRipError> {
if no_rip { return Ok(()); }

// Set up progress and killswitch in case they're needed.
let killed = KillSwitch::from(Progless::sigint_keepalive());
let progress = Progless::default();
let killed = KillSwitch::default();
sigint(killed.inner(), Some(progress.clone()));

// Just checking the status?
if status { return disc.status(&opts, &progress, &killed); }
if status { return disc.status(&opts, &progress, killed); }

// Parse the options.
rip_summary(&disc, &opts)?;
Expand All @@ -159,9 +148,7 @@ fn main__() -> Result<(), RipRipError> {
if opts.verbose() { log_header(&disc, &opts); }

// Rip and rip and rip!
let hide_cursor = HideCursor::new();
disc.rip(&opts, &progress, &killed)?;
drop(hide_cursor);
disc.rip(&opts, &progress, killed)?;

if killed.killed() { Err(RipRipError::Killed) }
else { Ok(()) }
Expand Down Expand Up @@ -362,39 +349,3 @@ fn rip_summary_tracks(opts: &RipOptions) -> String {
)),
}
}

/// # Hook Up CTRL+C.
fn sigint(killed: Arc<AtomicBool>, progress: Option<Progless>) {
let _res = ctrlc::set_handler(move ||
if killed.compare_exchange(false, true, SeqCst, Relaxed).is_ok() {
if let Some(p) = &progress {
p.sigint();

// Manually unhide the cursor; the drop glue probably won't run.
eprint!("{}", Progless::CURSOR_UNHIDE);
}
}
);
}

/// # Hide Cursor.
///
/// This helps control the hiding and showing of the cursor during progress
/// render. (The drop glue is key.)
struct HideCursor(());

impl Drop for HideCursor {
fn drop(&mut self) {
// Unhide the cursor.
eprint!("{}", Progless::CURSOR_UNHIDE);
}
}

impl HideCursor {
/// # New!
fn new() -> Self {
// Hide the cursor.
eprint!("{}", Progless::CURSOR_HIDE);
Self(())
}
}
6 changes: 3 additions & 3 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.12"
version = "0.3.0"
license = "WTFPL"
authors = ["Josh Stoik <[email protected]>"]
edition = "2021"
Expand All @@ -19,8 +19,8 @@ trimothy = "0.6.*"
utc2k = "0.11.*"

[dependencies.fyi_msg]
version = "1.5.*"
features = [ "progress" ]
version = "1.6.*"
features = [ "signals" ]

[dependencies.libcdio-sys]
version = "=0.5.2"
Expand Down
13 changes: 5 additions & 8 deletions riprip_core/src/abort.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,26 +12,23 @@ use std::sync::{



#[derive(Debug)]
#[derive(Debug, Clone, Copy)]
/// # Kill Switch.
///
/// This is a short-circuit for long-running operations across multiple
/// threads. (Ripping is single-threaded, but the progress bar isn't.)
///
/// The main program's CTRL-C intercept sets the value, allowing Rip Rip to
/// tidy up before dying.
pub struct KillSwitch(Arc<AtomicBool>);
pub struct KillSwitch(&'static Arc<AtomicBool>);

impl Default for KillSwitch {
fn default() -> Self { Self(Arc::from(AtomicBool::new(false))) }
impl From<&'static Arc<AtomicBool>> for KillSwitch {
#[inline]
fn from(src: &'static Arc<AtomicBool>) -> Self { Self(src) }
}

impl KillSwitch {
#[must_use]
/// # Dead?
pub fn killed(&self) -> bool { self.0.load(Acquire) }

#[must_use]
/// # Inner Clone.
pub fn inner(&self) -> Arc<AtomicBool> { Arc::clone(&self.0) }
}
4 changes: 2 additions & 2 deletions riprip_core/src/cdio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@ impl LibcdioInstance {
rng: &Range<i32>,
leadout: i32,
backwards: bool,
killed: &KillSwitch,
killed: KillSwitch,
) {
if 0 != todo && buf.len() == usize::from(CD_DATA_SIZE) {
let now = Instant::now();
Expand Down Expand Up @@ -472,7 +472,7 @@ impl LibcdioInstance {
to: i32,
todo: &mut u32,
now: Instant,
killed: &KillSwitch,
killed: KillSwitch,
) {
while from < to && 0 < *todo {
if killed.killed() || CACHE_BUST_TIMEOUT < now.elapsed() {
Expand Down
4 changes: 2 additions & 2 deletions riprip_core/src/disc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ impl Disc {
/// ## Errors
///
/// This will bubble up any IO/rip/etc. errors encountered along the way.
pub fn rip(&self, opts: &RipOptions, progress: &Progless, killed: &KillSwitch)
pub fn rip(&self, opts: &RipOptions, progress: &Progless, killed: KillSwitch)
-> Result<(), RipRipError> {
use std::io::Write;

Expand Down Expand Up @@ -343,7 +343,7 @@ impl Disc {
/// ## Errors
///
/// This will return an error if there are I/O problems or the user aborts.
pub fn status(&self, opts: &RipOptions, progress: &Progless, killed: &KillSwitch)
pub fn status(&self, opts: &RipOptions, progress: &Progless, killed: KillSwitch)
-> Result<(), RipRipError> {
// Load the ripper.
let mut rip = Ripper::new(self, opts)?;
Expand Down
2 changes: 1 addition & 1 deletion riprip_core/src/rip/buf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ impl RipBuffer {
rng: &Range<i32>,
leadout: i32,
backwards: bool,
killed: &KillSwitch,
killed: KillSwitch,
) {
cdio.cache_bust(self.data_slice_mut(), len, rng, leadout, backwards, killed);
}
Expand Down
8 changes: 4 additions & 4 deletions riprip_core/src/rip/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ impl<'a> Ripper<'a> {
/// support an operation at all — it's missing a feature, etc. — or there
/// are I/O issues with the state data, etc., those will kill the process
/// and be returned.
pub(crate) fn rip(&mut self, progress: &Progless, killed: &KillSwitch)
pub(crate) fn rip(&mut self, progress: &Progless, killed: KillSwitch)
-> Result<(), RipRipError> {
// We should definitely have a first track, but if for some reason we
// don't there's nothing more to do!
Expand Down Expand Up @@ -267,7 +267,7 @@ impl<'a> Ripper<'a> {
/// # Status.
///
/// Check the status of each track and nothing else.
pub(crate) fn status(&mut self, progress: &Progless, killed: &KillSwitch)
pub(crate) fn status(&mut self, progress: &Progless, killed: KillSwitch)
-> Result<(), RipRipError> {
// We should definitely have a first track, but if for some reason we
// don't there's nothing more to do!
Expand Down Expand Up @@ -791,13 +791,13 @@ struct RipShare<'a> {
progress: &'a Progless,

/// # Killswitch.
killed: &'a KillSwitch,
killed: KillSwitch,
}

impl<'a> RipShare<'a> {
#[expect(clippy::cast_possible_wrap, reason = "False positive.")]
/// # New Instance.
const fn new(disc: &'a Disc, progress: &'a Progless, killed: &'a KillSwitch) -> Self {
const fn new(disc: &'a Disc, progress: &'a Progless, killed: KillSwitch) -> Self {
Self {
buf: RipBuffer::new(),
log: RipLog::new(),
Expand Down

0 comments on commit d0cb346

Please sign in to comment.