···1+From 2bbe75fe0bc87ab4c1e16c5a18c6200224391629 Mon Sep 17 00:00:00 2001
2+From: Nicole Patricia Mazzuca <nicole@streganil.no>
3+Date: Fri, 9 May 2025 09:32:21 +0200
4+Subject: [PATCH] open: fix opening text/html messages
5+6+This fixes a bug introduced in 93bec0de8ed5ab3d6b1f01026fe2ef20fa154329:
7+aerc started using `path.Base(<part>)`, which returns `"."` on an empty
8+path, but still checked for `""` two lines later.
9+10+On macOS, the result is that aerc attempts to open the directory:
11+12+```
13+open /var/folders/vn/hs0zvdsx3vq6svvry8s1bnym0000gn/T/aerc-4229266673: is a directory
14+```
15+16+Signed-off-by: Nicole Patricia Mazzuca <nicole@streganil.no>
17+Acked-by: Robin Jarry <robin@jarry.cc>
18+---
19+ commands/msgview/open.go | 2 +-
20+ 1 file changed, 1 insertion(+), 1 deletion(-)
21+22+diff --git a/commands/msgview/open.go b/commands/msgview/open.go
23+index a6e43cb8da5fd49d2aa562d4c25ee2d597deefc3..7c770d4a90b771e3a18dfcb327f5e9306d5b5fa7 100644
24+--- a/commands/msgview/open.go
25++++ b/commands/msgview/open.go
26+@@ -59,7 +59,7 @@ func (o Open) Execute(args []string) error {
27+ }
28+ filename := path.Base(part.FileName())
29+ var tmpFile *os.File
30+- if filename == "" {
31++ if filename == "." {
32+ extension := ""
33+ if exts, _ := mime.ExtensionsByType(mimeType); len(exts) > 0 {
34+ extension = exts[0]
+41
pkgs/by-name/ae/aerc/basename-temp-file.patch
···00000000000000000000000000000000000000000
···1+From 93bec0de8ed5ab3d6b1f01026fe2ef20fa154329 Mon Sep 17 00:00:00 2001
2+From: Robin Jarry <robin@jarry.cc>
3+Date: Wed, 9 Apr 2025 10:49:24 +0200
4+Subject: [PATCH] open: only use part basename for temp file
5+6+When an attachment part has a name such as "/tmp/55208186_AllDocs.pdf",
7+aerc creates a temp folder and tries to store the file by blindly
8+concatenating the path as follows:
9+10+ /tmp/aerc-3444057757/tmp/55208186_AllDocs.pdf
11+12+And when writing to this path, it gets a "No such file or directory"
13+error because the intermediate "tmp" subfolder isn't created.
14+15+Reported-by: Erik Colson <eco@ecocode.net>
16+Signed-off-by: Robin Jarry <robin@jarry.cc>
17+---
18+ commands/msgview/open.go | 3 ++-
19+ 1 file changed, 2 insertions(+), 1 deletion(-)
20+21+diff --git a/commands/msgview/open.go b/commands/msgview/open.go
22+index 4293b7e4892c137a7f3fbbe79245ffb6733b2671..a6e43cb8da5fd49d2aa562d4c25ee2d597deefc3 100644
23+--- a/commands/msgview/open.go
24++++ b/commands/msgview/open.go
25+@@ -5,6 +5,7 @@ import (
26+ "io"
27+ "mime"
28+ "os"
29++ "path"
30+ "path/filepath"
31+32+ "git.sr.ht/~rjarry/aerc/app"
33+@@ -56,7 +57,7 @@ func (o Open) Execute(args []string) error {
34+ app.PushError(err.Error())
35+ return
36+ }
37+- filename := part.FileName()
38++ filename := path.Base(part.FileName())
39+ var tmpFile *os.File
40+ if filename == "" {
41+ extension := ""
···2122let
23 pname = "proxmox-backup-client";
24- version = "3.3.2";
2526 proxmox-backup_src = fetchgit {
27 url = "git://git.proxmox.com/git/proxmox-backup.git";
28- tag = "v${version}";
29 name = "proxmox-backup";
30- hash = "sha256-0piUftzuK9e8KbOe+bc3SXWa0DlnEgk5iNGWGn4fw7Y=";
31 };
3233 proxmox_src = fetchgit {
34 url = "git://git.proxmox.com/git/proxmox.git";
35- rev = "df6b705f564ff145faa14770db6493bc5da8cab3";
36 name = "proxmox";
37- hash = "sha256-6fQVK+G5FMPy+29hScMkvQ+MQQryYs8f8oooq1YGXbg=";
38 };
3940 proxmox-fuse_src = fetchgit {
···63 name = "h2";
64 owner = "hyperium";
65 repo = "h2";
66- rev = "v0.4.7";
67- hash = "sha256-GcO4321Jqt1w7jbvQKd0GXIjptyz+tlN2SuxHoBJ/9k=";
68 };
69-70- aurPatchCommit = "6f83f58d54bc7186211d0cfa637c652b13e0dfee";
71in
7273rustPlatform.buildRustPackage {
···85 sourceRoot = proxmox-backup_src.name;
8687 # These patches are essentially un-upstreamable, due to being "workarounds" related to the
88- # project structure.
89 cargoPatches = [
90 # A lot of Rust crates `proxmox-backup-client` depends on are only available through git (or
91 # Debian packages). This patch redirects all these dependencies to a local, relative path, which
···94 # `make docs` assumes that the binaries are located under `target/{debug,release}`, but due
95 # to how `buildRustPackage` works, they get put under `target/$RUSTC_TARGET/{debug,release}`.
96 # This patch simply fixes that up.
97- ./0002-docs-Add-target-path-fixup-variable.patch
98 # Need to use a patched version of the `h2` crate (with a downgraded dependency, see also postPatch).
99 # This overrides it in the Cargo.toml as needed.
100 ./0003-cargo-use-local-patched-h2-dependency.patch
101 # This patch prevents the generation of the man-pages for other components inside the repo,
102 # which would require them too be built too. Thus avoid wasting resources and just skip them.
103- (fetchpatch {
104- name = "0002-docs-drop-all-but-client-man-pages.patch";
105- url = "https://aur.archlinux.org/cgit/aur.git/plain/0002-docs-drop-all-but-client-man-pages.patch?h=proxmox-backup-client&id=${aurPatchCommit}";
106- hash = "sha256-AlIGfJZGaZl2NBVfuFxpDL6bgyvXA2Wcz7UWSrnQa24=";
107- })
108 ];
109110 postPatch = ''
···2122let
23 pname = "proxmox-backup-client";
24+ version = "3.4.2";
2526 proxmox-backup_src = fetchgit {
27 url = "git://git.proxmox.com/git/proxmox-backup.git";
28+ rev = "37f1949335cad801f7cdaa0173cc114590a37e4e";
29 name = "proxmox-backup";
30+ hash = "sha256-OW6GG/4IcEw8XOSSB5EoN+jyoOaL0ZtavJahnKOuAqI=";
31 };
3233 proxmox_src = fetchgit {
34 url = "git://git.proxmox.com/git/proxmox.git";
35+ rev = "e47fdf411be61b15382bc3baa3064f1e7cb03fa2";
36 name = "proxmox";
37+ hash = "sha256-jSU00D75sx40VS8rgF+D6h120FMaD1Jfq4e8l+8D5BQ=";
38 };
3940 proxmox-fuse_src = fetchgit {
···63 name = "h2";
64 owner = "hyperium";
65 repo = "h2";
66+ rev = "v0.4.10";
67+ hash = "sha256-PasHCbU466ByHIbDQpMMgzjg2dMRveOButHeVSknSEQ=";
68 };
0069in
7071rustPlatform.buildRustPackage {
···83 sourceRoot = proxmox-backup_src.name;
8485 # These patches are essentially un-upstreamable, due to being "workarounds" related to the
86+ # project structure and upstream/Debian-specific packaging.
87 cargoPatches = [
88 # A lot of Rust crates `proxmox-backup-client` depends on are only available through git (or
89 # Debian packages). This patch redirects all these dependencies to a local, relative path, which
···92 # `make docs` assumes that the binaries are located under `target/{debug,release}`, but due
93 # to how `buildRustPackage` works, they get put under `target/$RUSTC_TARGET/{debug,release}`.
94 # This patch simply fixes that up.
95+ ./0002-docs-add-target-path-fixup-variable.patch
96 # Need to use a patched version of the `h2` crate (with a downgraded dependency, see also postPatch).
97 # This overrides it in the Cargo.toml as needed.
98 ./0003-cargo-use-local-patched-h2-dependency.patch
99 # This patch prevents the generation of the man-pages for other components inside the repo,
100 # which would require them too be built too. Thus avoid wasting resources and just skip them.
101+ ./0004-docs-drop-all-but-client-man-pages.patch
102+ # Upstream uses a patched version of the h2 crate (see [0]), which does not apply here.
103+ # [0] https://git.proxmox.com/?p=debcargo-conf.git;a=blob;f=src/h2/debian/patches/add-legacy.patch;h=0913da317
104+ ./0005-Revert-h2-switch-to-legacy-feature.patch
0105 ];
106107 postPatch = ''