summaryrefslogtreecommitdiff
path: root/licensing/ebuild_license_hook.py
blob: 41e33d60249ee1ca8d5a48143fc6e18d5cf13404 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/usr/bin/python
#
# Copyright (c) 2014 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
#
"""Emerge hook to pre-parse and verify license information.

Called from src/scripts/hooks/install/gen-package-licenses.sh as part of a
package emerge.
"""

from chromite.lib import commandline

from chromite.licensing import licenses


def main(args):
  parser = commandline.ArgumentParser(usage=__doc__)
  parser.add_argument("--builddir", type="path", dest="builddir",
                      help="Take $PORTAGE_BUILDDIR as argument.")

  opts = parser.parse_args(args)


  licensing = licenses.Licensing(None, None, True)
  licensing.HookPackageProcess(opts.builddir)