[gobject-introspection] [scanner] Barf if running on unsupported platform



commit 1c22f4e9fdb45ca08a9ef09e27ed3c4891a4388d
Author: Johan Dahlin <johan gnome org>
Date:   Fri Jun 4 09:59:15 2010 -0300

    [scanner] Barf if running on unsupported platform
    
    Let us know explicitly if the platform is unsupported by
    the scanner.

 giscanner/shlibs.py |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/giscanner/shlibs.py b/giscanner/shlibs.py
index 563a55e..2349e7d 100644
--- a/giscanner/shlibs.py
+++ b/giscanner/shlibs.py
@@ -20,8 +20,8 @@
 #
 
 import re
-import subprocess
 import platform
+import subprocess
 
 from .utils import get_libtool_command, extract_libtool_shlib
 
@@ -72,10 +72,14 @@ def _resolve_non_libtool(options, binary, libraries):
     if libtool:
         args.extend(libtool)
         args.append('--mode=execute')
-    if platform.system() == 'Darwin':
+    platform_system = platform.system()
+    if platform_system == 'Darwin':
         args.extend(['otool', '-L', binary.args[0]])
-    else:
+    elif platform_system == 'Linux':
         args.extend(['ldd', binary.args[0]])
+    else:
+        raise SystemExit("Unsupported platform system: " %
+            (platform_system,))
     proc = subprocess.Popen(args, stdout=subprocess.PIPE)
     patterns = {}
     for library in libraries:



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