Rediff patches

Add 0002-Use-pre-Rust-1.81-compatible-file-exists-test.patch: <REASON>
Add 0001-Rust-edition-downgrade-to-2021.patch: <REASON>
This commit is contained in:
2025-06-06 19:22:09 -05:00
parent c0e6c5d89d
commit e050892c4b
3 changed files with 56 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
From: Robert Garrett <robertgarrett404@gmail.com>
Date: Sun, 1 Jun 2025 17:59:20 -0500
Subject: Rust edition downgrade to 2021
Debian Bookworm uses Rust 1.64 which only supports up to the 2021
edition.
---
Cargo.toml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Cargo.toml b/Cargo.toml
index febccc4..cf52754 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,7 +1,7 @@
[package]
name = "gt-tool"
version = "1.0.0"
-edition = "2024"
+edition = "2021"
[dependencies]
clap = { version = "4.0.7", features = ["derive", "env"] }

View File

@@ -0,0 +1,31 @@
From: Robert Garrett <robertgarrett404@gmail.com>
Date: Sun, 1 Jun 2025 18:01:21 -0500
Subject: Use pre Rust 1.81 compatible file-exists test
The function `std::fs::exists(...)` was stabilized in Rust 1.81, which
means it can't be used in the Debian Bookworm build. This patch swaps to
a compatible implementation leaning on the std::path::Path struct.
---
src/api/release_attachment.rs | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/api/release_attachment.rs b/src/api/release_attachment.rs
index 9af71bf..8a0c798 100644
--- a/src/api/release_attachment.rs
+++ b/src/api/release_attachment.rs
@@ -1,4 +1,4 @@
-use std::fs;
+use std::{fs, path};
pub fn check_release_match_repo() {}
pub fn get_release_attachment() {}
@@ -16,7 +16,8 @@ pub async fn create_release_attachment(
// Ensure all files exists before starting the uploads
for file in &files {
- match fs::exists(file) {
+ let path = path::Path::new(file);
+ match path.try_exists() {
Ok(true) => continue,
Ok(false) => return Err(crate::Error::NoSuchFile),
Err(e) => {

2
debian/patches/series vendored Normal file
View File

@@ -0,0 +1,2 @@
0001-Rust-edition-downgrade-to-2021.patch
0002-Use-pre-Rust-1.81-compatible-file-exists-test.patch