Skip to content

Commit 8d6baf0

Browse files
committed
vopono v0.6.1 - Hotfix for pactl parse errors
1 parent 053978e commit 8d6baf0

File tree

3 files changed

+13
-6
lines changed

3 files changed

+13
-6
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "vopono"
33
description = "Launch applications via VPN tunnels using temporary network namespaces"
4-
version = "0.6.0"
4+
version = "0.6.1"
55
authors = ["James McMurray <[email protected]>"]
66
edition = "2018"
77
license = "GPL-3.0-or-later"

src/main.rs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ mod wireguard;
2222

2323
use list::output_list;
2424
use list_configs::print_configs;
25-
use log::{debug, LevelFilter};
25+
use log::{debug, warn, LevelFilter};
2626
use netns::NetworkNamespace;
2727
use structopt::StructOpt;
2828
use sync::{sync_menu, synch};
@@ -52,8 +52,15 @@ fn main() -> anyhow::Result<()> {
5252
args::Command::Exec(cmd) => {
5353
clean_dead_locks()?;
5454
if which("pactl").is_ok() {
55-
let pa = pulseaudio::get_pulseaudio_server()?;
56-
std::env::set_var("PULSE_SERVER", pa);
55+
let pa = pulseaudio::get_pulseaudio_server();
56+
if let Ok(pa) = pa {
57+
std::env::set_var("PULSE_SERVER", pa);
58+
} else {
59+
warn!(
60+
"Could not parse PULSE_SERVER from pactl info output: {:?}",
61+
pa
62+
);
63+
}
5764
} else {
5865
debug!("pactl not found, will not set PULSE_SERVER");
5966
}

src/pulseaudio.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ pub fn get_pulseaudio_server() -> anyhow::Result<String> {
1010

1111
let caps = re.captures(output);
1212
if caps.is_none() {
13-
return Err(anyhow!("Could not parse pactl output!"));
13+
return Err(anyhow!("Could not parse pactl output!:\n{}", output));
1414
}
1515
let caps = caps.unwrap().get(1);
1616
if caps.is_none() {
17-
return Err(anyhow!("Could not parse pactl output!"));
17+
return Err(anyhow!("Could not parse pactl output!:\n{}", output));
1818
}
1919

2020
let out = caps.unwrap().as_str().to_string();

0 commit comments

Comments
 (0)