Squashed 'yocto-poky/' content from commit ea562de

git-subtree-dir: yocto-poky
git-subtree-split: ea562de57590c966cd5a75fda8defecd397e6436
diff --git a/meta/classes/primport.bbclass b/meta/classes/primport.bbclass
new file mode 100644
index 0000000..8ed45f0
--- /dev/null
+++ b/meta/classes/primport.bbclass
@@ -0,0 +1,21 @@
+python primport_handler () {
+    import bb.event
+    if not e.data:
+        return
+
+    if isinstance(e, bb.event.ParseCompleted):
+        import oe.prservice
+        #import all exported AUTOPR values
+        imported = oe.prservice.prserv_import_db(e.data)
+        if imported is None:
+            bb.fatal("import failed!")
+
+        for (version, pkgarch, checksum, value) in imported:
+            bb.note("imported (%s,%s,%s,%d)" % (version, pkgarch, checksum, value))
+    elif isinstance(e, bb.event.ParseStarted):
+        import oe.prservice
+        oe.prservice.prserv_check_avail(e.data)
+}
+
+addhandler primport_handler
+primport_handler[eventmask] = "bb.event.ParseCompleted bb.event.ParseStarted"