summaryrefslogtreecommitdiff
path: root/licensing
diff options
context:
space:
mode:
authorDon Garrett <dgarrett@google.com>2014-08-12 14:08:44 -0700
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2014-08-13 02:50:36 +0000
commit5a115db41179cde52f792b9835e3b03b977d105c (patch)
tree03e7293f582ad5e52cd2111ea23307eae44655f9 /licensing
parent8035b3367a3da0b424de503236e9b44abfd3f002 (diff)
downloadchromite-5a115db41179cde52f792b9835e3b03b977d105c.tar.gz
licensing: Create ebuild_license_hook as a seperate script.
Since we call the license script with two totally seperate code paths, split it into two scripts with a shared library to make them easier to follow. This creates the new ebuild_licensing_hook script to be called during ebuild processing. We can't remove the equivalent code from the current script until the ebuild hook script (gen-package-licenses.sh) is also updated. BUG=None TEST=cros lint + manual testing. Change-Id: I0dcbe61d6379ba22a141d5e9edd048792934bf71 Reviewed-on: https://chromium-review.googlesource.com/212131 Tested-by: Don Garrett <dgarrett@chromium.org> Reviewed-by: Aviv Keshet <akeshet@chromium.org> Commit-Queue: Don Garrett <dgarrett@chromium.org>
Diffstat (limited to 'licensing')
l---------licensing/ebuild_license_hook1
-rw-r--r--licensing/ebuild_license_hook.py27
2 files changed, 28 insertions, 0 deletions
diff --git a/licensing/ebuild_license_hook b/licensing/ebuild_license_hook
new file mode 120000
index 000000000..72196ceea
--- /dev/null
+++ b/licensing/ebuild_license_hook
@@ -0,0 +1 @@
+../scripts/wrapper.py \ No newline at end of file
diff --git a/licensing/ebuild_license_hook.py b/licensing/ebuild_license_hook.py
new file mode 100644
index 000000000..41e33d602
--- /dev/null
+++ b/licensing/ebuild_license_hook.py
@@ -0,0 +1,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)