[pygobject: 5/23] dsextras.py: add pkgc_get_version and pkgc_get_defs_dir functions



commit b98277afc24886bbda400e0ad360992bffa77b7c
Author: Dieter Verfaillie <dieterv optionexplicit be>
Date:   Wed Nov 3 06:49:48 2010 +0100

    dsextras.py: add pkgc_get_version and pkgc_get_defs_dir functions
    
    Signed-off-by: Dieter Verfaillie <dieterv optionexplicit be>

 dsextras.py |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/dsextras.py b/dsextras.py
index cf20289..0cc08ca 100644
--- a/dsextras.py
+++ b/dsextras.py
@@ -117,6 +117,10 @@ def pkgc_version_check(name, req_version):
         
     return False
 
+def pkgc_get_version(name):
+    '''return the version as return by pkg-config --modversion'''
+    return getoutput('pkg-config --modversion %s' % name)
+
 def pkgc_get_libraries(name):
     """returns a list of libraries as returned by pkg-config --libs-only-l"""
     output = getoutput('pkg-config --libs-only-l %s' % name)
@@ -132,6 +136,12 @@ def pkgc_get_include_dirs(name):
     output = getoutput('pkg-config --cflags-only-I %s' % name)
     return output.replace('-I', '').split()
 
+def pkgc_get_defs_dir(name):
+    '''returns the defs dir as returned by pkg-config --variable=defsdir'''
+    output = getoutput('pkg-config --variable=defsdir %s' % name)
+    return output
+
+
 class BuildExt(build_ext):
     def init_extra_compile_args(self):
         self.extra_compile_args = []



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