Package: moor
Version: 2.12.3-1
Hi,
When running moor with the ru_RU locale, the program refuses to run and
exits with a message requesting the user to change their locale or make
political statements in their environment¹:
$ LANG=ru_RU.UTF-8 moor
ERROR: russia not supported (but Russian is!)
Options for using moor in Russian:
* Change your language setting to ru_UA.UTF-8
* Set CRIMEA=Ukraine in your environment
* russia leaves Ukraine
This is a non-functional politically motivated behavior which affects
all users with ru_RU locale regardless of their actual location or
circumstances and prevents legitimate use of the software based solely
on locale settings.
There's an upstream bug report on this² but it hasn't seen a response
from the author for more than a year by now so upstream cooperation is
unfortunately quite unlikely.
I've attached a patch which reverts this behavior and makes moor less…
opinionated.
¹ https://sources.debian.org/src/moor/2.12.3-1/cmd/moor/moor.go#L314
² https://github.com/walles/moor/issues/266
diff --git a/cmd/moor/moor.go b/cmd/moor/moor.go
index cd04dcc..40162c6 100644
--- a/cmd/moor/moor.go
+++ b/cmd/moor/moor.go
@@ -311,26 +311,6 @@ func getTargetLine(args []string) (*linemetadata.Index, []string) {
return nil, args
}
-func russiaNotSupported() {
- if !strings.HasPrefix(strings.ToLower(os.Getenv("LANG")), "ru_ru") {
- // Not russia
- return
- }
-
- if os.Getenv("CRIMEA") == "Ukraine" {
- // It is!
- return
- }
-
- fmt.Fprintln(os.Stderr, "ERROR: russia not supported (but Russian is!)")
- fmt.Fprintln(os.Stderr)
- fmt.Fprintln(os.Stderr, "Options for using moor in Russian:")
- fmt.Fprintln(os.Stderr, "* Change your language setting to ru_UA.UTF-8")
- fmt.Fprintln(os.Stderr, "* Set CRIMEA=Ukraine in your environment")
- fmt.Fprintln(os.Stderr, "* russia leaves Ukraine")
- os.Exit(1)
-}
-
// For git output and man pages, disable line numbers by default.
//
// Before paging, "man" first checks the terminal width and formats the man page
@@ -654,7 +634,6 @@ func main() {
logsRequested := false
log.SetOutput(&loglines)
twin.SetLogger(&util.TwinLogger{})
- russiaNotSupported()
defer func() {
err := recover()