fix(linux): restore legacy CUPS capture compatibility
Some checks failed
Desktop Release / Bootstrap updater signing key (push) Has been cancelled
Desktop Release / Windows x64 NSIS (push) Has been cancelled
Desktop Release / Linux x64 DEB + AppImage (push) Has been cancelled
Desktop Release / Publish public desktop release (push) Has been cancelled
Some checks failed
Desktop Release / Bootstrap updater signing key (push) Has been cancelled
Desktop Release / Windows x64 NSIS (push) Has been cancelled
Desktop Release / Linux x64 DEB + AppImage (push) Has been cancelled
Desktop Release / Publish public desktop release (push) Has been cancelled
This commit is contained in:
parent
0da470e66d
commit
68052a11ef
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@fieldlens/print",
|
"name": "@fieldlens/print",
|
||||||
"version": "0.1.25",
|
"version": "0.1.26",
|
||||||
"private": true,
|
"private": true,
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "fieldlens-print"
|
name = "fieldlens-print"
|
||||||
version = "0.1.25"
|
version = "0.1.26"
|
||||||
description = "FieldLens print-stream barcode capture companion"
|
description = "FieldLens print-stream barcode capture companion"
|
||||||
authors = ["Arrowstack"]
|
authors = ["Arrowstack"]
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|||||||
@ -28,6 +28,8 @@ use crate::{
|
|||||||
#[cfg(target_os = "linux")]
|
#[cfg(target_os = "linux")]
|
||||||
const SYSTEM_CUPS_SPOOL_DIR: &str = "/var/lib/fieldlens-print/capture";
|
const SYSTEM_CUPS_SPOOL_DIR: &str = "/var/lib/fieldlens-print/capture";
|
||||||
#[cfg(target_os = "linux")]
|
#[cfg(target_os = "linux")]
|
||||||
|
const LEGACY_CUPS_SPOOL_DIR: &str = "/var/cache/cups/fieldlens-print";
|
||||||
|
#[cfg(target_os = "linux")]
|
||||||
const TEST_CAPTURE_SINK_ADDR: &str = "127.0.0.1:9101";
|
const TEST_CAPTURE_SINK_ADDR: &str = "127.0.0.1:9101";
|
||||||
|
|
||||||
pub struct CaptureRuntime {
|
pub struct CaptureRuntime {
|
||||||
@ -65,7 +67,8 @@ pub fn start(config: AppConfig, state: SharedState, app: AppHandle) -> Result<Ca
|
|||||||
if matches!(config.mode, CaptureMode::SpoolFolder | CaptureMode::Both) {
|
if matches!(config.mode, CaptureMode::SpoolFolder | CaptureMode::Both) {
|
||||||
let spool_dir = PathBuf::from(&config.spool_dir);
|
let spool_dir = PathBuf::from(&config.spool_dir);
|
||||||
#[cfg(target_os = "linux")]
|
#[cfg(target_os = "linux")]
|
||||||
let is_system_cups_spool = spool_dir == PathBuf::from(SYSTEM_CUPS_SPOOL_DIR);
|
let is_system_cups_spool = spool_dir == PathBuf::from(SYSTEM_CUPS_SPOOL_DIR)
|
||||||
|
|| spool_dir == PathBuf::from(LEGACY_CUPS_SPOOL_DIR);
|
||||||
#[cfg(not(target_os = "linux"))]
|
#[cfg(not(target_os = "linux"))]
|
||||||
let is_system_cups_spool = false;
|
let is_system_cups_spool = false;
|
||||||
|
|
||||||
@ -93,7 +96,8 @@ pub fn start(config: AppConfig, state: SharedState, app: AppHandle) -> Result<Ca
|
|||||||
|
|
||||||
#[cfg(target_os = "linux")]
|
#[cfg(target_os = "linux")]
|
||||||
{
|
{
|
||||||
let system_spool = PathBuf::from(SYSTEM_CUPS_SPOOL_DIR);
|
for spool in [SYSTEM_CUPS_SPOOL_DIR, LEGACY_CUPS_SPOOL_DIR] {
|
||||||
|
let system_spool = PathBuf::from(spool);
|
||||||
let worker_stop = stop.clone();
|
let worker_stop = stop.clone();
|
||||||
let worker_state = state.clone();
|
let worker_state = state.clone();
|
||||||
let worker_app = app.clone();
|
let worker_app = app.clone();
|
||||||
@ -107,6 +111,7 @@ pub fn start(config: AppConfig, state: SharedState, app: AppHandle) -> Result<Ca
|
|||||||
worker_stop,
|
worker_stop,
|
||||||
)
|
)
|
||||||
}));
|
}));
|
||||||
|
}
|
||||||
|
|
||||||
let sink = TcpListener::bind(TEST_CAPTURE_SINK_ADDR)
|
let sink = TcpListener::bind(TEST_CAPTURE_SINK_ADDR)
|
||||||
.with_context(|| format!("bind test-capture sink {TEST_CAPTURE_SINK_ADDR}"))?;
|
.with_context(|| format!("bind test-capture sink {TEST_CAPTURE_SINK_ADDR}"))?;
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"$schema": "https://schema.tauri.app/config/2",
|
"$schema": "https://schema.tauri.app/config/2",
|
||||||
"productName": "FieldLens Print",
|
"productName": "FieldLens Print",
|
||||||
"version": "0.1.25",
|
"version": "0.1.26",
|
||||||
"identifier": "dev.arrowstack.fieldlens.print",
|
"identifier": "dev.arrowstack.fieldlens.print",
|
||||||
"build": {
|
"build": {
|
||||||
"beforeDevCommand": "npm run dev",
|
"beforeDevCommand": "npm run dev",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user