summaryrefslogtreecommitdiffstats
path: root/bitbake/bin
diff options
context:
space:
mode:
authorMichael Opdenacker <michael.opdenacker@bootlin.com>2024-05-11 16:31:30 +0530
committerRichard Purdie <richard.purdie@linuxfoundation.org>2024-05-21 14:23:43 +0100
commit4cbce9cdf7d22b0b4fe933867f931019540a6663 (patch)
tree2349c9f8df3f4f020a3f2ff2a25c9336ed62723a /bitbake/bin
parent5f99010e41fc26e674d7dc6b6d9d355bc4243542 (diff)
downloadpoky-4cbce9cdf7d22b0b4fe933867f931019540a6663.tar.gz
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>
Diffstat (limited to 'bitbake/bin')
-rwxr-xr-xbitbake/bin/bitbake-prserv17
1 files changed, 15 insertions, 2 deletions
diff --git a/bitbake/bin/bitbake-prserv b/bitbake/bin/bitbake-prserv
index 920663a1d8..580e021fda 100755
--- a/bitbake/bin/bitbake-prserv
+++ b/bitbake/bin/bitbake-prserv
@@ -16,7 +16,7 @@ sys.path.insert(0, os.path.join(os.path.dirname(os.path.dirname(__file__)), "lib
16import prserv 16import prserv
17import prserv.serv 17import prserv.serv
18 18
19VERSION = "1.1.0" 19VERSION = "2.0.0"
20 20
21PRHOST_DEFAULT="0.0.0.0" 21PRHOST_DEFAULT="0.0.0.0"
22PRPORT_DEFAULT=8585 22PRPORT_DEFAULT=8585
@@ -77,12 +77,25 @@ def main():
77 action="store_true", 77 action="store_true",
78 help="open database in read-only mode", 78 help="open database in read-only mode",
79 ) 79 )
80 parser.add_argument(
81 "-u",
82 "--upstream",
83 default=os.environ.get("PRSERVER_UPSTREAM", None),
84 help="Upstream PR service (host:port)",
85 )
80 86
81 args = parser.parse_args() 87 args = parser.parse_args()
82 init_logger(os.path.abspath(args.log), args.loglevel) 88 init_logger(os.path.abspath(args.log), args.loglevel)
83 89
84 if args.start: 90 if args.start:
85 ret=prserv.serv.start_daemon(args.file, args.host, args.port, os.path.abspath(args.log), args.read_only) 91 ret=prserv.serv.start_daemon(
92 args.file,
93 args.host,
94 args.port,
95 os.path.abspath(args.log),
96 args.read_only,
97 args.upstream
98 )
86 elif args.stop: 99 elif args.stop:
87 ret=prserv.serv.stop_daemon(args.host, args.port) 100 ret=prserv.serv.stop_daemon(args.host, args.port)
88 else: 101 else: