Ignore python USE_EXPAND variables v2.1.25
authorMike Pagano <mpagano@gentoo.org>
Sun, 17 Sep 2017 23:12:08 +0000 (19:12 -0400)
committerMike Pagano <mpagano@gentoo.org>
Sun, 17 Sep 2017 23:12:08 +0000 (19:12 -0400)
portpeek

index 3d3c610..6d4880e 100755 (executable)
--- a/portpeek
+++ b/portpeek
@@ -16,7 +16,7 @@
 
 __author__ = "Michael Pagano"
 __email__ = "mpagano@gentoo.org"
-__version__ = "2.1.24"
+__version__ = "2.1.25"
 __productname__ = "portpeek"
 __description__ = "Displays user unmasked ebuilds and installable options from the portage tree"
 
@@ -60,6 +60,7 @@ fix_asked = False
 use_flag_dict = {}
 useremove_display = ""
 invalid_flag_found = False
+python_use_expand = ["PYTHON_TARGETS","PYTHON_SINGLE_TARGET","python_target","python_single_target"]
 
 try:
     PORTAGE_CONFIGROOT
@@ -441,6 +442,7 @@ def get_info(filename):
     try:
         filedescriptor = open(filename)
         for line in filedescriptor.readlines():
+            use_expand_found=False
             line = line.strip()
             if len(line) <= 0:
                 continue
@@ -452,6 +454,14 @@ def get_info(filename):
                 line = line.strip()
                 if len(line) <= 0:
                     continue
+            # ignore use expands
+            for python_use_expand_flag in python_use_expand:
+                if line.find(python_use_expand_flag) >=0:
+                    use_expand_found=True
+                    break 
+            if (use_expand_found==True):
+                continue
+
             if (processing_package_use == False):
                 diffs_found = parse_line(line, filename)
             else: