mail[Wesnoth-commits] r34058 - /trunk/scons/pkgconfig.py


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by loonycyborg on March 22, 2009 - 23:31:
Author: loonycyborg
Date: Sun Mar 22 23:31:40 2009
New Revision: 34058

URL: http://svn.gna.org/viewcvs/wesnoth?rev=34058&view=rev
Log:
Refactoring.

Modified:
    trunk/scons/pkgconfig.py

Modified: trunk/scons/pkgconfig.py
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/scons/pkgconfig.py?rev=34058&r1=34057&r2=34058&view=diff
==============================================================================
--- trunk/scons/pkgconfig.py (original)
+++ trunk/scons/pkgconfig.py Sun Mar 22 23:31:40 2009
@@ -2,15 +2,21 @@
 
 import os
 
+def run_pkg_config(env, name):
+    try:
+        env["ENV"]["PKG_CONFIG_PATH"] = os.environ.get("PKG_CONFIG_PATH")
+        env.ParseConfig("pkg-config --libs --cflags $PKGCONFIG_FLAGS '" + 
name + "'")
+        return True
+    except OSError:
+        return False
+
 def CheckPKG(context, name):
     env = context.env
     context.Message( 'Checking for %s... ' % name )
-    try:
-        env["ENV"]["PKG_CONFIG_PATH"] = os.environ.get("PKG_CONFIG_PATH")
-        env.ParseConfig("pkg-config --libs --cflags $PKGCONFIG_FLAGS '" + 
name + "'")
+    if run_pkg_config(env, name):
         context.Result("yes")
         return True
-    except OSError:
+    else:
         context.Result("no")
         return False
 




Related Messages


Powered by MHonArc, Updated Mon Mar 23 00:40:41 2009