rpm-ostree/ci/libbuild.sh
Jonathan Lebon 48ddca9280 ci: workaround broken fedora:26 image
This is essentially the same workaround as
https://github.com/ostreedev/ostree/pull/1143.

See https://bugzilla.redhat.com/show_bug.cgi?id=1483553.

Closes: #975
Approved by: cgwalters
2017-09-07 12:27:54 +00:00

53 lines
1.0 KiB
Bash

#!/usr/bin/bash
pkg_upgrade() {
# https://bugzilla.redhat.com/show_bug.cgi?id=1483553
if ! yum -y upgrade 2>err.txt; then
ecode=$?
if grep -q -F -e "BDB1539 Build signature doesn't match environment" err.txt; then
rpm --rebuilddb
yum -y upgrade
else
cat err.txt
exit ${ecode}
fi
fi
}
pkg_install() {
yum -y install "$@"
}
make() {
/usr/bin/make -j $(getconf _NPROCESSORS_ONLN) "$@"
}
build() {
env NOCONFIGURE=1 ./autogen.sh
./configure --prefix=/usr --libdir=/usr/lib64 "$@"
make
}
build_default() {
export CFLAGS="${CFLAGS:-} -fsanitize=undefined"
build
}
install_builddeps() {
pkg=$1
if [ -x /usr/bin/dnf ]; then
dnf -y install dnf-plugins-core
dnf install -y @buildsys-build
dnf install -y 'dnf-command(builddep)'
dnf builddep -y $pkg
else
yum install -y make rpm-build
yum-builddep -y rpm-ostree
fi
# builddeps+runtime deps
yum install -y $pkg
rpm -e $pkg
}