[maemo-commits] [maemo-commits] r16640 - projects/haf/trunk/osso-af-startup/services

From: subversion at stage.maemo.org subversion at stage.maemo.org
Date: Wed Nov 12 17:47:23 EET 2008
Author: schulhof
Date: 2008-11-12 17:47:22 +0200 (Wed, 12 Nov 2008)
New Revision: 16640

Modified:
   projects/haf/trunk/osso-af-startup/services/af-defines.sh
   projects/haf/trunk/osso-af-startup/services/real-af-services
   projects/haf/trunk/osso-af-startup/services/real-af-startup
Log:
Add multi-argument support to source_if_is, then use it everywhere.

Modified: projects/haf/trunk/osso-af-startup/services/af-defines.sh
===================================================================
--- projects/haf/trunk/osso-af-startup/services/af-defines.sh	2008-11-12 15:40:46 UTC (rev 16639)
+++ projects/haf/trunk/osso-af-startup/services/af-defines.sh	2008-11-12 15:47:22 UTC (rev 16640)
@@ -26,6 +26,20 @@
 set +e
 
 export AF_INIT_DIR=/etc/osso-af-init
+
+source_if_is()
+{
+  farg=$AF_INIT_DIR/$1 
+
+  shift
+
+  if [ -f $farg ]; then
+    source $farg $@
+  else
+    echo "AF Warning: '$farg' not found"
+  fi
+}
+
 # user name is appended for multi-user Scratchbox
 USER=`whoami`
 if [ "x$USER" = "xroot" ]; then
@@ -105,17 +119,8 @@
   # MMC swap file location (directory)
   export MMC_SWAP_LOCATION=$MMC_MOUNTPOINT
 
-  source_if_is()
-  {
-    farg=$AF_INIT_DIR/$1 
-    if [ -f $farg ]; then
-      source $farg
-    else
-      echo "AF Warning: '$farg' not found"
-    fi
-  }
-
   source_if_is osso-gtk.defs
+  source_if_is matchbox.defs
   source_if_is keyboard.defs
   source_if_is sdl.defs
 

Modified: projects/haf/trunk/osso-af-startup/services/real-af-services
===================================================================
--- projects/haf/trunk/osso-af-startup/services/real-af-services	2008-11-12 15:40:46 UTC (rev 16639)
+++ projects/haf/trunk/osso-af-startup/services/real-af-services	2008-11-12 15:47:22 UTC (rev 16640)
@@ -4,7 +4,7 @@
 #
 # Copyright (C) 2004-2007 Nokia Corporation. All rights reserved.
 #
-# Contact: Kimmo Hämäläinen <kimmo.hamalainen at nokia.com>
+# Contact: Kimmo Hämäläinen <kimmo.hamalainen at nokia.com>
 #
 # This program is free software; you can redistribute it and/or
 # modify it under the terms of the GNU General Public License 
@@ -44,6 +44,8 @@
 
   source $AF_INIT_DIR/sapwood-server.sh start
 
+  source_if_is matchbox.sh start
+
   # wait until system D-BUS is ready (some stuff started by init
   # after us assume it is running)
   /usr/sbin/waitdbus system
@@ -74,6 +76,8 @@
   fi
   source $AF_INIT_DIR/sapwood-server.sh stop
 
+  source_if_is matchbox.sh stop
+
   if [ -x /etc/init.d/at-spi ]; then
     /etc/init.d/at-spi stop
   fi

Modified: projects/haf/trunk/osso-af-startup/services/real-af-startup
===================================================================
--- projects/haf/trunk/osso-af-startup/services/real-af-startup	2008-11-12 15:40:46 UTC (rev 16639)
+++ projects/haf/trunk/osso-af-startup/services/real-af-startup	2008-11-12 15:47:22 UTC (rev 16640)
@@ -20,9 +20,7 @@
 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
 # 02110-1301 USA
 
-if [ -f /etc/osso-af-init/wizard-background-defs.sh ]; then
-  source /etc/osso-af-init/wizard-background-defs.sh
-fi
+source_if_is wizard-background-defs.sh
 
 if ! type wizback_method 2> /dev/null; then
   wizback_method() # args ignored
@@ -58,38 +56,25 @@
   fi
   source $SESSION_BUS_ADDRESS_FILE
 
-  if test -f $AF_INIT_DIR/tracker.sh; then
-    source $AF_INIT_DIR/tracker.sh start
-  fi
+  source_if_is tracker.sh start
 
   if [ -x /etc/osso-af-init/maemo-launcher ]; then
     /etc/osso-af-init/maemo-launcher start
   fi
 
-  if [ -x $AF_INIT_DIR/startup-greeting.sh ]; then
-    source $AF_INIT_DIR/startup-greeting.sh start
-  fi
+  source_if_is startup-greeting.sh start
 
-  # we need to start VKB 
-  if [ -f $AF_INIT_DIR/keyboard.defs ]; then
-    source $AF_INIT_DIR/keyboard.defs
-  fi
+  # we need to start VKB
+  source_if_is keyboard.defs
+  source_if_is keyboard.sh start
 
-  if [ -f $AF_INIT_DIR/keyboard.sh ]; then
-    source $AF_INIT_DIR/keyboard.sh start
-  fi
-
   # start clipboard daemon 
-  if [ -f $AF_INIT_DIR/clipboard.sh ]; then
-    source $AF_INIT_DIR/clipboard.sh start
-  fi
+  source_if_is clipboard.sh start
 
   if [ -e $HOME/first-boot-flag ]; then
     ADVANCE_STEPS=1
 
-    if [ -x $AF_INIT_DIR/wizard-background.sh ]; then
-      source $AF_INIT_DIR/wizard-background.sh start
-    fi
+    source_if_is wizard-background.sh start
 
     if [ -x $AF_INIT_DIR/startup-wizard.sh ]; then
       wizback_method advance 1
@@ -166,16 +151,12 @@
     rm -f /tmp/suw-user-cancelled.tmp
     touch /tmp/.check_auto_install
 
-    if [ -x $AF_INIT_DIR/startup-greeting.sh ]; then
-      source $AF_INIT_DIR/startup-greeting.sh firstboot
-    fi
+    source_if_is startup-greeting.sh firstboot
 
     wizback_method quit
 
   else
-    if [ -x $AF_INIT_DIR/startup-wizard.sh ]; then
-      source $AF_INIT_DIR/startup-wizard.sh start
-    fi
+    source_if_is startup-wizard.sh start
 
     # Give Backup a chance to finish restoring task
     if [ -f $HOME/.osso-backup/last-restore.xml ]; then
@@ -195,9 +176,7 @@
     $AF_INIT_DIR/osso-media-server.sh stop
   fi
 
-  if test -f $AF_INIT_DIR/tracker.sh; then
-    source $AF_INIT_DIR/tracker.sh stop
-  fi
+  source_if_is tracker.sh stop
 
   ;;
 restart)


More information about the maemo-commits mailing list