gobject-introspection r486 - in trunk: . tools



Author: walters
Date: Sun Aug 24 22:36:08 2008
New Revision: 486
URL: http://svn.gnome.org/viewvc/gobject-introspection?rev=486&view=rev

Log:
2008-08-24  Colin Walters  <walters verbum org>

	* tools/g-ir-scanner: Use subprocess instead of
	commands, works on Windows and avoids the evil
	shell on Unix.


Modified:
   trunk/ChangeLog
   trunk/tools/g-ir-scanner

Modified: trunk/tools/g-ir-scanner
==============================================================================
--- trunk/tools/g-ir-scanner	(original)
+++ trunk/tools/g-ir-scanner	Sun Aug 24 22:36:08 2008
@@ -19,7 +19,7 @@
 # 02110-1301, USA.
 #
 
-import commands
+import subprocess
 import optparse
 import os
 import sys
@@ -135,14 +135,15 @@
     primary_library = options.libraries[0]
 
     for package in options.packages:
-        output = commands.getoutput('pkg-config --cflags %s' % (package, ))
+        output = subprocess.Popen(['pkg-config', '--cflags', package], 
+                                  stdout=subprocess.PIPE).communicate()[0]
         pkg_options, unused = parser.parse_args(output.split())
         options.cpp_includes.extend(pkg_options.cpp_includes)
         options.cpp_defines.extend(pkg_options.cpp_defines)
         options.cpp_undefines.extend(pkg_options.cpp_undefines)
 
-        output = commands.getoutput('pkg-config --libs-only-L %s' % (
-            package, ))
+        output = subprocess.Popen(['pkg-config', '--libs-only-L', package],
+                                  stdout=subprocess.PIPE).communicate()[0]
         pkg_options, unused = parser.parse_args(output.split())
         options.library_paths.extend(pkg_options.library_paths)
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]