Skip to content

Commit

Permalink
Live ISO: Save the available locales before doing locale cleanup (#1207)
Browse files Browse the repository at this point in the history
- Related to #1205 
- Also fixed path to the Agama Web UI files
  • Loading branch information
lslezak authored May 14, 2024
2 parents e2b27bd + 65d66a5 commit de5b8f3
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion live/src/config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,19 @@ fi
rm /var/log/zypper.log /var/log/zypp/history

du -h -s /usr/{share,lib}/locale/

# Agama expects that the same locales available in the installation system can
# be also used later in the installed system and offers them in the web UI to
# select. But to make the Live ISO smaller it makes sense to delete the locales
# not supported by Agama itself. To solve this problem the list of available
# locales is saved to a file before deleting the locales not supported by Agama.
# Agama then reads this file instead of running the "localectl list-locales"
# command.
localectl list-locales > /etc/agama.d/locales

# delete translations and unusupported languages (makes ISO about 22MiB smaller)
# build list of ignore options for "ls" with supported languages like "-I cs* -I de* -I es* ..."
readarray -t IGNORE_OPTS < <(ls /usr/share/cockpit/agama/po.*.js.gz | sed -e "s#/usr/share/cockpit/agama/po\.\(.*\)\.js\.gz#-I\n\\1*#")
readarray -t IGNORE_OPTS < <(ls /usr/share/agama/web_ui/po.*.js.gz | sed -e "s#/usr/share/agama/web_ui/po\.\(.*\)\.js\.gz#-I\n\\1*#")
# additionally keep the en_US translations
ls -1 "${IGNORE_OPTS[@]}" -I en_US /usr/share/locale/ | xargs -I% sh -c "echo 'Removing translations %...' && rm -rf /usr/share/locale/%"

Expand Down

0 comments on commit de5b8f3

Please sign in to comment.