[pkg-fso-commits] [SCM] framworkd debian packageing branch, master, updated. milestone2-89-geb27523

Michael 'Mickey' Lauer mickey at vanille-media.de
Sat Aug 23 14:06:21 UTC 2008


The following commit has been merged in the master branch:
commit ea95d8e6471b503aa77de1045354aa2091e62564
Author: Michael 'Mickey' Lauer <mickey at vanille-media.de>
Date:   Tue Aug 19 01:42:57 2008 +0200

    compute install prefix

diff --git a/framework/config.py b/framework/config.py
index 3e3c1e0..0a0271d 100644
--- a/framework/config.py
+++ b/framework/config.py
@@ -27,7 +27,6 @@ import os
 import logging
 logger = logging.getLogger( "frameworkd" )
 
-
 # FIXME This dict map syslog message levels to logging message levels
 # FIXME Remove this when we have removed all of the deprecated 'LOG' calls
 logging_levels_map = {
@@ -51,23 +50,25 @@ logging.basicConfig(
     format='%(name)-8s %(levelname)-8s %(message)s'
 )
 
+#
 # init configuration
+#
 config = None
-for p in [
+searchpath = [
         os.path.expanduser( "~/.frameworkd.conf" ),
         "/etc/frameworkd.conf",
         os.path.join( os.path.dirname( __file__ ), "../conf/frameworkd.conf" ),
         os.path.expanduser("~/.frameworkd.conf")
-    ]:
+    ]
+for p in searchpath:
     if os.path.exists( p ):
         logger.info( "Using configuration file %s" % p )
         config = SmartConfigParser( p )
         break
 
-if not config:
-    logger.error("Can't find a configuration file")
-    raise IOError
-
+if config is None:
+    logger.error( "Can't find a configuration file. Looked in %s" % searchpath )
+    raise IOError, "can't find configuration file"
 
 version = config.getInt( "frameworkd", "version", 0 )
 if version != NEEDS_VERSION:
@@ -75,3 +76,15 @@ if version != NEEDS_VERSION:
     logger.warning( "[frameworkd]" )
     logger.warning( "version = %d" % NEEDS_VERSION )
 
+#
+# compute install prefix
+#
+installprefix = "/" # unknown first
+searchpath = "/usr/local /usr /local/pkg/fso /opt".split()
+thisdirname = os.path.dirname( __file__ )
+for p in searchpath:
+    if thisdirname.startswith( p ):
+        installprefix = p
+        break
+
+logger.info( "Installprefix is %s" % installprefix )

-- 
framworkd debian packageing



More information about the pkg-fso-commits mailing list