mirror of
https://git.launchpad.net/livecd-rootfs
synced 2025-05-11 02:41:33 +00:00
Change the per language layers in the desktop canary build to have more regular names (and make their implementation better documented and hopefully more comprehensible).
This commit is contained in:
parent
356b08c475
commit
fe38bd02c1
8
debian/changelog
vendored
8
debian/changelog
vendored
@ -1,3 +1,11 @@
|
|||||||
|
livecd-rootfs (2.736) UNRELEASED; urgency=medium
|
||||||
|
|
||||||
|
* Change the per language layers in the desktop canary build to have more
|
||||||
|
regular names (and make their implementation better documented and
|
||||||
|
hopefully more comprehensible).
|
||||||
|
|
||||||
|
-- Michael Hudson-Doyle <michael.hudson@ubuntu.com> Tue, 03 Aug 2021 16:34:57 +1200
|
||||||
|
|
||||||
livecd-rootfs (2.735) impish; urgency=medium
|
livecd-rootfs (2.735) impish; urgency=medium
|
||||||
|
|
||||||
* Get source catalog translations from subiquity git, as brz is in universe.
|
* Get source catalog translations from subiquity git, as brz is in universe.
|
||||||
|
@ -204,46 +204,67 @@ add_snap ()
|
|||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
add_packages_from_seed_regexp () {
|
derive_language_layers () {
|
||||||
# Creates one or more passes, depending on base_pass_name, from any seeds matching seed_regexp.
|
# create special layers for each default language
|
||||||
|
#
|
||||||
# $1 base pass
|
# $1 base pass
|
||||||
# $2 seeds (regexp)
|
# $2 base seed (without any languages)
|
||||||
local pass
|
# $3 default language seed
|
||||||
|
# e.g.:
|
||||||
|
# derive_language_layers minimal desktop-minimal desktop-minimal-default-languages
|
||||||
|
# derive_language_layers minimal.standard desktop desktop-default-languages
|
||||||
|
#
|
||||||
|
# The way this works is perhaps a little counterintuitive.
|
||||||
|
#
|
||||||
|
# The first goal here is that the installed system should contain
|
||||||
|
# language support for the language the user selected. One way to do
|
||||||
|
# this using layers would be to have a layer that contained no
|
||||||
|
# language support and a derived layer for each (default) language. So
|
||||||
|
# something like:
|
||||||
|
#
|
||||||
|
# filesystem.squashfs (contains no language support)
|
||||||
|
# filesystem.en.squashfs (contains English language support)
|
||||||
|
# filesystem.fr.squashfs (contains French language support)
|
||||||
|
# ...
|
||||||
|
#
|
||||||
|
# Then if the user selects French as their language, we just copy
|
||||||
|
# filesystem.fr.squashfs to the target system.
|
||||||
|
#
|
||||||
|
# But we want the live session to support these languages too and
|
||||||
|
# simply adding all the language support to the live layer would mean
|
||||||
|
# we'd have the each language's support files on the ISO twice (once
|
||||||
|
# in filesystem.$LANG.squashfs and once in filesystem.live.squashfs).
|
||||||
|
#
|
||||||
|
# So what is done instead is that we add support for all the default
|
||||||
|
# languages to the base layer and then create derived layers that
|
||||||
|
# _remove_ support for all languages but the desired language and
|
||||||
|
# because file removals are cheap to represent in overlays, this all
|
||||||
|
# ends up taking way less space, and filesystem.live.squashfs gets
|
||||||
|
# support for all languages from the base layer. We also create a
|
||||||
|
# layer than has support for all languages removed, which can be used
|
||||||
|
# for the base of an install for a non-default language.
|
||||||
|
local pass base_pass=$1 no_lang_seed=$2 def_lang_seed=$3
|
||||||
_check_immutable_passes_to_layers
|
_check_immutable_passes_to_layers
|
||||||
_check_layers_only_API "add_packages_from_seed_regexp"
|
_check_layers_only_API "derive_language_layers"
|
||||||
|
|
||||||
for seed in $(ls config/germinate-output/|grep -P "$2"); do
|
pass=$base_pass.no-languages
|
||||||
pass=${1}.${seed}
|
_register_pass ${pass}
|
||||||
_register_pass "$pass"
|
# Remove all packages from the default language seed that are not in
|
||||||
list_packages_from_seed ${seed} >> config/package-lists/livecd-rootfs.list.chroot_$pass
|
# the no_lang_seed from the no-languages layer.
|
||||||
done
|
subtract_package_lists ${def_lang_seed} ${no_lang_seed} >> config/package-lists/livecd-rootfs.removal-list.chroot_${pass}
|
||||||
}
|
|
||||||
|
|
||||||
remove_packages_from_seed_regexp() {
|
# We assume any seed name of the form ${no_lang_seed}-${foo} where
|
||||||
# Creates one or more passes, based on base_pass_name, from any seed matching seed_regexp.
|
# ${foo} is only two or three characters long is a default language
|
||||||
# This package list is a list of packages to remove (and included in a previous dependent
|
# seed.
|
||||||
# pass then), resulting from base_seed - {current_seed_match_from_regexp}.
|
seed_regex="${no_lang_seed}"'-[^-.]{2,3}$'
|
||||||
# $1 base pass
|
|
||||||
# $2 base seed
|
|
||||||
# $3 seeds to remove from base seed (regexp). If empty, a no-<base-seed> sublayer is generated.
|
|
||||||
local pass
|
|
||||||
|
|
||||||
_check_immutable_passes_to_layers
|
for seed in $(ls config/germinate-output | grep -E "${seed_regex}"); do
|
||||||
_check_layers_only_API "remove_packages_from_seed_regexp"
|
lang=$(echo "${seed}" | grep -oE '[^-.]{2,3}$')
|
||||||
|
pass="${1}.${lang}"
|
||||||
local seed_regexp="$3"
|
_register_pass ${pass}
|
||||||
if [ -z "${seed_regexp}" ]; then
|
# Remove packages from the default language seed that are not
|
||||||
pass="${1}.no-${2}"
|
# in the language specific seed from the language specific layer.
|
||||||
_register_pass "$pass"
|
subtract_package_lists ${def_lang_seed} ${seed} >> config/package-lists/livecd-rootfs.removal-list.chroot_$pass
|
||||||
subtract_package_lists ${2} "desktop-minimal" >> config/package-lists/livecd-rootfs.removal-list.chroot_$pass
|
|
||||||
return
|
|
||||||
fi
|
|
||||||
|
|
||||||
for seed in $(ls config/germinate-output/|grep -P "$seed_regexp"); do
|
|
||||||
pass="${1}.${seed}"
|
|
||||||
_register_pass "$pass"
|
|
||||||
subtract_package_lists ${2} ${seed} >> config/package-lists/livecd-rootfs.removal-list.chroot_$pass
|
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -629,11 +650,8 @@ case $PROJECT in
|
|||||||
remove_package minimal.standard.live ubiquity-frontend-gtk
|
remove_package minimal.standard.live ubiquity-frontend-gtk
|
||||||
add_snap minimal.standard.live ubuntu-desktop-installer/classic
|
add_snap minimal.standard.live ubuntu-desktop-installer/classic
|
||||||
|
|
||||||
# LANG PASS for minimal and standard
|
derive_language_layers minimal desktop-minimal desktop-minimal-default-languages
|
||||||
remove_packages_from_seed_regexp minimal desktop-minimal-default-languages '^desktop-minimal-(?!default-languages)[^.]+$'
|
derive_language_layers minimal.standard desktop desktop-default-languages
|
||||||
remove_packages_from_seed_regexp minimal desktop-minimal-default-languages '' # none (if no default langpack is selected)
|
|
||||||
remove_packages_from_seed_regexp minimal.standard desktop-default-languages '^desktop-(?!default-languages|minimal|common)[^.]+$'
|
|
||||||
remove_packages_from_seed_regexp minimal.standard desktop-default-languages '' # none (if no default langpack is selected)
|
|
||||||
;;
|
;;
|
||||||
|
|
||||||
desktop-preinstalled)
|
desktop-preinstalled)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user