This mirrors: dd5c28916c
Changes to builddir structure in RPM 4.20 broke the old script for
patching sources. Luckily, we can now patch sources with tmt.
Gone is also list of packages needed for testing,
build dependencies will be installed by tmt instead.
Name of the gating plan was changed to remove confusion with
gating.yaml. The prepare script was also renamed to better reflect what
it does.
The prepare script should be run in prepare, but TMT_SOURCE_DIR doesn't
exist in that step yet. The workaround is to run the prepre script
before every test to allow for running all tests by itself. However, the
script can only run once because it removes pcs folder which breaks
autotools. This is done by creating a stamp file that prevents the
script from running if it already ran.
23 lines
986 B
Bash
Executable File
23 lines
986 B
Bash
Executable File
#!/bin/sh
|
|
|
|
set -eo xtrace
|
|
cd $TMT_SOURCE_DIR
|
|
# Use stamp file to abort if this script already ran
|
|
if [ -e tests-prepared-stamp ]; then exit 0; fi
|
|
# RPM 4.20 changed the builddir structure - unpacked sources go to *-build but
|
|
# tmt copies them back to pcs-*, so the pcs-*-build folder is empty
|
|
# Remove pcs-web-ui, pcs-*-build for "cd pcs-*" to have exactly one match
|
|
rm -rf pcs-web-ui-* pcs-*-build
|
|
cd pcs-*/
|
|
# Run autotools, use bundled dependencies from the system
|
|
export PYTHONPATH=/usr/lib/pcs/pcs_bundled/packages/
|
|
export GEM_HOME=/usr/lib/pcsd/vendor/bundle/
|
|
# We need to use cd pcs-* because when pcs-web-ui starts using autotools, running
|
|
# autogen and configure with expanded TMT_SOURCE_DIR will match that too
|
|
./autogen.sh
|
|
./configure --enable-local-build --enable-use-local-cache-only \
|
|
--enable-individual-bundling --enable-webui --with-pcs-lib-dir=/usr/lib
|
|
# Remove pcs sources to make sure tests are not using any of those files
|
|
rm -rf pcs
|
|
touch ../tests-prepared-stamp
|