Skip to content

Commit 01248d2

Browse files
authored
Replace yum-cron with dnf-automatic to support centos 8 (#2547)
Both CentOS 7 and CentOS 8 support dnf-automatic, so using that for cron update is preferred. This should enable using the same package on both systems.
1 parent ef53c00 commit 01248d2

File tree

11 files changed

+27
-51
lines changed

11 files changed

+27
-51
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/bin/bash
2+
exec /usr/bin/dnf-automatic /etc/dnf/dnf-cron-algorand.conf

installer/rpm/algorand/0yum-algorand-hourly.cron

Lines changed: 0 additions & 2 deletions
This file was deleted.

installer/rpm/algorand/algorand.spec

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ Release: 1
44
Summary: Algorand node software
55
URL: https://www.algorand.com
66
License: AGPL-3+
7-
Requires: yum-cron
7+
Requires: dnf-automatic
8+
89
Requires: systemd
910
Requires(pre): shadow-utils
1011

@@ -42,16 +43,19 @@ install -m 644 ${REPO_DIR}/installer/algorand.service %{buildroot}/lib/systemd/s
4243
install -m 644 ${REPO_DIR}/installer/algorand@.service %{buildroot}/lib/systemd/system/algorand@.service
4344

4445
mkdir -p %{buildroot}/etc/cron.hourly
45-
install -m 755 ${REPO_DIR}/installer/rpm/algorand/0yum-algorand-hourly.cron %{buildroot}/etc/cron.hourly/0yum-algorand-hourly.cron
46+
install -m 755 ${REPO_DIR}/installer/rpm/algorand/0dnf-algorand-hourly.cron %{buildroot}/etc/cron.hourly/0dnf-algorand-hourly.cron
47+
48+
49+
mkdir -p %{buildroot}/etc/dnf
50+
install -m 644 ${REPO_DIR}/installer/rpm/algorand/dnf-cron-algorand.conf %{buildroot}/etc/dnf/dnf-cron-algorand.conf
4651

47-
mkdir -p %{buildroot}/etc/yum
48-
install -m 644 ${REPO_DIR}/installer/rpm/algorand/yum-cron-algorand.conf %{buildroot}/etc/yum/yum-cron-algorand.conf
4952

5053
mkdir -p %{buildroot}/etc/pki/rpm-gpg
5154
install -m 644 ${REPO_DIR}/installer/rpm/RPM-GPG-KEY-Algorand %{buildroot}/etc/pki/rpm-gpg/RPM-GPG-KEY-Algorand
5255

53-
mkdir -p %{buildroot}/usr/lib/algorand/yum.repos.d
54-
install -m 644 ${REPO_DIR}/installer/rpm/algorand/algorand.repo %{buildroot}/usr/lib/algorand/yum.repos.d/algorand.repo
56+
mkdir -p %{buildroot}/usr/lib/algorand/dnf.repos.d
57+
install -m 644 ${REPO_DIR}/installer/rpm/algorand/algorand.repo %{buildroot}/usr/lib/algorand/dnf.repos.d/algorand.repo
58+
5559

5660
mkdir -p %{buildroot}/var/lib/algorand/genesis
5761
if [ "%{RELEASE_GENESIS_PROCESS}" != "x" ]; then
@@ -88,10 +92,11 @@ fi
8892
%endif
8993
/lib/systemd/system/algorand.service
9094
/lib/systemd/system/algorand@.service
91-
%config(noreplace) /etc/cron.hourly/0yum-algorand-hourly.cron
92-
%config(noreplace) /etc/yum/yum-cron-algorand.conf
95+
%config(noreplace) /etc/cron.hourly/0dnf-algorand-hourly.cron
96+
%config(noreplace) /etc/dnf/dnf-cron-algorand.conf
97+
9398
/etc/pki/rpm-gpg/RPM-GPG-KEY-Algorand
94-
/usr/lib/algorand/yum.repos.d/algorand.repo
99+
/usr/lib/algorand/dnf.repos.d/algorand.repo
95100

96101
%changelog
97102

installer/rpm/algorand/yum-cron-algorand.conf renamed to installer/rpm/algorand/dnf-cron-algorand.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ reposdir = /usr/lib/algorand/yum.repos.d
7272
# -4: critical
7373
# -3: critical+errors
7474
# -2: critical+errors+warnings (default)
75-
debuglevel = -2
75+
debuglevel = 2
7676

7777
# skip_broken = True
7878
mdpolicy = group:main

scripts/build_packages.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ if [ "${CHANNEL}" = "" ]; then
3333
fi
3434

3535
VARIATION_ARRAY=(${VARIATIONS})
36+
echo "Variation Array: ${VARIATION_ARRAY}"
3637

3738
# Set the TIMESTAMP to use for the genesis.json file - set here so all packages use the same number
3839
TIMESTAMP=

scripts/compute_package_name.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,14 @@
1010
CHANNEL=${1:-stable}
1111
NAME=${2:-algorand}
1212

13+
if [ ! -z ${PACKAGE_NAME_EXTENSION} ]; then
14+
NAME="${NAME}-${PACKAGE_NAME_EXTENSION}"
15+
fi
16+
1317
if [ "$CHANNEL" = beta ]; then
1418
echo "$NAME-beta"
1519
elif [ "$CHANNEL" = nightly ]; then
1620
echo "$NAME-nightly"
1721
else
1822
echo "$NAME"
1923
fi
20-

scripts/release/mule/Makefile.mule

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@ mule-docker:
4747

4848
mule-package-%: PKG_TYPE=$*
4949
mule-package-%:
50-
echo Building algorand package...
50+
echo Building algorand package $(PKG_TYPE)...
5151
scripts/release/mule/package/$(PKG_TYPE)/package.sh algorand
52-
echo Building algorand-devtools package...
52+
echo Building algorand-devtools package $(PKG_TYPE)...
5353
scripts/release/mule/package/$(PKG_TYPE)/package.sh algorand-devtools
5454

5555
mule-releases-page:

scripts/release/mule/package/rpm/package.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ find tmp/node_pkgs -name "*${CHANNEL}*linux*${VERSION}*.tar.gz" | cut -d '/' -f3
4343
INSTALLER_DIR=algorand
4444
fi
4545
trap 'rm -rf $TEMPDIR' 0
46-
< "./installer/rpm/$INSTALLER_DIR/$INSTALLER_DIR.spec" \
46+
< "./installer/rpm/$INSTALLER_DIR/$ALGORAND_PACKAGE_NAME.spec" \
4747
sed -e "s,@PKG_NAME@,$ALGORAND_PACKAGE_NAME," \
4848
-e "s,@VER@,$VERSION," \
4949
-e "s,@ARCH@,$ARCH_UNAME," \

scripts/release/mule/test/test.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ else
9393
# We need to install this since it's not being installed by a package manager.
9494
# Normally, this is installed for us b/c it's a dependency.
9595
# See `./installer/rpm/algorand/algorand.spec`.
96-
yum install yum-cron -y
96+
dnf install dnf-automatic -y
9797
#
9898
# Note that the RPM package DOES NOT have the CHANNEL in its filename (unlike DEB),
9999
# instead it contains the package name.

scripts/release/test/util/test_package.sh

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,9 @@ set -ex
77

88
. "${HOME}"/build_env
99

10-
# TODO: The following error happens on centos:8
11-
#
12-
# Error:
13-
# Problem: conflicting requests
14-
# - nothing provides yum-cron needed by algorand-2.0.4-1.x86_64
15-
# (try to add '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages)
16-
# smoke_test.sh: line 47: algod: command not found
17-
1810
OS_LIST=(
1911
centos:7
20-
# centos:8
12+
centos:8
2113
fedora:28
2214
ubuntu:16.04
2315
ubuntu:18.04

0 commit comments

Comments
 (0)