Make sure we test the correct SRPM
rlFetchSrcForInstalled is very resourceful and I'm afraid it may find and download a SRPM of the matching NVR from other sources, not necessarily the same we want to test. Since we know the CI tests a scratch build hosted in a local repo called "test-artifacts" then using "dnf download" directly and limited to that specific repo is a better approach. I'm adding a fallback using the repo's local files just in case "dnf" suffers some temporary hiccup.
This commit is contained in:
parent
461c56c6ec
commit
3523d0b26a
@ -33,12 +33,13 @@ PACKAGE="nasm"
|
||||
rlJournalStart
|
||||
rlPhaseStartSetup
|
||||
rlAssertRpm $PACKAGE
|
||||
rlRun "NVR=$(rpm -q --qf='%{NAME}-%{VERSION}-%{RELEASE}' $PACKAGE)"
|
||||
rlRun "TMP=\$(mktemp -p $HOME -d)"
|
||||
rlRun "pushd $TMP"
|
||||
|
||||
rlFetchSrcForInstalled $PACKAGE
|
||||
rlRun "dnf builddep -y *src.rpm --nobest"
|
||||
rlRun "rpm --define='_topdir $TMP' -Uvh *src.rpm"
|
||||
rlRun "dnf download --disablerepo='*' --enablerepo=test-artifacts --source $NVR || cp /var/share/test-artifacts/$NVR.src.rpm ."
|
||||
rlRun "dnf builddep -y $NVR.src.rpm --nobest"
|
||||
rlRun "rpm --define='_topdir $TMP' -Uvh $NVR.src.rpm"
|
||||
rlRun "rpmbuild --define='_topdir $TMP' -bc SPECS/nasm.spec"
|
||||
rlPhaseEnd
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user