[virt-tools-list] [libosinfo v6] Make 'filename' more consistent w/ other restrictions
Zeeshan Ali (Khattak)
zeeshanak at gnome.org
Wed Nov 14 15:30:33 UTC 2012
From: "Zeeshan Ali (Khattak)" <zeeshanak at gnome.org>
'filename' should be toplevel node under 'install-script' rather than
an attribute of its toplevel 'template' child. The reason this was
previously put in the incorrect place was that the first idea was to have
multiple files under one install script but we later decided to go for 1
file per install script.
Also note that I'm naming the element to 'expected-filename'. This is
to make it consistent with associated API and to simplify loading code.
---
data/install-scripts/fedora.xml | 6 ++++--
data/install-scripts/windows-cmd.xml | 3 ++-
data/install-scripts/windows-reg.xml | 3 ++-
data/install-scripts/windows-sif.xml | 6 ++++--
data/install-scripts/windows-unattend.xml | 6 ++++--
data/schemas/libosinfo.rng | 6 +++++-
osinfo/osinfo_loader.c | 10 +---------
7 files changed, 22 insertions(+), 18 deletions(-)
diff --git a/data/install-scripts/fedora.xml b/data/install-scripts/fedora.xml
index a62e2e4..dc767d5 100644
--- a/data/install-scripts/fedora.xml
+++ b/data/install-scripts/fedora.xml
@@ -2,6 +2,7 @@
<!-- JEOS PROFILE -->
<install-script id='http://fedoraproject.org/scripts/fedora/jeos'>
<profile>jeos</profile>
+ <expected-filename>fedora.ks</expected-filename>
<config>
<param name="admin-password" policy="optional"/>
<param name="l10n-keyboard" policy="optional"/>
@@ -9,7 +10,7 @@
<param name="l10n-timezone" policy="optional"/>
<param name="target-disk" policy="optional"/>
</config>
- <template filename="fedora.ks">
+ <template>
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
@@ -108,6 +109,7 @@ reboot
<!-- DESKTOP PROFILE -->
<install-script id='http://fedoraproject.org/scripts/fedora/desktop'>
<profile>desktop</profile>
+ <expected-filename>fedora.ks</expected-filename>
<config>
<param name="l10n-keyboard" policy="optional"/>
<param name="l10n-language" policy="optional"/>
@@ -120,7 +122,7 @@ reboot
<param name="avatar-disk" policy="optional"/>
<param name="target-disk" policy="optional"/>
</config>
- <template filename="fedora.ks">
+ <template>
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
diff --git a/data/install-scripts/windows-cmd.xml b/data/install-scripts/windows-cmd.xml
index 19e3e8c..020a493 100644
--- a/data/install-scripts/windows-cmd.xml
+++ b/data/install-scripts/windows-cmd.xml
@@ -3,6 +3,7 @@
<install-script id='http://microsoft.com/windows/cmd/desktop'>
<profile>desktop</profile>
<path-format>dos</path-format>
+ <expected-filename>windows.cmd</expected-filename>
<config>
<param name="admin-password" policy="optional"/>
<param name="user-realname" policy="required"/>
@@ -11,7 +12,7 @@
<param name="target-disk" policy="optional"/>
<param name="script-disk" policy="optional"/>
</config>
- <template filename="windows.cmd">
+ <template>
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
diff --git a/data/install-scripts/windows-reg.xml b/data/install-scripts/windows-reg.xml
index 361f7ec..df38188 100644
--- a/data/install-scripts/windows-reg.xml
+++ b/data/install-scripts/windows-reg.xml
@@ -3,11 +3,12 @@
<install-script id='http://microsoft.com/windows/reg/desktop'>
<profile>desktop</profile>
<path-format>dos</path-format>
+ <expected-filename>windows.reg</expected-filename>
<config>
<param name="admin-password" policy="optional"/>
<param name="user-realname" policy="required"/>
</config>
- <template filename="windows.reg">
+ <template>
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
diff --git a/data/install-scripts/windows-sif.xml b/data/install-scripts/windows-sif.xml
index 517a41d..b16d979 100644
--- a/data/install-scripts/windows-sif.xml
+++ b/data/install-scripts/windows-sif.xml
@@ -4,12 +4,13 @@
<profile>jeos</profile>
<path-format>dos</path-format>
<product-key-format>$$$$$-$$$$$-$$$$$-$$$$$-$$$$$</product-key-format>
+ <expected-filename>winnt.sif</expected-filename>
<config>
<param name="admin-password" policy="optional"/>
<param name="reg-product-key" policy="required"/>
<param name="user-realname" policy="required"/>
</config>
- <template filename="winnt.sif">
+ <template>
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
@@ -68,13 +69,14 @@
<profile>desktop</profile>
<path-format>dos</path-format>
<product-key-format>$$$$$-$$$$$-$$$$$-$$$$$-$$$$$</product-key-format>
+ <expected-filename>winnt.sif</expected-filename>
<config>
<param name="admin-password" policy="optional"/>
<param name="reg-product-key" policy="required"/>
<param name="user-realname" policy="required"/>
<param name="hostname" policy="required"/>
</config>
- <template filename="winnt.sif">
+ <template>
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
diff --git a/data/install-scripts/windows-unattend.xml b/data/install-scripts/windows-unattend.xml
index 3b30dd9..d3b2df5 100644
--- a/data/install-scripts/windows-unattend.xml
+++ b/data/install-scripts/windows-unattend.xml
@@ -3,6 +3,7 @@
<profile>jeos</profile>
<path-format>dos</path-format>
<product-key-format>$$$$$-$$$$$-$$$$$-$$$$$-$$$$$</product-key-format>
+ <expected-filename>autounattend.xml</expected-filename>
<config>
<param name="admin-password" policy="optional"/>
<param name="hardware-arch" policy="optional"/>
@@ -13,7 +14,7 @@
<param name="reg-product-key" policy="optional"/>
<param name="target-disk" policy="optional"/>
</config>
- <template filename="autounattend.xml">
+ <template>
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
@@ -182,6 +183,7 @@
<profile>desktop</profile>
<path-format>dos</path-format>
<product-key-format>$$$$$-$$$$$-$$$$$-$$$$$-$$$$$</product-key-format>
+ <expected-filename>autounattend.xml</expected-filename>
<config>
<param name="admin-password" policy="optional"/>
<param name="hardware-arch" policy="required"/>
@@ -193,7 +195,7 @@
<param name="reg-product-key" policy="optional"/>
<param name="target-disk" policy="optional"/>
</config>
- <template filename="autounattend.xml">
+ <template>
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
diff --git a/data/schemas/libosinfo.rng b/data/schemas/libosinfo.rng
index 67bcdf8..455c8d5 100644
--- a/data/schemas/libosinfo.rng
+++ b/data/schemas/libosinfo.rng
@@ -473,6 +473,11 @@
<ref name='path-formats'/>
</element>
</optional>
+ <optional>
+ <element name='expected-filename'>
+ <text/>
+ </element>
+ </optional>
<element name='config'>
<attribute name="name"/>
<attribute name="policy">
@@ -483,7 +488,6 @@
<text/>
</element>
<element name='template'>
- <attribute name="filename"/>
<choice>
<group>
<attribute name="uri"/>
diff --git a/osinfo/osinfo_loader.c b/osinfo/osinfo_loader.c
index eb09cd9..4736189 100644
--- a/osinfo/osinfo_loader.c
+++ b/osinfo/osinfo_loader.c
@@ -608,6 +608,7 @@ static void osinfo_loader_install_script(OsinfoLoader *loader,
OSINFO_INSTALL_SCRIPT_PROP_PROFILE,
OSINFO_INSTALL_SCRIPT_PROP_PRODUCT_KEY_FORMAT,
OSINFO_INSTALL_SCRIPT_PROP_PATH_FORMAT,
+ OSINFO_INSTALL_SCRIPT_PROP_EXPECTED_FILENAME,
NULL
};
gchar *value = NULL;
@@ -643,15 +644,6 @@ static void osinfo_loader_install_script(OsinfoLoader *loader,
value);
g_free(value);
- value = osinfo_loader_string("string(./template/@filename)", ctxt, err);
- if (error_is_set(err))
- goto error;
- if (value)
- osinfo_entity_set_param(OSINFO_ENTITY(installScript),
- OSINFO_INSTALL_SCRIPT_PROP_EXPECTED_FILENAME,
- value);
- g_free(value);
-
osinfo_loader_install_config_params(loader,
OSINFO_ENTITY(installScript),
"./config/*",
--
1.8.0
More information about the virt-tools-list
mailing list