SF.net SVN: morphix: [2331] trunk/morph-scripts/morphmini

[email protected] Sat, 01 Jul 2006 07:26:32 -0700
Newsgroups gmane.linux.morphix.cvs
Message-ID <[email protected]>
Revision: 2331
Author:   bmsleight
Date:     2006-07-01 07:26:28 -0700 (Sat, 01 Jul 2006)
ViewCVS:  http://svn.sourceforge.net/morphix/?rev=2331&view=rev

Log Message:
-----------
Capture some errors, update example template

Modified Paths:
--------------
    trunk/morph-scripts/morphmini/example.xml
    trunk/morph-scripts/morphmini/morphmini
Modified: trunk/morph-scripts/morphmini/example.xml
===================================================================
--- trunk/morph-scripts/morphmini/example.xml	2006-06-28 22:19:13 UTC (rev 2330)
+++ trunk/morph-scripts/morphmini/example.xml	2006-07-01 14:26:28 UTC (rev 2331)
@@ -16,7 +16,6 @@
     </remote>
    </filelist>
    <root> <!-- Files or Packages to be overlaid on the rootfile system - good for saving ramspace-->
-          <!-- root currently ignores bootoption and will always overlay the files -->
     <files>
      <local>
       <from>/home/morph/test.jpg</from>
@@ -31,12 +30,12 @@
       <to>/usr/share/misc/</to>
      </remote>
     </files>
-    <packages> <!-- Very crude way of using packages, depends is ignored, not on package list and can not be uninstalled -->
+    <packages> <!-- Not yet implemented -->
      <local>
-      <deb>/home/morph/example.deb</deb>
+      <targz>/home/morph/example.tar.gz</targz>
      </local>
      <remote>
-      <deb>http://www.barwap.com/morphix/rebrand/morphix-rebrand_0.2-23_i386.deb</deb>
+      <targz>http://www.barwap.com/morphix/rebrand/morphix-rebrand.tar.gz</targz>
      </remote>
     </packages>
    </root>

Modified: trunk/morph-scripts/morphmini/morphmini
===================================================================
--- trunk/morph-scripts/morphmini/morphmini	2006-06-28 22:19:13 UTC (rev 2330)
+++ trunk/morph-scripts/morphmini/morphmini	2006-07-01 14:26:28 UTC (rev 2331)
@@ -19,6 +19,26 @@
  DOLLAR1=$DOLLAR"1"
 }
 
+
+am_i_root_exit_if_not ()
+{
+if [ `id -u` -ne 0 ]; then
+ echo "Need to have be able to run the mount command, i.e. must be root"
+ exit
+fi
+}
+
+
+test_xml_valid ()
+{
+ VALID_XML=$(xmlstarlet val $TEMPLATE 2>/dev/null |  cut -d ' ' -f3 )
+ if [ "$VALID_XML" = "invalid" ]; then
+   echo "Invalid XML in template "
+   echo " Use xmlstarlet val $TEMPLATE for more details."
+   exit
+ fi
+}
+
 set_up_module_build ()
 {
 mkdir $TMP_DIR					2>/dev/null
@@ -261,9 +281,10 @@
     exit
 fi
 
+test_xml_valid
+am_i_root_exit_if_not
 get_global_variables
 set_up_module_build
-#Test xml file error check.
 write_tags_and_desciptions
 process_root_files
 process_root_packages


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.


Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642