Skip to content

Commit

Permalink
Remove Snafu.
Browse files Browse the repository at this point in the history
After some thought & some research, I decided I want to hand-craft
my Errors. Thoughts here:

<https://www.unwoundstack.com/blog/rust-error-handling.html>

    - Snafu has been removed
    - `cargo test` passes
    - `cargo doc` builds cleanly
  • Loading branch information
sp1ff committed Jul 16, 2023
1 parent 956f006 commit a98aaca
Show file tree
Hide file tree
Showing 22 changed files with 1,576 additions and 1,089 deletions.
12 changes: 12 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
2021-12-16 Michael Herstine <[email protected]>

Remove Snafu.
After some thought & some research, I decided I want to hand-craft
my Errors. Thoughts here:

<https://www.unwoundstack.com/blog/rust-error-handling.html>

- Snafu has been removed
- `cargo test` passes
- `cargo doc` builds cleanly

2021-10-11 Michael Herstine <[email protected]>

Address issue #5.
Expand Down
97 changes: 53 additions & 44 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,112 +1,121 @@
mpdpopm News -- history of user-visible changes -*- outline -*-

* 0.3.0 build
* 0.3 builds

** Bugfixes
** 0.3.1 build

*** Address Issue #5: Cannot connect to mpd unix socket
* 0.2.3 build
No user-visible changes; strictly a hygiene build (re-vamped error-handling throughout).
** 0.3.0 build

** User-visible changes
*** Bugfixes

*** broke-up the README
**** Address Issue #5: Cannot connect to mpd unix socket
* 0.2 builds

** 0.2.3 build

*** User-visible changes

**** broke-up the README

Broke-up README.org into a much shorter version focused on installing mpdpopm and a full-fledged user-manual.

** Bug-fixes
*** Bug-fixes

*** quoting
**** quoting

Fixed a number of bugs relating to quoting filters.

* 0.2.2 build
** 0.2.2 build

** User-visible changes
*** User-visible changes

*** `searchadd' command fully working
**** `searchadd' command fully working

*** `mppopm' now has findadd & searchadd commands
* 0.2.1 build
**** `mppopm' now has findadd & searchadd commands
** 0.2.1 build

** User-visible changes
*** User-visible changes

*** `findadd' command fully working
* 0.2.0 build
**** `findadd' command fully working
** 0.2.0 build

** User-visible changes
*** User-visible changes

*** `findadd' command
**** `findadd' command

mpdpopm now supports a `findadd' command; just like the MPD command by the same name, but this implementation includes terms for information managed by mpdpopm (so you can search for tracks with a rating > 3 stars, for instance).

* 0.1.15 build
* 0.1 builds

** 0.1.15 build

** User-visible changes
*** User-visible changes

*** Include sample configuration & systemd unit files
**** Include sample configuration & systemd unit files

*** Begin providing an Arch package
**** Begin providing an Arch package

* 0.1.14 build
** 0.1.14 build

** User-visible changes
*** User-visible changes

*** Complete re-write of the README
**** Complete re-write of the README

*** Releases will now contain pre-built binaries & a Debian binary package
* 0.1.13 build
**** Releases will now contain pre-built binaries & a Debian binary package
** 0.1.13 build

** Bugfixes
*** Bugfixes

*** Issue 1: `get_messages` fails on repeated channels
* 0.1.12 build
**** Issue 1: `get_messages` fails on repeated channels
** 0.1.12 build

Minor changes preparatory to publication on crates.io; no user-facing changes.
* 0.1.11 build
** 0.1.11 build

** User-visible changes
*** User-visible changes

- scribbu feature replaced with a generalized command facility
* 0.1.10 build
** 0.1.10 build

** User-visible changes
*** User-visible changes

- 'mppopm set-genre' now takes free-form text rather than a numeric genre
* 0.1.9 build
** 0.1.9 build

** User-visible changes
*** User-visible changes

- removed the "sent-to-playlist" command
** Bugfixes
*** Bugfixes

- fixed: failure in message processing caused the daemon to exit
* 0.1.8 build: daemon support
** 0.1.8 build: daemon support

- added support for running `mppopmd' as a daemon

* 0.1.7 build: re-factoring & bug fixes
** 0.1.7 build: re-factoring & bug fixes

- added support for commands to signal the need for an update on completion
- fixed bug in in the "update" command processing

* 0.1.6 build: new server-side commands
** 0.1.6 build: new server-side commands

Gated behind the "scribbu" feature flag

- setgenre
- setxtag

* 0.1.5 build: new server-side commands
** 0.1.5 build: new server-side commands

- setpc
- setlp
- send

* 0.1.4 build: client features, daemon bug fixes
** 0.1.4 build: client features, daemon bug fixes

* 0.1.3 build: complete re-factor
** 0.1.3 build: complete re-factor

- split the code into separate daemon & cli

* 0.1.2 build: No news, yet!
** 0.1.2 build: No news, yet!

24 changes: 12 additions & 12 deletions README.org
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#+AUTHOR: Michael Herstine
#+DESCRIPTION: mpdpopm
#+EMAIL: [email protected]
#+DATE: <2021-10-11 Mon 12:10>
#+DATE: <2021-12-16 Thu 18:03>
#+AUTODATE: t

* Introduction
Expand Down Expand Up @@ -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.0.tar.gz https://github.com/sp1ff/mpdpopm/releases/download/0.3.0/mpdpopm-0.3.0-x86_64-unknown-linux.tar.gz
tar xf mpdpopm-0.3.0.tar.gz
tree mpdpopm-0.3.0-x86_64-unknown-linux/
mpdpopm-0.3.0-x86_64-unknown-linux/
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/
├── bin
│ ├── mppopm
│ └── mppopmd
Expand Down Expand Up @@ -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.0/mpdpopm_0.3.0_amd64.deb
sudo dpkg -i mpdpopm_0.3.0_amd64.deb
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
#+END_SRC

The binaries will be placed in =/usr/local/bin=, and you can proceed to [[#getting_started][Getting Started]], below.
Expand All @@ -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.0/mpdpopm_0.3.0-1-x86_64.pkg.tar.zst
sudo pacman -U mpdpopm_0.3.0-1-x86_64.pkg.tar.zst
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
#+END_SRC

The binaries will be placed in =/usr/local/bin=, and you can proceed to [[#getting_started][Getting Started]], below.
Expand All @@ -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.0/mpdpopm-0.3.0.tar.xz
tar xf mpdpopm-0.3.0.tar.xz
cd mpdpopm-0.3.0
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
./configure
make
make check
Expand Down
26 changes: 13 additions & 13 deletions admin/Dockerfile-arch
Original file line number Diff line number Diff line change
Expand Up @@ -8,32 +8,32 @@ RUN pacman --noconfirm -Syu && \
cp -v /tmp/pacman.conf.tmp /etc/pacman.conf

# WORKAROUND for glibc 2.33 and old Docker
# Seems to be no longer needed
# See https://github.com/actions/virtual-environments/issues/2658
# Thanks to https://github.com/lxqt/lxqt-panel/pull/1562
RUN patched_glibc=glibc-linux4-2.33-4-x86_64.pkg.tar.zst && \
curl -LO "https://repo.archlinuxcn.org/x86_64/$patched_glibc" && \
bsdtar -C / -xvf "$patched_glibc"
# RUN patched_glibc=glibc-linux4-2.33-4-x86_64.pkg.tar.zst && \
# curl -LO "https://repo.archlinuxcn.org/x86_64/$patched_glibc" && \
# bsdtar -C / -xvf "$patched_glibc"

# Get the mirrorlist up-to-date
RUN pacman rsync --noconfirm -S reflector rsync && reflector --latest 16 --protocol https --sort rate --save /etc/pacman.d/mirrorlist
# RUN pacman rsync --noconfirm -S reflector rsync && \
# reflector --latest 16 --protocol https --sort rate --save /etc/pacman.d/mirrorlist

# TODO(sp1ff): WTF? See here https://bbs.archlinux.org/viewtopic.php?id=141029
# RUN pacman --noconfirm -S man-db man-pages texinfo vim base-devel gdb && \
RUN pacman --noconfirm -Syyu man-db man-pages texinfo vim base-devel gdb rust cargo && \
# See here https://bbs.archlinux.org/viewtopic.php?id=141029
# Not sure why the -yyu needed, perhaps as a result of reflector changing the mirrorlist?
# RUN pacman --noconfirm -Syyu man-db man-pages texinfo vim base-devel gdb rust cargo && \
RUN pacman --noconfirm -S man-db man-pages texinfo vim base-devel gdb rust cargo && \
ln -sf /usr/share/zoneinfo/America/Los_Angeles /etc/localtime && \
useradd -ms /bin/bash -G users,wheel mgh && \
echo 'mgh:mgh' | chpasswd && \
echo "%wheel ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers && \
mkdir /cores && chmod 777 /cores && \
echo "kernel.core_pattern=/cores/core.%e.%p" >> /etc/sysctl.d/50-coredump.conf
echo "kernel.core_pattern=/cores/core.%e.%p" >> /etc/sysctl.d/50-coredump.conf

# TODO(sp1ff): needed?
# sysctl -p /etc/sysctl.d/50-coredump.conf
# RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | bash -s -- -y
# Rhm... needed?
# sudo sysctl -p /etc/sysctl.d/50-coredump.conf

USER mgh

# RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs > rust.sh && chmod 755 ./rust.sh && ./rust.sh -y

ENV PATH="/home/mgh/.cargo/bin:${PATH}"

4 changes: 3 additions & 1 deletion admin/Dockerfile-debian
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ RUN set -ex && \
echo "path-include /usr/share/man/man1/scribbu*" >> /etc/dpkg/dpkg.cfg.d/docker && \
echo "path-include /usr/share/info/scribbu.info" >> /etc/dpkg/dpkg.cfg.d/docker && \
useradd -ms /bin/bash -G users,sudo mgh && \
echo 'mgh:mgh' | chpasswd
echo 'mgh:mgh' | chpasswd && \
cp -v /etc/sudoers /etc/sudoers.orig && \
echo 'mgh ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers

# The test suite won't work if this isn't set:
ENV LANG="en_US.UTF-8"
Expand Down
5 changes: 5 additions & 0 deletions admin/build-dev-arch-pkg-cnt
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,9 @@ cp -v /PKGBUILD /tmp
cd /tmp
makepkg -g >> PKGBUILD
makepkg
sudo pacman --noconfirm -Uv mpdpopm-${version}-1-x86_64.pkg.tar.zst
mppopm --version
mppopm --help
test -f /usr/local/share/info/mpdpopm.info.gz
sudo pacman --noconfirm -R mpdpopm
cp -v mpdpopm-${version}-1-x86_64.pkg.tar.zst /mpdpopm
5 changes: 5 additions & 0 deletions admin/build-dev-debian-pkg-cnt
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,10 @@ cp -v /LICENSE .
./configure
cd mpdpopm
cargo deb
sudo dpkg --debug=2 -i target/debian/mpdpopm_${version}_amd64.deb
mppopm --version
mppopm --help
test -f /usr/local/share/info/mpdpopm.info
sudo dpkg --debug=2 -r mpdpopm
sudo cp -v target/debian/mpdpopm_${version}_amd64.deb /mpdpopm

2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
AC_INIT([mpdpopm], [0.3.0], [[email protected]], [mpdpopm], [https://github.com/sp1ff/mpdpopm])
AC_INIT([mpdpopm], [0.3.1], [[email protected]], [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])
Expand Down
4 changes: 2 additions & 2 deletions doc/version.texi
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@set UPDATED 29 March 2021
@set UPDATED-MONTH March 2021
@set EDITION 0.3.0
@set VERSION 0.3.0
@set EDITION 0.3.1
@set VERSION 0.3.1
5 changes: 3 additions & 2 deletions mpdpopm/Cargo.toml.in
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,22 @@ lalrpop = { version = "0.19", features = ["lexer"] }

[dependencies]
async-trait = "0.1.31"
backtrace = "0.3.46"
boolinator = "2.4.0"
chrono = "0.4.19"
clap = "=3.0.0-beta.1"
errno = "0.2.6"
futures = "0.3.5"
lalrpop-util = "0.19"
lazy_static = "1.4.0"
libc = "0.2.74"
log = "0.4.8"
log4rs = "0.10.0"
os_str_bytes = "2.3.1"
pin-project = "0.4.17"
pin-project = "1.0.8"
regex = "1.3.6"
serde = { version = "1.0", features = ["derive"] }
serde-lexpr = "0.1.1"
snafu = { version = "0.6.7", features = ["backtraces"] }
tokio = { version = "0.2.22", features = ["dns", "io-util", "macros", "process", "rt-threaded", "signal", "tcp", "time", "uds"] }

[package.metadata.deb]
Expand Down
1 change: 0 additions & 1 deletion mpdpopm/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ DISTCLEANFILES = $(builddir)/Cargo.toml
common_sources = clients.rs \
commands.rs \
config.rs \
error_from.rs \
lib.rs \
messages.rs \
playcounts.rs \
Expand Down
Loading

0 comments on commit a98aaca

Please sign in to comment.