Falls back to seeded l-s-c

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.
This commit is contained in:
Carlos Nihelton 2023-03-24 11:39:27 -03:00
parent 4496f22ff8
commit 1105da2368
No known key found for this signature in database
GPG Key ID: 6FE346D245197E9A
1 changed files with 9 additions and 4 deletions

View File

@ -154,10 +154,15 @@ class ConfigureController(SubiquityController):
# 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)
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])