Replies: 1 comment 1 reply
-
Sorry Actual behaviour is different. Result with defined %bcond_with%bcond_with check
Summary: bcond test
Name: test
Version: 1
Release: 1
License: foo
%description
bcond test.
%prep
# Add handle --{with|without} check
%define __spec_check_pre \
%{!?with_check:echo "%%check disabled."; exit 0} \
%{___build_pre}
%check
echo "%{name} package test suite"
exit 1
%files [tkloczko@pers-jacek SPECS]$ rpmbuild -bi test.spec
warning: source_date_epoch_from_changelog set but %changelog is missing
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.4hXN9D
+ umask 022
+ cd /home/tkloczko/rpmbuild/BUILD
+ RPM_EC=0
++ jobs -p
+ exit 0
Executing(%check): /bin/sh -e /var/tmp/rpm-tmp.XMbSqT
%check disabled.
Processing files: test-1-1.x86_64
Checking for unpackaged file(s): /usr/lib/rpm/check-files /home/tkloczko/rpmbuild/BUILDROOT/test-1-1.x86_64 Which is as expected Result with defined %bcondout_with%bcond_without check
Summary: bcond test
Name: test
Version: 1
Release: 1
License: foo
%description
bcond test.
%prep
# Add handle --{with|without} check
%define __spec_check_pre \
%{!?with_check:echo "%%check disabled."; exit 0} \
%{___build_pre}
%check
echo "%{name} package test suite"
exit 1
%files [tkloczko@pers-jacek SPECS]$ rpmbuild -bi test.spec
warning: source_date_epoch_from_changelog set but %changelog is missing
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.wJqF1l
+ umask 022
+ cd /home/tkloczko/rpmbuild/BUILD
+ RPM_EC=0
++ jobs -p
+ exit 0
Executing(%check): /bin/sh -e /var/tmp/rpm-tmp.pKu6HS
+ umask 022
+ cd /home/tkloczko/rpmbuild/BUILD
+ echo 'test package test suite'
test package test suite
+ exit 1
error: Bad exit status from /var/tmp/rpm-tmp.pKu6HS (%check) Which is as expected as well. Result without defined bcondSummary: bcond test
Name: test
Version: 1
Release: 1
License: foo
%description
bcond test.
%prep
# Add handle --{with|without} check
%define __spec_check_pre \
%{!?with_check:echo "%%check disabled."; exit 0} \
%{___build_pre}
%check
echo "%{name} package test suite"
exit 1
%files [tkloczko@pers-jacek SPECS]$ rpmbuild -bi test.spec
warning: source_date_epoch_from_changelog set but %changelog is missing
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.KZbK71
+ umask 022
+ cd /home/tkloczko/rpmbuild/BUILD
+ RPM_EC=0
++ jobs -p
+ exit 0
Executing(%check): /bin/sh -e /var/tmp/rpm-tmp.6PTPuy
%check disabled.
Processing files: test-1-1.x86_64
Checking for unpackaged file(s): /usr/lib/rpm/check-files /home/tkloczko/rpmbuild/BUILDROOT/test-1-1.x86_64 Incorrect result because without define In other words it is not issue with %__spec_check_pre redefinition but above approach with globally redefines %__spec_check_pre does not work as expected (which is not rpm issue). Q: how to modify above to have expected behaviour? 🤔 |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Describe the bug
in #316 (comment) I wrote that I'm using +3 years solution which allows me to disable %check execution by use
%bcond_with check
.What I'm using is not exactly what I've proposed in next comment.
What I'm using is purely spec files solution by add in spec file like below
What wrote in the in #316 was based on below test case:
However when I've moved
%__spec_check_pre
definition to macros.check fileand started testing spec file like below
Result is not the same:
Looks like it is not possible to evaluate in bcond macros from global macros or that evaluation needs to be added differently.
Q: what I'm doing incorrectly and/or how to eval
%with_chec
from global macros? 🤔Beta Was this translation helpful? Give feedback.
All reactions