From eb9c2d9bf9aca1acb764f694be8fbb1086b52104 Mon Sep 17 00:00:00 2001 From: Robbert van der Helm Date: Wed, 16 Jun 2021 13:09:20 +0200 Subject: [PATCH] [yabridgectl] Don't panic on empty wine --version And print a more descriptive error message instead. This is only relevant when using a `WINELOADER` that causes `$WINELOADER --version` to not output anything. --- CHANGELOG.md | 4 ++++ tools/yabridgectl/src/utils.rs | 7 ++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4c244780..4a0c3e7e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -49,6 +49,10 @@ Versioning](https://semver.org/spec/v2.0.0.html). when supported by the file system. This speeds up the file coyping process while also reducing the amount of disk space used for yabridge when using Btrfs or XFS. +- Print a more descriptive error message instead of panicing if running + `$WINELOADER --version` during yabridgectl's post-setup verification checks + does not result in any output. This is only relevant when using a custom + `WINELOADER` script that modifies Wine's output. ## [3.3.1] - 2021-06-09 diff --git a/tools/yabridgectl/src/utils.rs b/tools/yabridgectl/src/utils.rs index cbb187b5..dbcc5455 100644 --- a/tools/yabridgectl/src/utils.rs +++ b/tools/yabridgectl/src/utils.rs @@ -262,7 +262,12 @@ pub fn verify_wine_setup(config: &mut Config) -> Result<()> { .stdout; // Strip the trailing newline just to make the config file a bit neater let mut wine_version = String::from_utf8(wine_version_output)?; - wine_version.pop().unwrap(); + wine_version.pop().with_context(|| { + format!( + "Running '{} --version' resulted in empty output", + wine_binary + ) + })?; let files = config .files()