Skip to content

Commit

Permalink
Merge pull request #1187 from CarlosNihelton/fix-c-utf8
Browse files Browse the repository at this point in the history
Fixes missing directory for system_setup integration test
  • Loading branch information
dbungert authored Feb 17, 2022
2 parents 4914e53 + e79e4ea commit 00b0e82
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions system_setup/server/controllers/configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,14 @@ def __locale_gen_cmd(self) -> Tuple[str, bool]:
cmdFile = os.path.join(self.model.root, cmd)
shutil.copy(os.path.join("/", cmd), cmdFile)
# Supply LC_* definition files to avoid complains from localedef.
shutil.copytree("/usr/lib/locale/C.UTF-8/", outDir,
dirs_exist_ok=True)
candidateSourceDirs = ["/usr/lib/locale/C.UTF-8/",
"/usr/lib/locale/C.utf8/"]
sourceDirs = [d for d in candidateSourceDirs if os.path.exists(d)]
if len(sourceDirs) == 0:
log.error("No available LC_* definitions found in this system")
return ("", False)

shutil.copytree(sourceDirs[0], outDir, dirs_exist_ok=True)
try:
# Altering locale-gen script to output to the desired folder.
with open(cmdFile, "r+") as f:
Expand Down

0 comments on commit 00b0e82

Please sign in to comment.