]> git.itanic.dy.fi Git - emerge-timer/commitdiff
Try not to include packages with similiar names
authorEsko Kokkonen <esko.kokkonen@gmail.com>
Sat, 11 Jun 2011 12:46:23 +0000 (15:46 +0300)
committerEsko Kokkonen <esko.kokkonen@gmail.com>
Sat, 11 Jun 2011 12:46:23 +0000 (15:46 +0300)
Check if the character after the package name is a digit or not. If it
is a digit, this is a valid package emerge, and if it's not we're
dealing with another package that has a similiar name.

emerge-timer.py

index 82d79fc5411ccdd1c77b9959172c62e2c930830f..a9b37b956b4e4214e544b98bb2f2f48e804789f0 100755 (executable)
@@ -134,9 +134,10 @@ for line in f:
     if package in line:
         if (">>>" in line) and ("emerge" in line):
             st = line.split(' ')
-            for i in st:
-                if package_name in i:
-                    full_package = st[st.index(i)]
+            for string in st:
+                if package in string:
+                    if string[len(package)+1].isdigit():
+                        full_package = st[st.index(string)]
 
             time = get_time(line, 1)