From 2871dfbdb8818b125ade924547d5427b318a54e8 Mon Sep 17 00:00:00 2001 From: Soispha Date: Sun, 14 Jan 2024 13:25:07 +0100 Subject: fix(sys/nixpkgs/ytc): Check if symlink path exists --- sys/nixpkgs/pkgs/ytc/src/downloader.rs | 2 +- sys/nixpkgs/pkgs/ytc/src/main.rs | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'sys') diff --git a/sys/nixpkgs/pkgs/ytc/src/downloader.rs b/sys/nixpkgs/pkgs/ytc/src/downloader.rs index f1bbd16a..dddebe05 100644 --- a/sys/nixpkgs/pkgs/ytc/src/downloader.rs +++ b/sys/nixpkgs/pkgs/ytc/src/downloader.rs @@ -95,7 +95,7 @@ impl Downloader { let itx = mem::take(&mut self.itx); drop(itx) } - debug!("Returning: {:#?}", ok); + debug!("Returning: {}|{}", ok.0.display(), ok.1.unwrap_or(0)); Some(ok) } Err(err) => { diff --git a/sys/nixpkgs/pkgs/ytc/src/main.rs b/sys/nixpkgs/pkgs/ytc/src/main.rs index 552e85d3..75084851 100644 --- a/sys/nixpkgs/pkgs/ytc/src/main.rs +++ b/sys/nixpkgs/pkgs/ytc/src/main.rs @@ -134,9 +134,14 @@ fn main() -> Result<()> { if status_path()?.is_symlink() { fs::remove_file(status_path()?).context("Failed to delete old status file")?; + } else if !status_path()?.exists() { + debug!( + "The status path at '{}' does not exists", + status_path()?.display() + ); } else { bail!( - "The status path ('{}') is not a symlink!", + "The status path ('{}') is not a symlink but exists!", status_path()?.display() ); } -- cgit 1.4.1