Handle RPM 4.20 build directory change

RPM 4.20 adds another level to the build directory path, see
https://github.com/rpm-software-management/rpm/issues/3147 .
This tries to handle it.

Signed-off-by: Adam Williamson <awilliam@redhat.com>
This commit is contained in:
Adam Williamson 2024-08-01 09:36:55 -07:00
commit a893d9ada9

View file

@ -58,15 +58,22 @@ rlJournalStart
rlRun "su -c 'rpmbuild -D \"_topdir $TmpDir\" -bp $TmpDir/SPECS/*.spec &>$TmpDir/rpmbuild.log' $BUILD_USER"
rlRun "rlFileSubmit $TmpDir/rpmbuild.log"
rlRun "toplev_dirname=`awk '/toplev_dirname/{print $3; exit}' $TmpDir/rpmbuild.log`"
rlRun "cd $TmpDir/BUILD/$toplev_dirname"
cd $TmpDir/BUILD/$toplev_dirname
if [ $? -ne 0 ]; then
# handle rpm 4.20 build directory difference
# https://github.com/rpm-software-management/rpm/issues/3147
rlRun "cd $TmpDir/BUILD/*-build/$toplev_dirname"
fi
# now we know the top-level build dir, keep it for later
rlRun "BuildDir=$(pwd)"
rlRun "su -c './bootstrap.sh &>$TmpDir/bootstrap.log' $BUILD_USER"
rlRun "rlFileSubmit $TmpDir/bootstrap.log"
rlPhaseEnd
rlPhaseStartTest "run testsuite"
while read test_path; do
if [ -f $TmpDir/BUILD/boost*/libs/$test_path/test/Jamfile* ]; then
rlRun "cd $TmpDir/BUILD/$toplev_dirname/libs/$test_path/test"
if [ -f $BuildDir/libs/$test_path/test/Jamfile* ]; then
rlRun "cd $BuildDir/libs/$test_path/test"
rlRun "su -c '/usr/bin/b2 -d1 --build-dir=$TmpDir/test-build &>>$TmpDir/testsuite.log' $BUILD_USER"
rm -fr $TmpDir/test-build
else