diff --git a/debian/changelog b/debian/changelog index a79d77db..528b701e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,21 @@ +livecd-rootfs (2.740) impish; urgency=medium + + [ Thomas Bechtold ] + * magic-proxy: fix TypeError when trying to call get_uri() LP:#1944906 + + -- Steve Langasek Mon, 27 Sep 2021 08:38:00 -0700 + +livecd-rootfs (2.739) impish; urgency=medium + + [ Daniel Bungert ] + * Correct the 'type' in the source catalog entries for the desktop ISOs. + + [ Michael Hudson-Doyle ] + * Record information about locale support (in particular, whether to install + langpacks and which languages have pre-baked squashfses). + + -- Michael Hudson-Doyle Mon, 27 Sep 2021 11:10:46 +1300 + livecd-rootfs (2.738) impish; urgency=medium [ Thomas Bechtold ] diff --git a/live-build/auto/config b/live-build/auto/config index 8f413397..807223b7 100755 --- a/live-build/auto/config +++ b/live-build/auto/config @@ -204,12 +204,28 @@ add_snap () done } +get_seeded_languages () { + # We assume any seed name of the form ${no_lang_seed}-${foo} where + # ${foo} is only two or three characters long is a default language + # seed. + langs='' + for no_lang_seed in "$@"; do + seed_regex="${no_lang_seed}"'-[^-.]{2,3}$' + for seed in $(ls config/germinate-output | grep -E "${seed_regex}"); do + lang=$(echo "${seed}" | grep -oE '[^-.]{2,3}$') + langs="$langs $lang" + done + done + echo $langs | tr ' ' '\n' | sort -u | tr '\n' ' ' +} + derive_language_layers () { # create special layers for each default language # # $1 base pass # $2 base seed (without any languages) # $3 default language seed + # $4 space separated list of default languages # e.g.: # derive_language_layers minimal desktop-minimal desktop-minimal-default-languages # derive_language_layers minimal.standard desktop desktop-default-languages @@ -243,29 +259,26 @@ derive_language_layers () { # 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 + local pass base_pass=$1 no_lang_seed=$2 def_lang_seed=$3 langs=$4 _check_immutable_passes_to_layers _check_layers_only_API "derive_language_layers" - pass=$base_pass.no-languages - _register_pass ${pass} - # Remove all packages from the default language seed that are not in - # the no_lang_seed from the no-languages layer. - subtract_package_lists ${def_lang_seed} ${no_lang_seed} >> config/package-lists/livecd-rootfs.removal-list.chroot_${pass} - - # We assume any seed name of the form ${no_lang_seed}-${foo} where - # ${foo} is only two or three characters long is a default language - # seed. - seed_regex="${no_lang_seed}"'-[^-.]{2,3}$' - - for seed in $(ls config/germinate-output | grep -E "${seed_regex}"); do - lang=$(echo "${seed}" | grep -oE '[^-.]{2,3}$') - pass="${1}.${lang}" + for lang in $langs; do + pass="${base_pass}.${lang}" _register_pass ${pass} # Remove packages from the default language seed that are not # in the language specific seed from the language specific layer. - subtract_package_lists ${def_lang_seed} ${seed} >> config/package-lists/livecd-rootfs.removal-list.chroot_$pass + # I find this expression helps a little to make this make sense: + # ((base) + (en fr de)) - ( (en fr de) - (fr)) == (base + fr) + # `layer will all langs' `def_lang_seed' `lang' `what we want to install' + subtract_package_lists ${def_lang_seed} ${no_lang_seed}-${lang} >> config/package-lists/livecd-rootfs.removal-list.chroot_$pass done + + no_lang_pass=$base_pass.no-languages + _register_pass ${no_lang_pass} + # Remove all packages from the default language seed that are not in + # the no_lang_seed from the no-languages layer. + subtract_package_lists ${def_lang_seed} ${no_lang_seed} >> config/package-lists/livecd-rootfs.removal-list.chroot_${no_lang_pass} } add_chroot_hook () @@ -650,23 +663,27 @@ case $PROJECT in remove_package minimal.standard.live ubiquity-frontend-gtk add_snap minimal.standard.live ubuntu-desktop-installer/classic - derive_language_layers minimal desktop-minimal desktop-minimal-default-languages - derive_language_layers minimal.standard desktop desktop-default-languages + seeded_langs="$(get_seeded_languages desktop-minimal desktop)" + echo "$seeded_langs" | tr ' ' ',' > config/seeded-languages + derive_language_layers minimal desktop-minimal desktop-minimal-default-languages "$seeded_langs" + derive_language_layers minimal.standard desktop desktop-default-languages "$seeded_langs" cat <<-EOF > config/minimal.catalog-in.yaml name: "Ubuntu Desktop (minimized)" description: >- A minimal but usable Ubuntu Desktop. id: ubuntu-desktop-minimal - type: fsimage + type: fsimage-layered variant: desktop + locale_support: langpack EOF cat <<-EOF > config/minimal.standard.catalog-in.yaml name: "Ubuntu Desktop" description: >- A full featured Ubuntu Desktop. id: ubuntu-desktop - type: fsimage + type: fsimage-layered variant: desktop + locale_support: langpack default: yes EOF /usr/share/livecd-rootfs/checkout-translations-branch \ diff --git a/live-build/lb_binary_layered b/live-build/lb_binary_layered index 5777741a..424f7001 100755 --- a/live-build/lb_binary_layered +++ b/live-build/lb_binary_layered @@ -141,10 +141,14 @@ build_layered_squashfs () { if [ -f config/$pass.catalog-in.yaml ]; then echo "Expanding catalog entry template for $pass" - /usr/share/livecd-rootfs/update-source-catalog --output livecd.${PROJECT}.install-sources.yaml \ + usc_opts="--output livecd.${PROJECT}.install-sources.yaml \ --template config/$pass.catalog-in.yaml \ --size $(du -B 1 -s chroot/ | cut -f1) --squashfs ${pass}.squashfs \ - --translations config/catalog-translations + --translations config/catalog-translations" + if [ -f config/seeded-languages ]; then + usc_opts="$usc_opts --langs $(cat config/seeded-languages)" + fi + /usr/share/livecd-rootfs/update-source-catalog $usc_opts else echo "No catalog entry template for $pass" fi diff --git a/live-build/ubuntu-server/ubuntu-server-minimal.catalog-in.yaml b/live-build/ubuntu-server/ubuntu-server-minimal.catalog-in.yaml index 9400bf1e..d45ef488 100644 --- a/live-build/ubuntu-server/ubuntu-server-minimal.catalog-in.yaml +++ b/live-build/ubuntu-server/ubuntu-server-minimal.catalog-in.yaml @@ -5,3 +5,4 @@ description: >- id: ubuntu-server-minimal type: fsimage variant: server +locale_support: none diff --git a/live-build/ubuntu-server/ubuntu-server-minimal.ubuntu-server.catalog-in.yaml b/live-build/ubuntu-server/ubuntu-server-minimal.ubuntu-server.catalog-in.yaml index 722fc92a..4f8177f0 100644 --- a/live-build/ubuntu-server/ubuntu-server-minimal.ubuntu-server.catalog-in.yaml +++ b/live-build/ubuntu-server/ubuntu-server-minimal.ubuntu-server.catalog-in.yaml @@ -6,3 +6,4 @@ id: ubuntu-server default: yes type: fsimage-layered variant: server +locale_support: locale-only diff --git a/magic-proxy b/magic-proxy index 29d95ab4..10f19c47 100755 --- a/magic-proxy +++ b/magic-proxy @@ -814,8 +814,14 @@ class ProxyingHTTPRequestHandler(http.server.BaseHTTPRequestHandler): It is important to understand that there is no status 3xx HTTP redirect happening here, the client does not know that what it receives is not exactly what it requested.""" + host = self.headers.get("host") + + # the host does not start with http(s):// which result in urlparse + # to not detect the host & path correctly (LP:#1944906) + if not host.startswith("http"): + host = "http://{}".format(host) + uri = host + self.path - uri = self.headers.get("host") + self.path parsed = urllib.parse.urlparse(uri) self.sanitize_requestline() diff --git a/update-source-catalog b/update-source-catalog index 50aa3a16..6616d609 100755 --- a/update-source-catalog +++ b/update-source-catalog @@ -13,6 +13,7 @@ parser.add_argument('--size', required=True) parser.add_argument('--squashfs', required=True) parser.add_argument('--translations', required=True) parser.add_argument('--template', required=True) +parser.add_argument('--langs', default=None) opts = parser.parse_args(sys.argv[1:]) @@ -47,6 +48,8 @@ for mo in glob.glob(os.path.join(opts.translations, '*.mo')): if t_description != en_description: lang = os.path.splitext(os.path.basedescription(mo))[0] template['description'][lang] = t_description + if opts.langs is not None: + template['preinstalled_langs'] = opts.langs.split(',') output.append(template)