Skip to content

Commit

Permalink
Falls back to seeded l-s-c
Browse files Browse the repository at this point in the history
UDI snap ships the package, thus its data dir is part of the snap
subiquity snap does not.
This tries l-s-c data dir in the base system, outside of the snap
and gives up if the dir does not exits.
  • Loading branch information
CarlosNihelton committed Mar 24, 2023
1 parent 4496f22 commit 1105da2
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions system_setup/server/controllers/configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,11 +154,16 @@ async def __recommended_language_packs(self, lang) \
# ever by just '.'. On the other hand in dry-run we want it pointing to
# '/' if not properly set.
snap_dir = snap_dir if snap_dir != '.' else '/'
data_dir = os.path.join(snap_dir, "usr/share/language-selector")
data_dir_base = "usr/share/language-selector"
data_dir = os.path.join(snap_dir, data_dir_base)
if not os.path.exists(data_dir):
log.error("Misconfigured snap environment pointed L-S-C data dir"
" to %s", data_dir)
return None
log.error("Language selector data dir %s seems not to be part"
" of the snap.", data_dir)
# Try seeded L-S-C
data_dir = os.path.join(self.model.root, data_dir_base)
if not os.path.exists(data_dir):
log.error("Cannot find language selector data directory.")
return None

cp = await arun_command([clsCommand, "-d", data_dir, "-l", clsLang])
if cp.returncode != 0:
Expand Down

0 comments on commit 1105da2

Please sign in to comment.