16053: Install en_US.UTF-8 locale.
authorTom Clegg <tom@tomclegg.ca>
Mon, 16 Mar 2020 20:22:21 +0000 (16:22 -0400)
committerTom Clegg <tom@tomclegg.ca>
Mon, 16 Mar 2020 20:22:21 +0000 (16:22 -0400)
Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom@tomclegg.ca>

lib/install/deps.go

index 3b904c458cbf032ad6a943acc9e88965b1df2e58..30110ddcd5cb5643084a68ca304d6aa83c7c8218 100644 (file)
@@ -233,6 +233,16 @@ ln -sf /var/lib/arvados/node-${NJS}-linux-x64/bin/{node,npm} /usr/local/bin/
                                return 1
                        }
                }
+
+               wantlocale := "en_US.UTF-8"
+               if havelocales, err := exec.Command("locale", "-a").CombinedOutput(); err == nil && bytes.Contains(havelocales, []byte(wantlocale+"\n")) {
+                       logger.Print("locale " + wantlocale + " already installed")
+               } else {
+                       err = runBash(`sed -i 's/^# *\(`+wantlocale+`\)/\1/' /etc/locale.gen && locale-gen`, stdout, stderr)
+                       if err != nil {
+                               return 1
+                       }
+               }
        }
 
        return 0