pre-upload: add inclusion/exclusion for check_aosp_license

check_aosp_license does not have regex inclusion and exclusion. This patch
adds it.

BUG=None
TEST=added a exclusion regex for update_engine/scripts and it didn't complain
     about cros headers anymore.
TEST=./pre-upload_unittest.py passes

Change-Id: I9c13bcd870fc53f15bfa17d027e7a70ec70d5434
Reviewed-on: https://chromium-review.googlesource.com/890110
Commit-Ready: Amin Hassani <ahassani@chromium.org>
Tested-by: Amin Hassani <ahassani@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
diff --git a/pre-upload.py b/pre-upload.py
index a04678b..d1d12ca 100755
--- a/pre-upload.py
+++ b/pre-upload.py
@@ -1071,7 +1071,7 @@
     return HookFailure(msg, bad_copyright_files)
 
 
-def _check_aosp_license(_project, commit):
+def _check_aosp_license(_project, commit, options=()):
   """Verifies the AOSP license/copyright header.
 
   AOSP uses the Apache2 License:
@@ -1098,9 +1098,11 @@
   )
   license_re = re.compile(LICENSE_HEADER, re.MULTILINE)
 
+  included, excluded = _parse_common_inclusion_options(options)
+
   files = _filter_files(_get_affected_files(commit, relative=True),
-                        COMMON_INCLUDED_PATHS,
-                        COMMON_EXCLUDED_PATHS)
+                        included + COMMON_INCLUDED_PATHS,
+                        excluded + COMMON_EXCLUDED_PATHS)
 
   bad_files = []
   for f in files: