7 parser
= argparse
.ArgumentParser()
8 parser
.add_argument('patches', metavar
='P', type=argparse
.FileType('r'), nargs
='*',
9 help='list of patches (use - to read patches from stdin)')
10 parser
.add_argument('-a', dest
='architecture', action
='store',
11 help='find developers in charge of this architecture')
12 parser
.add_argument('-p', dest
='package', action
='store',
13 help='find developers in charge of this package')
14 parser
.add_argument('-c', dest
='check', action
='store_const',
15 const
=True, help='list files not handled by any developer')
16 return parser
.parse_args()
19 devs
= getdeveloperlib
.parse_developers()
24 # Check that only one action is given
26 if args
.architecture
is not None:
28 if args
.package
is not None:
32 if len(args
.patches
) != 0:
35 print("Cannot do more than one action")
38 print("No action specified")
41 # Handle the check action
43 files
= getdeveloperlib
.check_developers(devs
)
47 # Handle the architecture action
48 if args
.architecture
is not None:
50 if args
.architecture
in dev
.architectures
:
54 # Handle the package action
55 if args
.package
is not None:
57 if args
.package
in dev
.packages
:
61 # Handle the patches action
62 if len(args
.patches
) != 0:
63 (files
, infras
) = getdeveloperlib
.analyze_patches(args
.patches
)
66 # See if we have developers matching by package name
69 matching_devs
.add(dev
.name
)
70 # See if we have developers matching by package infra
73 matching_devs
.add(dev
.name
)
75 result
= "--to buildroot@buildroot.org"
76 for dev
in matching_devs
:
77 result
+= " --cc \"%s\"" % dev
80 print("git send-email %s" % result
)