mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-10-04 12:49:19 +02:00
Fix gconf schema convert script to keep leading slash in paths
This commit is contained in:
@@ -537,18 +537,18 @@ def read_gconf_schema(gconf_schema_file):
|
|||||||
schemas_only = (gconf_schema.applyto is not None)
|
schemas_only = (gconf_schema.applyto is not None)
|
||||||
|
|
||||||
dirpath = gconf_schema.prefix
|
dirpath = gconf_schema.prefix
|
||||||
# remove leading slash because there's none in gsettings, and trailing
|
if dirpath[0] != '/':
|
||||||
# slash because we'll split the string
|
raise GSettingsSchemaConvertException('Key is not absolute: %s' % gconf_schema.prefix)
|
||||||
if dirpath[0] == '/':
|
|
||||||
dirpath = dirpath[1:]
|
# remove trailing slash because we'll split the string
|
||||||
if dirpath[-1] == '/':
|
if dirpath[-1] == '/':
|
||||||
dirpath = dirpath[:-1]
|
dirpath = dirpath[:-1]
|
||||||
# remove leading 'schemas/' for schemas-only keys
|
# remove leading 'schemas/' for schemas-only keys
|
||||||
if schemas_only and dirpath.startswith('schemas/'):
|
if schemas_only and dirpath.startswith('/schemas/'):
|
||||||
dirpath = dirpath[len('schemas/'):]
|
dirpath = dirpath[len('/schemas'):]
|
||||||
|
|
||||||
if not dirpath:
|
if len(dirpath) == 1:
|
||||||
raise GSettingsSchemaConvertException('Toplevel keys are not accepted: %s' % gconf_schema.applyto)
|
raise GSettingsSchemaConvertException('Toplevel keys are not accepted: %s' % gconf_schema.prefix)
|
||||||
|
|
||||||
hierarchy = dirpath.split('/')
|
hierarchy = dirpath.split('/')
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user