Handle exited OCR descendants in package checks

This commit is contained in:
Storm Dragon committed 2026-11-08 14:00:00 -05:00
1 parent db6b9cc492
commit 5b2b558d2e
4 files changed
+29 -5

No files matched your search

+3 -1
View File
@@ -1,7 +1,7 @@
pkgbase = cthulhu
pkgdesc = Desktop-agnostic screen reader with speech, Braille, and Tentacle support
pkgver = 2026.10.31
pkgrel = 5
pkgrel = 6
url = https://git.stormux.org/storm/cthulhu
arch = x86_64
arch = aarch64
@@ -36,7 +36,9 @@ pkgbase = cthulhu
options = !debug
options = !lto
source = cthulhu::git+https://git.stormux.org/storm/cthulhu.git#tag=2026.10.31
source = ocr-descendant-test.patch
sha512sums = SKIP
sha512sums = d733908430bb0de8ce199b44680b9fb38165bd55d0f178f1b9f81cf5b8f9d36dd1c4ab360f6e1fad048a81ba3a52ee3f5f041e0e60aa5aeb0065429623a77a7e
optdepends_x86_64 = wine-access: Wine, Proton, NVDA Controller, and Tolk integration
pkgname = cthulhu
+10 -3
View File
@@ -3,7 +3,7 @@
pkgname=cthulhu
pkgver=2026.10.31
pkgrel=5
pkgrel=6
pkgdesc="Desktop-agnostic screen reader with speech, Braille, and Tentacle support"
url="https://git.stormux.org/storm/cthulhu"
arch=(x86_64 aarch64 armv7h)
@@ -54,8 +54,15 @@ makedepends=(
)
options=(!debug !lto)
# The release tag must exist upstream before makepkg can fetch this source.
source=("${pkgname}::git+https://git.stormux.org/storm/${pkgname}.git#tag=${pkgver}")
sha512sums=('SKIP')
source=("${pkgname}::git+https://git.stormux.org/storm/${pkgname}.git#tag=${pkgver}"
"ocr-descendant-test.patch")
sha512sums=('SKIP'
'd733908430bb0de8ce199b44680b9fb38165bd55d0f178f1b9f81cf5b8f9d36dd1c4ab360f6e1fad048a81ba3a52ee3f5f041e0e60aa5aeb0065429623a77a7e')
prepare() {
cd "${pkgname}"
patch -Np1 -i "${srcdir}/ocr-descendant-test.patch"
}
build() {
cd "${pkgname}"
@@ -0,0 +1,14 @@
diff --git a/internal/ocr/engine_test.go b/internal/ocr/engine_test.go
index 950983b..24f845a 100644
--- a/internal/ocr/engine_test.go
+++ b/internal/ocr/engine_test.go
@@ -313,7 +313,8 @@ func TestEngineRetiresDescendantsHoldingPipes(t *testing.T) {
defer poll.Stop()
for {
status, err := os.ReadFile(fmt.Sprintf("/proc/%d/stat", pid))
- if errors.Is(err, os.ErrNotExist) {
+ // A process exiting during the proc read can report ESRCH instead of ENOENT.
+ if errors.Is(err, os.ErrNotExist) || errors.Is(err, syscall.ESRCH) {
break
}
if err != nil {