[Libvirt-cim] [PATCH 2 of 3] Add base schema installation script

Heidi Eckhart heidieck at linux.vnet.ibm.com
Mon Dec 10 13:06:21 UTC 2007


Dan Smith wrote:
> # HG changeset patch
> # User Dan Smith <danms at us.ibm.com>
> # Date 1197066990 28800
> # Node ID 0d80882209b4002da9283e4cfe17d48cb1155d45
> # Parent  588daf25941e36b540689209bf0c76b1ce08cb32
> Add base schema installation script
>   

Great work :). I tested the processes with sfcbd and found some minor 
things. After updating them, everything worked fine :). Thanks.

Somehow the "if [ ! mkdir ${dir}/CIM ]; then" in install_schema_sfcb() 
seem to do not work. I completely removed the CIM directory by hand, did 
"make preinstall" but no new one was created. The script does now 
creating the directory and testing for existence afterwards and this 
seems to work. I have only some experiences with scripts and don't know 
the reason for this behavior.
The schema files need to be copied to SFCB_DIR/CIM and sfcbrepos must be 
started with -f to avoid the question to the user for acceptance.
Added a line to remove the schema files from /tmp.

diff -r ae7fb433a73a base_schema/install_base_schema.sh.in
--- a/base_schema/install_base_schema.sh.in     Fri Dec 07 14:36:34 2007 
-0800
+++ b/base_schema/install_base_schema.sh.in     Mon Dec 10 14:00:37 2007 
+0100
@@ -64,15 +64,18 @@ install_schema_sfcb() {
 install_schema_sfcb() {
     local dir=$(detect_sfcb_dir)
 
-    if [ ! mkdir ${dir}/CIM ]; then
+    mkdir ${dir}/CIM
+    if [ -z ${dir}/CIM ]; then
        echo "Unable to determine SFCB directory"
        echo "set SFCB_DIR"
        return
     fi
 
     mv ${TMPDIR}/cimv???.mof ${TMPDIR}/CIM_Schema.mof
-    cp -ra ${TMPDIR}/* ${dir}
-    sfcbrepos
+    cp -ra ${TMPDIR}/* ${dir}/CIM
+    sfcbrepos -f
+
+    rm -rf ${TMPDIR}
 }
 
 if [ -z "$1" ]; then


-- 
Regards

Heidi Eckhart
Software Engineer
Linux Technology Center - Open Hypervisor

heidieck at linux.vnet.ibm.com

**************************************************
IBM Deutschland Entwicklung GmbH
Vorsitzender des Aufsichtsrats: Martin Jetter
Geschaeftsfuehrung: Herbert Kircher
Sitz der Gesellschaft: Boeblingen
Registergericht: Amtsgericht Stuttgart, HRB 243294




More information about the Libvirt-cim mailing list