]> rtime.felk.cvut.cz Git - coffee/buildroot.git/blobdiff - utils/get-developers
lrzsz: install symlinks for XMODEM and YMODEM
[coffee/buildroot.git] / utils / get-developers
index fa6fc2fc6889f099f66e57f7f4075ab64691d9a7..f525ff222634db008b1269fe6b3c9ebe18f40b79 100755 (executable)
@@ -3,6 +3,8 @@
 import argparse
 import getdeveloperlib
 import sys
+import os
+
 
 def parse_args():
     parser = argparse.ArgumentParser()
@@ -12,10 +14,13 @@ def parse_args():
                         help='find developers in charge of this architecture')
     parser.add_argument('-p', dest='package', action='store',
                         help='find developers in charge of this package')
+    parser.add_argument('-f', dest='files', nargs='*',
+                        help='find developers in charge of these files')
     parser.add_argument('-c', dest='check', action='store_const',
                         const=True, help='list files not handled by any developer')
     return parser.parse_args()
 
+
 def __main__():
     devs = getdeveloperlib.parse_developers()
     if devs is None:
@@ -28,6 +33,8 @@ def __main__():
         action += 1
     if args.package is not None:
         action += 1
+    if args.files:
+        action += 1
     if args.check:
         action += 1
     if len(args.patches) != 0:
@@ -59,6 +66,16 @@ def __main__():
                 print(dev.name)
         return
 
+    # Handle the files action
+    if args.files is not None:
+        args.files = [os.path.abspath(f) for f in args.files]
+        for dev in devs:
+            for devfile in dev.files:
+                commonfiles = [f for f in args.files if f.startswith(devfile)]
+                if commonfiles:
+                    print(dev.name)
+                    break
+
     # Handle the patches action
     if len(args.patches) != 0:
         (files, infras) = getdeveloperlib.analyze_patches(args.patches)
@@ -80,5 +97,5 @@ def __main__():
         if result != "":
             print("git send-email %s" % result)
 
-__main__()
 
+__main__()