diff options
author | Robin Jarry <robin@jarry.cc> | 2023-01-08 20:44:22 +0100 |
---|---|---|
committer | Robin Jarry <robin@jarry.cc> | 2023-01-10 21:49:18 +0100 |
commit | 04303172d4f96b284e0c915ce4a7b87e1439bb87 (patch) | |
tree | 4dcadaeb7995ccee0b260f384b063d8144e37c4c /config/config.go | |
parent | 21d8963928162e8a1fe62b39c87b3e4735b05dba (diff) | |
download | aerc-04303172d4f96b284e0c915ce4a7b87e1439bb87.tar.gz |
filters: install them in $PREFIX/libexec/aerc/filters
The filesystem hierarchy standard describes /usr/share as
"Architecture-independent data". This folder is not intended for
executable scripts and especially not for arch specific binary files
(such as the wrap filter).
Lintian reports an error with aerc 0.14.0:
arch-dependent-file-in-usr-share [usr/share/aerc/filters/wrap]
Which I had to fix by moving the filter into /usr/libexec.
Install all filters into $PREFIX/libexec/aerc/filters and update the
default SearchDirs to look them up in here as well.
Link: https://refspecs.linuxfoundation.org/FHS_3.0/fhs/ch04s11.html
Link: https://salsa.debian.org/go-team/packages/aerc/-/commit/a0ca00260ffd
Signed-off-by: Robin Jarry <robin@jarry.cc>
Acked-by: Moritz Poldrack <moritz@poldrack.dev>
Diffstat (limited to 'config/config.go')
-rw-r--r-- | config/config.go | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/config/config.go b/config/config.go index 09fb5efc..12da665b 100644 --- a/config/config.go +++ b/config/config.go @@ -31,12 +31,14 @@ func mapName(raw string) string { // Set at build time var shareDir string +var libexecDir string func buildDefaultDirs() []string { var defaultDirs []string prefixes := []string{ xdg.ConfigHome(), + "~/.local/libexec", xdg.DataHome(), } @@ -51,7 +53,13 @@ func buildDefaultDirs() []string { } } - // Add custom buildtime shareDir + // Add custom buildtime dirs + if libexecDir != "" && libexecDir != "/usr/local/libexec/aerc" { + libexecDir, err := homedir.Expand(libexecDir) + if err == nil { + defaultDirs = append(defaultDirs, libexecDir) + } + } if shareDir != "" && shareDir != "/usr/local/share/aerc" { shareDir, err := homedir.Expand(shareDir) if err == nil { @@ -60,7 +68,9 @@ func buildDefaultDirs() []string { } // Add fixed fallback locations + defaultDirs = append(defaultDirs, "/usr/local/libexec/aerc") defaultDirs = append(defaultDirs, "/usr/local/share/aerc") + defaultDirs = append(defaultDirs, "/usr/libexec/aerc") defaultDirs = append(defaultDirs, "/usr/share/aerc") return defaultDirs |