mirror of
https://git.yoctoproject.org/poky
synced 2026-06-02 13:29:49 +00:00
bitbake: prserv: add "upstream" server support
Introduce a PRSERVER_UPSTREAM variable that makes the local PR server connect to an "upstream" one. This makes it possible to implement local fixes to an upstream package (revision "x", in a way that gives the local update priority (revision "x.y"). Update the calculation of the new revisions to support the case when prior revisions are not integers, but have an "x.y..." format." Set the comments in the handle_get_pr() function in serv.py for details about the calculation of the local revision. This is done by going on supporting the "history" mode that wasn't used so far (revisions can return to a previous historical value), in addition to the default "no history" mode (revisions can never decrease). Rather than storing the history mode in the database table itself (i.e. "PRMAIN_hist" and "PRMAIN_nohist"), the history mode is now passed through the client requests. As a consequence, the table name is now "PRMAIN", which is incompatible with what was generated before, but avoids confusion if we kept the "PRMAIN_nohist" name for both "history" and "no history" modes. Update the server version to "2.0.0". (Bitbake rev: 48857ec3e075791bd73d92747c609a0a4fda0e0c) Signed-off-by: Michael Opdenacker <michael.opdenacker@bootlin.com> Cc: Joshua Watt <JPEWhacker@gmail.com> Cc: Tim Orling <ticotimo@gmail.com> Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
5f99010e41
commit
4cbce9cdf7
@@ -6,6 +6,7 @@
|
||||
|
||||
import logging
|
||||
import bb.asyncrpc
|
||||
from . import create_async_client
|
||||
|
||||
logger = logging.getLogger("BitBake.PRserv")
|
||||
|
||||
@@ -13,16 +14,16 @@ class PRAsyncClient(bb.asyncrpc.AsyncClient):
|
||||
def __init__(self):
|
||||
super().__init__("PRSERVICE", "1.0", logger)
|
||||
|
||||
async def getPR(self, version, pkgarch, checksum):
|
||||
async def getPR(self, version, pkgarch, checksum, history=False):
|
||||
response = await self.invoke(
|
||||
{"get-pr": {"version": version, "pkgarch": pkgarch, "checksum": checksum}}
|
||||
{"get-pr": {"version": version, "pkgarch": pkgarch, "checksum": checksum, "history": history}}
|
||||
)
|
||||
if response:
|
||||
return response["value"]
|
||||
|
||||
async def test_pr(self, version, pkgarch, checksum):
|
||||
async def test_pr(self, version, pkgarch, checksum, history=False):
|
||||
response = await self.invoke(
|
||||
{"test-pr": {"version": version, "pkgarch": pkgarch, "checksum": checksum}}
|
||||
{"test-pr": {"version": version, "pkgarch": pkgarch, "checksum": checksum, "history": history}}
|
||||
)
|
||||
if response:
|
||||
return response["value"]
|
||||
@@ -41,16 +42,16 @@ class PRAsyncClient(bb.asyncrpc.AsyncClient):
|
||||
if response:
|
||||
return response["value"]
|
||||
|
||||
async def importone(self, version, pkgarch, checksum, value):
|
||||
async def importone(self, version, pkgarch, checksum, value, history=False):
|
||||
response = await self.invoke(
|
||||
{"import-one": {"version": version, "pkgarch": pkgarch, "checksum": checksum, "value": value}}
|
||||
{"import-one": {"version": version, "pkgarch": pkgarch, "checksum": checksum, "value": value, "history": history}}
|
||||
)
|
||||
if response:
|
||||
return response["value"]
|
||||
|
||||
async def export(self, version, pkgarch, checksum, colinfo):
|
||||
async def export(self, version, pkgarch, checksum, colinfo, history=False):
|
||||
response = await self.invoke(
|
||||
{"export": {"version": version, "pkgarch": pkgarch, "checksum": checksum, "colinfo": colinfo}}
|
||||
{"export": {"version": version, "pkgarch": pkgarch, "checksum": checksum, "colinfo": colinfo, "history": history}}
|
||||
)
|
||||
if response:
|
||||
return (response["metainfo"], response["datainfo"])
|
||||
|
||||
Reference in New Issue
Block a user