NetBSD: no Posix.euidaccess
Summary
I've packaged Deja-Dup for pkgsrc.
Reproduction Steps
Compilation fails on NetBSD because it does not provide Posix.euidaccess
. I think this function is a GLIBC extension, this will probably also cause problems on other operating systems.
I don't know vala well enough to add a check for the existence of the function.
I've come up with the following workaround to use Posix.access
instead, which fixes the build on NetBSD, but of course has different semantics:
--- app/RestoreFileTester.vala.orig 2023-09-22 23:12:56.000000000 +0000
+++ app/RestoreFileTester.vala
@@ -75,12 +75,12 @@ public class RestoreFileTester : Object
// a file in it. But testing write access is probably good enough for now.
exists = false;
string iter = path;
- int access = -1;
- while (access != 0 && Posix.errno == Posix.ENOENT) {
+ int ret = -1;
+ while (ret != 0 && Posix.errno == Posix.ENOENT) {
iter = Path.get_dirname(iter);
- access = Posix.euidaccess(iter, Posix.W_OK | Posix.X_OK);
+ ret = Posix.access(iter, Posix.W_OK | Posix.X_OK);
}
- if (access != 0)
+ if (ret != 0)
return false;
}
} else {
Can you please add a better workaround or solution for this?
Thank you.