Comment 1 for bug 2033117

Revision history for this message
Jean-Baptiste Lallement (jibel) wrote : Re: unowned /usr/share/glib-2.0/schemas/20_ubuntu-desktop-installer-interface.gschema.override after canary install

This is done by ubuntu-desktop-installer/snap/local/postinst.d/10_override_desktop_settings and four files are created this way:

```
#!/bin/sh
set -e

user=ubuntu
target=/target
source_schemas=/usr/share/glib-2.0/schemas
target_schemas=$target/$source_schemas

if [ ! -d $source_schemas ] || [ ! -d $target_schemas ] || ! id $user >/dev/null 2>&1; then
    exit
fi

dconf_dump() {
    target_schema=$target_schemas/20_ubuntu-desktop-installer-$1.gschema.override
    sudo -u $user dconf dump /org/gnome/desktop/$1/ > $target_schema
    # - [foo] -> [org.gnome.desktop.$1.foo:ubuntu]
    sed -i -E "s/^\[([^/]*)\]/\[org.gnome.desktop.$1.\1:ubuntu\]/g" $target_schema
    # - [/] -> [org.gnome.desktop.$1:ubuntu]
    sed -i -E "s/^\[\/\]$/\[org.gnome.desktop.$1:ubuntu\]/g" $target_schema
    [ -s $target_schema ] || rm $target_schema
}

dconf_dump a11y
dconf_dump interface
dconf_dump peripherals
dconf_dump wm

glib-compile-schemas $target_schemas
```