Skip to content

Commit f36a90d

Browse files
Introduce buildflag nochecks
To disable all checks (%check section in rpm). This can be overwritten by --no-checks or new --checks option on CLI.
1 parent 6cc8526 commit f36a90d

File tree

6 files changed

+26
-2
lines changed

6 files changed

+26
-2
lines changed

PBuild/Job.pm

+1
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,7 @@ sub createjob {
313313
}
314314

315315
push @args, '--clean' unless $opts->{'noclean'};
316+
push @args, '--checks' if $opts->{'checks'};
316317
push @args, '--nochecks' if $opts->{'nochecks'};
317318
push @args, '--shell' if $opts->{'shell'};
318319
push @args, '--shell-after-fail' if $opts->{'shell-after-fail'};

PBuild/Options.pm

+1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ my $pbuild_options = {
3333
'reponame' => ':',
3434
'noclean' => '',
3535
'no-clean' => 'noclean',
36+
'checks' => '',
3637
'nochecks' => '',
3738
'no-checks' => 'nochecks',
3839
'arch' => ':',

build

+6-2
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ BUILD_OPTIONS_PARSED=
7272
DO_INIT=true
7373
DO_INIT_TOPDIR=true
7474
DO_LINT=
75-
DO_CHECKS=true
75+
DO_CHECKS=
7676
CLEAN_BUILD=
7777
GENBUILDREQS_CLEAN_BUILD=
7878
RECIPEFILES=()
@@ -1065,6 +1065,9 @@ while test -n "$1"; do
10651065
test "$DO_INIT" = false && DO_INIT_TOPDIR=false
10661066
DO_INIT=false
10671067
;;
1068+
-checks)
1069+
DO_CHECKS=true # default, but to overwrite possible config setting
1070+
;;
10681071
-nochecks|-no-checks)
10691072
DO_CHECKS=false
10701073
;;
@@ -1377,7 +1380,6 @@ test "$CONFIG_DIR" != "$BUILD_DIR/configs" && validate_param "--configdir" "$CON
13771380
# validate the buildroot
13781381
validate_buildroot "$BUILD_ROOT"
13791382

1380-
13811383
if test -n "$VM_TYPE" -a -z "$RUNNING_IN_VM" ; then
13821384
vm_verify_options
13831385
vm_set_defaults
@@ -1416,6 +1418,8 @@ if test -n "$SEND_SYSRQ" ; then
14161418
cleanup_and_exit
14171419
fi
14181420

1421+
recipe_checks_config
1422+
14191423
# done option parsing
14201424
BUILD_OPTIONS_PARSED=true
14211425

build-recipe

+10
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,16 @@ recipe_build_time_statistics() {
312312
fi
313313
}
314314

315+
recipe_checks_config() {
316+
if test -z "$DO_CHECKS"; then
317+
local nochecks=$(queryconfig \
318+
--dist "$BUILD_DIST" --configdir "$CONFIG_DIR" \
319+
--archpath "$BUILD_ARCH" buildflags nochecks
320+
)
321+
test -n "$nochecks" && DO_CHECKS=false || DO_CHECKS=true
322+
fi
323+
}
324+
315325
recipe_gendiff() {
316326
local obsgendiff=$(queryconfig \
317327
--dist "$BUILD_DIST" --configdir "$CONFIG_DIR" \

build.1

+6
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,12 @@ A shell script used to generate a Collax binary package.
6161
.B --clean
6262
Remove the build system and reinitialize it from scratch.
6363
.TP
64+
.B --checks
65+
Run checks during build (default).
66+
.TP
67+
.B --no-checks
68+
Don't run checks during build.
69+
.TP
6470
.B --no-init
6571
Skip the build system initialization and start with build immediately.
6672
.TP

pbuild.1

+2
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,8 @@ the package.
111111
.TP
112112
.B "\-\-xen, \-\-kvm, ..."
113113
.TP
114+
.B "\-\-checks"
115+
.TP
114116
.B "\-\-no-checks"
115117
.TP
116118
.B "\-\-no-clean"

0 commit comments

Comments
 (0)