gconf:first release
This commit is contained in:
Executable
+38
@@ -0,0 +1,38 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import piksemel
|
||||
import os
|
||||
|
||||
def installGconfSchemas(filepath):
|
||||
os.environ['GCONF_CONFIG_SOURCE'] = 'xml:merged:/etc/gconf/gconf.xml.defaults'
|
||||
parse = piksemel.parse(filepath)
|
||||
schemas = []
|
||||
for schema in parse.tags("File"):
|
||||
path = schema.getTagData("Path")
|
||||
if path.startswith("etc/gconf/schemas"):
|
||||
schemas.append("/"+path)
|
||||
|
||||
if schemas:
|
||||
os.system("/usr/bin/gconftool-2 --makefile-install-rule %s" % " ".join(schemas))
|
||||
|
||||
def uninstallGconfSchemas(filepath):
|
||||
os.environ['GCONF_CONFIG_SOURCE'] = 'xml:merged:/etc/gconf/gconf.xml.defaults'
|
||||
parse = piksemel.parse(filepath)
|
||||
schemas = []
|
||||
for schema in parse.tags("File"):
|
||||
path = schema.getTagData("Path")
|
||||
if path.startswith("etc/gconf/schemas"):
|
||||
schemas.append("/"+path)
|
||||
|
||||
if schemas:
|
||||
os.system("/usr/bin/gconftool-2 --makefile-uninstall-rule %s" % " ".join(schemas))
|
||||
|
||||
def setupPackage(metapath, filepath):
|
||||
installGconfSchemas(filepath)
|
||||
|
||||
def cleanupPackage(metapath, filepath):
|
||||
uninstallGconfSchemas(filepath)
|
||||
|
||||
def postCleanupPackage(metapath, filepath):
|
||||
pass
|
||||
Reference in New Issue
Block a user