-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: remove XML declaration from glib schemas (#972)
This is a workaround so [we don't fail](https://github.com/ubuntu/adsys/actions/runs/8809678726/job/24180895123) when parsing schemas with invalid XML declarations, such as [`org.gnome.Extensions.gschema.xml`](https://gitlab.gnome.org/GNOME/gnome-shell/-/blob/41b94ccf11a66c5b315f834061cdec82a622f4ec/subprojects/extensions-app/data/org.gnome.Extensions.gschema.xml). Interestingly this doesn't seem to bother `glib-compile-schemas` but fails with most XML parsers (including Go's parser). While I've already fixed this [upstream](https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3281), it'll take a while until the updated version feeds into Ubuntu so we need a workaround within adsys too, otherwise we are blocked from refreshing the ADMX/ADML files. For simplicity I've opted to remove the XML declaration line if it occurs, this way we don't concern ourselves checking for specific syntax errors. Fixes #955 / UDENG-2730
- Loading branch information
Showing
16 changed files
with
101 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
...admxgen/dconf/testdata/TestGenerate/defs/malformed_xml_declaration_is_successfully_parsed
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
- objectpath: "/com/ubuntu/simple/simple-text-property" |
1 change: 1 addition & 0 deletions
1
...d/admxgen/dconf/testdata/TestGenerate/defs/missing_xml_declaration_is_successfully_parsed
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
- objectpath: "/com/ubuntu/simple/simple-text-property" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
...mxgen/dconf/testdata/TestGenerate/golden/malformed_xml_declaration_is_successfully_parsed
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
- key: /com/ubuntu/simple/simple-text-property | ||
displayname: simple-text-property summary | ||
explaintext: simple-text-property description | ||
elementtype: text | ||
metaenabled: | ||
empty: '''''' | ||
meta: s | ||
metadisabled: | ||
meta: s | ||
default: '''simple-text-property Default Value''' | ||
note: default system value is used for "Not Configured" and enforced if "Disabled". | ||
release: "20.04" | ||
type: dconf |
13 changes: 13 additions & 0 deletions
13
...admxgen/dconf/testdata/TestGenerate/golden/missing_xml_declaration_is_successfully_parsed
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
- key: /com/ubuntu/simple/simple-text-property | ||
displayname: simple-text-property summary | ||
explaintext: simple-text-property description | ||
elementtype: text | ||
metaenabled: | ||
empty: '''''' | ||
meta: s | ||
metadisabled: | ||
meta: s | ||
default: '''simple-text-property Default Value''' | ||
note: default system value is used for "Not Configured" and enforced if "Disabled". | ||
release: "20.04" | ||
type: dconf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
...ate/system/malformed_xml_declaration/usr/share/glib-2.0/schemas/schema-simple.gschema.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?<?xml version="1.0" encoding="UTF-8"?> | ||
<schemalist gettext-domain="gsettings-ubuntu-touch-schemas"> | ||
<schema path="/com/ubuntu/simple/" id="com.ubuntu.simple"> | ||
<key type="s" name="simple-text-property"> | ||
<default>'simple-text-property Default Value'</default> | ||
<summary>simple-text-property summary</summary> | ||
<description>simple-text-property description</description> | ||
</key> | ||
<key type="s" name="simple-text-property-no-description"> | ||
<default>'simple-text-property-no-description Default Value'</default> | ||
<summary>simple-text-property-no-description summary</summary> | ||
</key> | ||
<key type="s" name="simple-text-property-no-default"> | ||
<summary>simple-text-property-no-default summary</summary> | ||
<description>simple-text-property-no-default description</description> | ||
</key> | ||
<key type="s" name="simple-text-property-no-summary"> | ||
<default>'simple-text-property-no-summary Default Value'</default> | ||
<description>simple-text-property-no-summary description</description> | ||
</key> | ||
</schema> | ||
</schemalist> |
21 changes: 21 additions & 0 deletions
21
...erate/system/missing_xml_declaration/usr/share/glib-2.0/schemas/schema-simple.gschema.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<schemalist gettext-domain="gsettings-ubuntu-touch-schemas"> | ||
<schema path="/com/ubuntu/simple/" id="com.ubuntu.simple"> | ||
<key type="s" name="simple-text-property"> | ||
<default>'simple-text-property Default Value'</default> | ||
<summary>simple-text-property summary</summary> | ||
<description>simple-text-property description</description> | ||
</key> | ||
<key type="s" name="simple-text-property-no-description"> | ||
<default>'simple-text-property-no-description Default Value'</default> | ||
<summary>simple-text-property-no-description summary</summary> | ||
</key> | ||
<key type="s" name="simple-text-property-no-default"> | ||
<summary>simple-text-property-no-default summary</summary> | ||
<description>simple-text-property-no-default description</description> | ||
</key> | ||
<key type="s" name="simple-text-property-no-summary"> | ||
<default>'simple-text-property-no-summary Default Value'</default> | ||
<description>simple-text-property-no-summary description</description> | ||
</key> | ||
</schema> | ||
</schemalist> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters