diff --git a/ChangeLog b/ChangeLog index 6188c71..fad71b0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,8 @@ -2021-12-16 Michael Herstine +2021-12-30 Michael Herstine + + Upgraded to tokio 1.0. + +2021-12-18 Michael Herstine Remove Snafu. After some thought & some research, I decided I want to hand-craft diff --git a/NEWS b/NEWS index 4b7d8c6..54dce66 100644 --- a/NEWS +++ b/NEWS @@ -2,6 +2,9 @@ mpdpopm News -- history of user-visible changes -*- outline -*- * 0.3 builds +** 0.3.2 build + +No user-visible changes; strictly a hygiene build (updated to Tokio 1.0). ** 0.3.1 build No user-visible changes; strictly a hygiene build (re-vamped error-handling throughout). diff --git a/README.org b/README.org index f460b46..22bf8dd 100644 --- a/README.org +++ b/README.org @@ -2,7 +2,7 @@ #+AUTHOR: Michael Herstine #+DESCRIPTION: mpdpopm #+EMAIL: sp1ff@pobox.com -#+DATE: <2021-12-16 Thu 18:03> +#+DATE: <2021-12-30 Thu 07:49> #+AUTODATE: t * Introduction @@ -56,10 +56,10 @@ Thanks to a suggestion by [[https://github.com/m040601][m040601]], you can down #+BEGIN_SRC bash cd /tmp -curl -L --output mpdpopm-0.3.1.tar.gz https://github.com/sp1ff/mpdpopm/releases/download/0.3.1/mpdpopm-0.3.1-x86_64-unknown-linux.tar.gz -tar xf mpdpopm-0.3.1.tar.gz -tree mpdpopm-0.3.1-x86_64-unknown-linux/ -mpdpopm-0.3.1-x86_64-unknown-linux/ +curl -L --output mpdpopm-0.3.2.tar.gz https://github.com/sp1ff/mpdpopm/releases/download/0.3.2/mpdpopm-0.3.2-x86_64-unknown-linux.tar.gz +tar xf mpdpopm-0.3.2.tar.gz +tree mpdpopm-0.3.2-x86_64-unknown-linux/ +mpdpopm-0.3.2-x86_64-unknown-linux/ ├── bin │ ├── mppopm │ └── mppopmd @@ -89,8 +89,8 @@ If you're running on a Debian-based Linux distribution, and you're on an x86_64 #+BEGIN_SRC bash cd /tmp -curl -L -O https://github.com/sp1ff/mpdpopm/releases/download/0.3.1/mpdpopm_0.3.1_amd64.deb -sudo dpkg -i mpdpopm_0.3.1_amd64.deb +curl -L -O https://github.com/sp1ff/mpdpopm/releases/download/0.3.2/mpdpopm_0.3.2_amd64.deb +sudo dpkg -i mpdpopm_0.3.2_amd64.deb #+END_SRC The binaries will be placed in =/usr/local/bin=, and you can proceed to [[#getting_started][Getting Started]], below. @@ -101,8 +101,8 @@ If you're running on an Arch-based Linux distribution, and you're on an x86_64 p #+BEGIN_SRC bash cd /tmp -curl -L -O https://github.com/sp1ff/mpdpopm/releases/download/0.3.1/mpdpopm_0.3.1-1-x86_64.pkg.tar.zst -sudo pacman -U mpdpopm_0.3.1-1-x86_64.pkg.tar.zst +curl -L -O https://github.com/sp1ff/mpdpopm/releases/download/0.3.2/mpdpopm_0.3.2-1-x86_64.pkg.tar.zst +sudo pacman -U mpdpopm_0.3.2-1-x86_64.pkg.tar.zst #+END_SRC The binaries will be placed in =/usr/local/bin=, and you can proceed to [[#getting_started][Getting Started]], below. @@ -113,9 +113,9 @@ If you've got the Rust toolchain as well as Autotools installed, you can build f #+BEGIN_SRC bash cd /tmp -curl -L -O https://github.com/sp1ff/mpdpopm/releases/download/0.3.1/mpdpopm-0.3.1.tar.xz -tar xf mpdpopm-0.3.1.tar.xz -cd mpdpopm-0.3.1 +curl -L -O https://github.com/sp1ff/mpdpopm/releases/download/0.3.2/mpdpopm-0.3.2.tar.xz +tar xf mpdpopm-0.3.2.tar.xz +cd mpdpopm-0.3.2 ./configure make make check diff --git a/configure.ac b/configure.ac index 4caa001..fcbe5dd 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -AC_INIT([mpdpopm], [0.3.1], [sp1ff@pobox.com], [mpdpopm], [https://github.com/sp1ff/mpdpopm]) +AC_INIT([mpdpopm], [0.3.2], [sp1ff@pobox.com], [mpdpopm], [https://github.com/sp1ff/mpdpopm]) AC_CONFIG_AUX_DIR([build-aux]) AC_CONFIG_SRCDIR([mpdpopm/Cargo.toml.in]) AM_INIT_AUTOMAKE([-Wall -Werror -Wno-portability -Wno-override gnits std-options dist-bzip2 dist-xz]) diff --git a/doc/version.texi b/doc/version.texi index 4fb424b..2e1f7f0 100644 --- a/doc/version.texi +++ b/doc/version.texi @@ -1,4 +1,4 @@ @set UPDATED 29 March 2021 @set UPDATED-MONTH March 2021 -@set EDITION 0.3.1 -@set VERSION 0.3.1 +@set EDITION 0.3.2 +@set VERSION 0.3.2 diff --git a/mpdpopm/Cargo.toml.in b/mpdpopm/Cargo.toml.in index da2f707..9690ace 100644 --- a/mpdpopm/Cargo.toml.in +++ b/mpdpopm/Cargo.toml.in @@ -22,7 +22,8 @@ boolinator = "2.4.0" chrono = "0.4.19" clap = "=3.0.0-beta.1" errno = "0.2.6" -futures = "0.3.5" +# futures = "0.3.5" +futures = "0.3.19" lalrpop-util = "0.19" lazy_static = "1.4.0" libc = "0.2.74" @@ -33,7 +34,7 @@ pin-project = "1.0.8" regex = "1.3.6" serde = { version = "1.0", features = ["derive"] } serde-lexpr = "0.1.1" -tokio = { version = "0.2.22", features = ["dns", "io-util", "macros", "process", "rt-threaded", "signal", "tcp", "time", "uds"] } +tokio = { version = "1.15.0", features = ["io-util", "macros", "net", "process", "rt-multi-thread", "signal", "time"] } [package.metadata.deb] maintainer = "@PACKAGE_AUTHOR@" diff --git a/mpdpopm/src/bin/mppopmd.rs b/mpdpopm/src/bin/mppopmd.rs index 288983b..98dead7 100644 --- a/mpdpopm/src/bin/mppopmd.rs +++ b/mpdpopm/src/bin/mppopmd.rs @@ -389,7 +389,7 @@ commands to keep your tags up-to-date.", // One way or another, we are now the "final" process. Announce ourselves... info!("mppopmd {} logging at level {:#?}.", VERSION, lf); // spin-up the Tokio runtime... - let mut rt = tokio::runtime::Runtime::new().unwrap(); + let rt = tokio::runtime::Runtime::new().unwrap(); // and invoke `mpdpopm'. rt.block_on(mpdpopm(cfg)).map_err(|err| Error::MpdPopm { source: err, diff --git a/mpdpopm/src/clients.rs b/mpdpopm/src/clients.rs index 1e7e2e1..6fada02 100644 --- a/mpdpopm/src/clients.rs +++ b/mpdpopm/src/clients.rs @@ -35,10 +35,8 @@ use async_trait::async_trait; use backtrace::Backtrace; use log::{debug, info}; use regex::Regex; -use tokio::{ - net::{TcpStream, ToSocketAddrs, UnixStream}, - prelude::*, -}; +use tokio::io::{AsyncRead, AsyncReadExt, AsyncWrite, AsyncWriteExt}; +use tokio::net::{TcpStream, ToSocketAddrs, UnixStream}; use lazy_static::lazy_static; @@ -463,7 +461,7 @@ where /// Utility function to parse the initial response to a connection from mpd async fn parse_connect_rsp(sock: &mut T) -> Result where - T: AsyncRead + AsyncWrite + Send + Unpin, + T: AsyncReadExt + AsyncWriteExt + Send + Unpin, { let mut buf = Vec::with_capacity(32); let _cb = sock.read_buf(&mut buf).await?; diff --git a/mpdpopm/src/filters.lalrpop b/mpdpopm/src/filters.lalrpop index c229574..5c9a5de 100644 --- a/mpdpopm/src/filters.lalrpop +++ b/mpdpopm/src/filters.lalrpop @@ -75,7 +75,6 @@ pub Token: Value = { error: "Internal parse error while parsing unsigned int" }) } }, - // TODO(sp1ff): use =>? ,./?]|\\\\|\\"|\\')+""#> => { eprintln!("matched token: ``{}''.", s); let s = expect_quoted(s).unwrap(); @@ -84,7 +83,6 @@ pub Token: Value = { Err(_) => Value::Text(s), } }, - // TODO(sp1ff): use =>? ,./?]|\\\\|\\'|\\")+'"#> => { eprintln!("matched token: ``{}''.", s); let s = expect_quoted(s).unwrap(); diff --git a/mpdpopm/src/lib.rs b/mpdpopm/src/lib.rs index 3952f5c..63aec25 100644 --- a/mpdpopm/src/lib.rs +++ b/mpdpopm/src/lib.rs @@ -64,7 +64,7 @@ use log::{debug, error, info}; use tokio::{ signal, signal::unix::{signal, SignalKind}, - time::{delay_for, Duration}, + time::{sleep, Duration}, }; use std::path::PathBuf; @@ -187,7 +187,7 @@ pub async fn mpdpopm(cfg: Config) -> std::result::Result<(), Error> { let sighup = hup.recv().fuse(); let sigkill = kill.recv().fuse(); - let tick = delay_for(Duration::from_millis(cfg.poll_interval_ms)).fuse(); + let tick = sleep(Duration::from_millis(cfg.poll_interval_ms)).fuse(); pin_mut!(ctrl_c, sighup, sigkill, tick); let mut cmds = FuturesUnordered::>>::new(); @@ -245,7 +245,7 @@ pub async fn mpdpopm(cfg: Config) -> std::result::Result<(), Error> { break; }, _ = tick => { - tick.set(delay_for(Duration::from_millis(cfg.poll_interval_ms)).fuse()); + tick.set(sleep(Duration::from_millis(cfg.poll_interval_ms)).fuse()); if let Some(fut) = state.update(&mut client, &cfg.playcount_command, &mut cfg.playcount_command_args