Skip to content

Commit

Permalink
Build script:
Browse files Browse the repository at this point in the history
* Use sudo with CentOS versions repo editing to make the logic consistent.
* Set make concurrency equal to the number of logical CPUs on MacOS X.
  • Loading branch information
mikeov committed Jul 4, 2024
1 parent 185ef12 commit 1173366
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions travis/script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -239,19 +239,19 @@ build_centos()
{
if [ x"$1" = x'5' ]; then
# Centos 5 EOL, use vault for now.
sed -i 's/enabled=1/enabled=0/' \
$MYSUDO sed -i 's/enabled=1/enabled=0/' \
/etc/yum/pluginconf.d/fastestmirror.conf
sed -i 's/mirrorlist/#mirrorlist/' \
$MYSUDO sed -i 's/mirrorlist/#mirrorlist/' \
/etc/yum.repos.d/*.repo
sed -i 's/#\(baseurl.*\)mirror.centos.org\/centos\/\$releasever\//\1vault.centos.org\/5.11\//' \
$MYSUDO sed -i 's/#\(baseurl.*\)mirror.centos.org\/centos\/\$releasever\//\1vault.centos.org\/5.11\//' \
/etc/yum.repos.d/*.repo
elif [ x"$1" = x'6' ]; then
# Centos 6 EOL, use vault for now.
sed -i 's/enabled=1/enabled=0/' \
$MYSUDO sed -i 's/enabled=1/enabled=0/' \
/etc/yum/pluginconf.d/fastestmirror.conf
sed -i 's/mirrorlist/#mirrorlist/' \
$MYSUDO sed -i 's/mirrorlist/#mirrorlist/' \
/etc/yum.repos.d/*.repo
sed -i 's/#\(baseurl.*\)mirror.centos.org\/centos\/\$releasever\//\1vault.centos.org\/6.10\//' \
$MYSUDO sed -i 's/#\(baseurl.*\)mirror.centos.org\/centos\/\$releasever\//\1vault.centos.org\/6.10\//' \
/etc/yum.repos.d/*.repo
elif [ x"$1" = x'7' ]; then
# Centos 7 EOL, use vault for now.
Expand Down Expand Up @@ -407,7 +407,9 @@ elif [ x"$BUILD_OS_NAME" = x'osx' ]; then
make rat clean
sysctl machdep.cpu || true
df -h || true
do_build -j 2
cpu_count=$(sysctl -n hw.ncpu)
expr "$cpu_count" : '^[0-9]*$' > /dev/null || cpu_count=2
do_build -j "$cpu_count"
else
echo "OS: $BUILD_OS_NAME not yet supported"
exit 1
Expand Down

0 comments on commit 1173366

Please sign in to comment.