]> git.itanic.dy.fi Git - emerge-timer/commitdiff
Fix bug with older emerge.log format handling
authorEsko Kokkonen <esko.kokkonen@gmail.com>
Sat, 13 Aug 2011 09:39:16 +0000 (12:39 +0300)
committerEsko Kokkonen <esko.kokkonen@gmail.com>
Sat, 13 Aug 2011 09:39:16 +0000 (12:39 +0300)
Take into account if the string is shorter than it should be.

emerge-timer.py

index 313ca653c27b8cc83d1237e323e3775076dcea86..df9a4027f3916dce7afc9056110b2aff2109cb06 100755 (executable)
@@ -234,7 +234,8 @@ def main_loop(f, package, silent):
         if package in line:
             st = line.split(' ')
             for string in st:
-                if (package in string) and string[len(package)+1].isdigit():
+                if ((package in string) and (len(string) > len(package)+1)
+                    and (string[len(package)+1].isdigit())):
                     full_package = st[st.index(string)]
 
                     if ((">>>" in line) and ("emerge" in line)):