]> git.itanic.dy.fi Git - emerge-timer/commitdiff
Add the ability for the user to insert full package names
authorEsko Kokkonen <esko.kokkonen@gmail.com>
Mon, 13 Jun 2011 16:33:36 +0000 (19:33 +0300)
committerEsko Kokkonen <esko.kokkonen@gmail.com>
Mon, 13 Jun 2011 16:33:36 +0000 (19:33 +0300)
I.e. names like www-client/firefox

emerge-timer.py

index 6d40c19c94dcd14ed731ab08f9e7d485c5cf20e0..8beaa78bc98237060be79781eeb1b40d99eca5c4 100755 (executable)
@@ -91,6 +91,16 @@ def get_package(name):
     dirlist = os.listdir(PORTDIR)
     possible_package = []
 
+    if '/' in name:
+        group = name.partition('/')[0]
+        pkg = name.partition('/')[2]
+        directory = PORTDIR + group
+
+        if group in dirlist:
+            dirs = os.listdir(directory)
+            if pkg in dirs:
+                possible_package.append(name)
+
     for i in dirlist:
         directory = PORTDIR + i
         if os.path.isdir(directory):