Add 'script' tag to handle init code with bash script 07/69007/6
authorMyoungJune Park <mj2004.park@samsung.com>
Wed, 11 May 2016 05:33:49 +0000 (14:33 +0900)
committerMyoungJune Park <mj2004.park@samsung.com>
Tue, 17 May 2016 08:34:06 +0000 (17:34 +0900)
Change-Id: Ide5da32a9807a9d904893acf1a2fb8ccda8d3b79
Signed-off-by: MyoungJune Park <mj2004.park@samsung.com>
Makefile
check.xsd
create_init_script.xsl [new file with mode: 0644]
data/vconf-internal-setting-keys.xml
packaging/vconf-internal-keys.spec

index 3e0c4f2..b793db5 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -6,6 +6,7 @@
 all:init allcmd allhtml allheader vconf-internal-keys.h endproc
 
 allcmd: $(shell find . -name "*.xml" | sed 's/xml/sh/')
+#allcmd2: $(shell find . -name "*.xml" | sed 's/xml/sh2/')
 allheader: $(shell find . -name "*.xml" | sed 's/xml/h/')
 allhtml: $(shell find . -name "*.xml" | sed 's/xml/html/')
 #allwrapper: $(shell find . -name "*.xml" | sed 's/.xml/_wrapper.h/')
@@ -27,10 +28,10 @@ init:
        @mkdir -p report
        @mkdir -p scripts
        @mkdir -p include
-       if [ -a ./scripts/all.sh ]; \
-       then \
-               rm ./scripts/all.sh; \
-       fi;
+#      if [ -a ./scripts/all.sh ]; \
+#      then \
+#              rm ./scripts/all.sh; \
+#      fi;
 
 %.html:%.xml
        xsltproc $(xsltopt) test_report.xsl $< > $@
@@ -40,6 +41,14 @@ init:
        xsltproc $(xsltopt) create_cmd.xsl $< | sed '/^$$/d' > $@
        cat $@ >> ./scripts/all.sh
        rm $@
+       xsltproc $(xsltopt) create_init_script.xsl $< | sed '/^$$/d' > $@
+       if [ -s $@ ]; then mv $@ ./scripts; fi
+
+
+#%.sh2:%.xml
+#      xsltproc $(xsltopt) create_init_script.xsl $< | sed '/^$$/d' > $@
+#      if [ -s $@ ]; then mv $@ ./scripts; fi
+
 
 %.h:%.xml
        xsltproc $(xsltopt) create_header.xsl $< | sed '/^$$/d' > $@
@@ -72,7 +81,6 @@ clean:
        @find . -name "*.h" | xargs rm
 
 endproc:
-       sed -i '1 i #!/bin/bash' ./scripts/all.sh
        ./remove_whitespace.sh
 
 #vconf-internal-keys.pc:vconf-internal-keys.pc.in
index fd05f07..870522b 100644 (file)
--- a/check.xsd
+++ b/check.xsd
@@ -17,6 +17,7 @@
                                <xs:element ref="creator" minOccurs='0' maxOccurs='1'/>
                                <xs:element ref="email" minOccurs='0' maxOccurs='1'/>
                                <xs:element ref="comment" minOccurs='0' maxOccurs='1'/>
+                               <xs:element ref="script" minOccurs='0' maxOccurs='1'/>
                                <xs:element ref="enumlist" minOccurs='0' maxOccurs='unbounded'/>
                        </xs:sequence>
                        <xs:attribute name="name" type='xs:string'/>
@@ -72,6 +73,7 @@
        <xs:element name="creator" type='xs:string'/>
        <xs:element name="email" type='xs:string'/>
        <xs:element name="comment" type='xs:string'/>
+       <xs:element name="script" type='xs:string'/>
 
 
        <xs:complexType name="Value">
diff --git a/create_init_script.xsl b/create_init_script.xsl
new file mode 100644 (file)
index 0000000..3d0763f
--- /dev/null
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet version="1.0"
+xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+<xsl:output method="text" version="1.0" encoding="UTF-8" indent="yes"/>
+<xsl:strip-space elements="*"/>
+<xsl:template match="/">
+  <xsl:apply-templates/>
+</xsl:template>
+<xsl:template match="vconfkey">
+<xsl:choose>
+       <xsl:when test="./script">
+<xsl:value-of select="script"/>
+  </xsl:when>
+</xsl:choose>
+</xsl:template>
+</xsl:stylesheet>
index 221dd28..05419d4 100644 (file)
     <creator> Myoungjune Park </creator>
     <email>mj2004.park@samsung.com</email>
     <comment><![CDATA[ setting - display - backlight time (value type : seconds) ]]></comment>
+       <script>
+<![CDATA[
+# VCONFKEY_SETAPPL_LCD_TIMEOUT_NORMAL initialization
+out=`vconftool get db/setting/lcd_backlight_normal | awk '{print $4}' | sed 's/,//g'`
+echo "-------------------------------------------------------------------------------------"
+echo "Backlight time :" $out
+echo "-------------------------------------------------------------------------------------"
+]]></script>
+
   </vconfkey>
   <vconfkey type="int32" name="db/setting/sound/call/ringtone_sound_volume" layer="system" readPriv="http://tizen.org/privilege/internal/default/public" writePriv="http://tizen.org/privilege/internal/default/platform">
     <header>VCONFKEY_SETAPPL_CALL_RINGTONE_SOUND_VOLUME_INT</header>
     <creator> Myoungjune Park </creator>
     <email>mj2004.park@samsung.com</email>
     <comment><![CDATA[ ]]></comment>
+       <script>
+<![CDATA[
+# VCONFKEY_SETAPPL_TIMEZONE_ID initialization
+out=`vconftool get db/setting/timezone_id | awk '{print $4}' | sed 's/,//g'`
+echo "-------------------------------------------------------------------------------------"
+echo $out
+rm -f /opt/etc/localtime
+ln -s /usr/share/zoneinfo/$out /opt/etc/localtime
+rm -f /etc/localtime
+ln -s /opt/etc/localtime /etc/localtime
+echo "-------------------------------------------------------------------------------------"
+]]></script>
   </vconfkey>
   <vconfkey type="string" name="db/setting/timezone" layer="system" readPriv="http://tizen.org/privilege/internal/default/platform" writePriv="http://tizen.org/privilege/internal/default/platform">
     <header>VCONFKEY_SETAPPL_TIMEZONE_INT</header>
index 156ec1a..8f60184 100755 (executable)
@@ -47,7 +47,7 @@ rm -rf %{buildroot}
 
 mkdir -p %{buildroot}
 mkdir -p %{buildroot}/opt/usr
-install -m 755 scripts/all.sh %{buildroot}/opt/usr
+install -m 755 scripts/*.sh %{buildroot}/opt/usr
 
 mkdir -p %{buildroot}/usr/include/vconf
 install -m 644 include/*.h %{buildroot}/usr/include/vconf
@@ -68,6 +68,16 @@ for file in ${filelist[@]} ; do
        fi
 done
 
+filelist=`find /opt/usr -name "vconf-internal-*.sh"`
+for file in $filelist
+do
+chmod a+x  $file
+#/bin/sh $file
+echo "running ---------------------------------------------------- $file"
+. $file
+rm $file
+done
+
 %postun -p /sbin/ldconfig
 
 %files