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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Marko Lemmetty <marko.lemmetty@jollamobile.com>
Date: Fri, 15 May 2020 15:04:41 +0300
Subject: [PATCH] Add support for --rebuild and --chroot-only in build.
--rebuild sends --skip-prep to build and rpm to skip the %prep phase. This is
useful in conjunction with the --rsync* options to enable rapid rebuilds in
the clean rpmbuild environment.
--chroot-only creates a chroot without doing a build - this can be used to
build scratchbox2 targets
---
osc/build.py | 7 +++++++
osc/commandline.py | 4 ++++
2 files changed, 11 insertions(+)
diff --git a/osc/build.py b/osc/build.py
index 0547fa9459abf169e616325fbc0c550c2d41d111..bc264d31f8a33eb962b76c9148217b80f789803d 100644
--- a/osc/build.py
+++ b/osc/build.py
@@ -810,6 +810,13 @@ def main(apiurl, store, opts, argv):
buildargs.append('--clean')
if opts.checks:
buildargs.append('--checks')
+ if opts.rebuild:
+ if not opts.rsyncsrc or not opts.rsyncdest:
+ print('Warning: --rebuild option is usually used with both --rsync-src and --rsync-dest',
+ file=sys.stderr)
+ buildargs.append('--skip-prep')
+ if opts.chroot_only:
+ buildargs.append('--chroot-only')
if opts.nochecks:
buildargs.append('--no-checks')
if not opts.no_changelog:
diff --git a/osc/commandline.py b/osc/commandline.py
index 9469532416b8562936f12afa27e2f8d33fb5aa40..eb5cf45c6b605874f0ac512c0e62a13fee17dc5e 100644
--- a/osc/commandline.py
+++ b/osc/commandline.py
@@ -7013,6 +7013,10 @@ Please submit there instead, or use --nodevelproject to force direct submission.
help='Skip initialization of build root and start with build immediately.')
@cmdln.option('--checks', action='store_true',
help='Run checks even if disabled in the build config')
+ @cmdln.option('--rebuild', action='store_true',
+ help='During build, skip the %%prep and %%clean phases; requires --rsync options')
+ @cmdln.option('--chroot-only', action='store_true',
+ help='Only initialise build root and skip build.')
@cmdln.option('--nochecks', '--no-checks', action='store_true',
help='Do not run build checks on the resulting packages.')
@cmdln.option('--no-verify', '--noverify', action='store_true',
|