The official package in place of lemurs-git, and /etc/lemurs/config.toml in lemurs 0.4's structure. It offers only the session scripts that modules place in /etc/lemurs/wms and /etc/lemurs/wayland, never a package's bare desktop entry, which skips the session's start. The service is enabled and never started, stopped or restarted by a push. The tools are the seat's sessions, the default session (lemurs's cache, through sudo -n) and logins from the journal and lemurs's own log. The package swap from lemurs-git is a one-off step for the operator, listed in the README.
43 lines
1.2 KiB
Go
43 lines
1.2 KiB
Go
package desktop
|
|
|
|
import (
|
|
"bytes"
|
|
"os"
|
|
"path/filepath"
|
|
"testing"
|
|
)
|
|
|
|
// The desktop modules that carry this package. Each builds alone, so each has its own copy; this
|
|
// test, itself one of the copied files, holds them to one text wherever the siblings are present.
|
|
var carriers = []string{"xorg", "lemurs", "i3", "xterm", "adwaita"}
|
|
|
|
func TestEveryDesktopModuleCarriesTheSameCopy(t *testing.T) {
|
|
mine, err := filepath.Glob("*.go")
|
|
if err != nil || len(mine) == 0 {
|
|
t.Fatal("no files of this package found", err)
|
|
}
|
|
compared := 0
|
|
for _, module := range carriers {
|
|
dir := filepath.Join("..", "..", "..", module, "internal", "desktop")
|
|
if _, err := os.Stat(dir); err != nil {
|
|
continue
|
|
}
|
|
theirs, _ := filepath.Glob(filepath.Join(dir, "*.go"))
|
|
if len(theirs) != len(mine) {
|
|
t.Errorf("%s carries %d files of this package, this copy %d", module, len(theirs), len(mine))
|
|
continue
|
|
}
|
|
for _, f := range mine {
|
|
a, _ := os.ReadFile(f)
|
|
b, err := os.ReadFile(filepath.Join(dir, f))
|
|
if err != nil || !bytes.Equal(a, b) {
|
|
t.Errorf("%s's copy of %s differs from this one: change every copy together", module, f)
|
|
}
|
|
}
|
|
compared++
|
|
}
|
|
if compared == 0 {
|
|
t.Log("no sibling copies beside this module")
|
|
}
|
|
}
|