Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / third_party / chromite / licensing / ebuild_license_hook.py
1 # Copyright 2014 The Chromium OS Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
4
5 """Emerge hook to pre-parse and verify license information.
6
7 Called from src/scripts/hooks/install/gen-package-licenses.sh as part of a
8 package emerge.
9 """
10
11 from __future__ import print_function
12
13 from chromite.lib import commandline
14
15 from chromite.licensing import licenses_lib
16
17
18 def main(args):
19   parser = commandline.ArgumentParser(usage=__doc__)
20   parser.add_argument('--builddir', type='path', dest='builddir',
21                       help='Take $PORTAGE_BUILDDIR as argument.')
22
23   opts = parser.parse_args(args)
24   opts.Freeze()
25
26   licenses_lib.HookPackageProcess(opts.builddir)