Skip to content

Commit 284fce2

Browse files
committed
ci: extract setup rpmrebuild and fix rebuild (fluent#827)
RpmUnpack implementation was changed from rpm2cpio to rpm2archive, but it can't rebuild RPM because it handles outcome of rpm2archive wrongly. It will be fixed in rpmrebuild 2.21. See rpmrebuild 2.20: rpm2archive called with incorrect arguments https://sourceforge.net/p/rpmrebuild/bugs/18/ Signed-off-by: Kentaro Hayashi <hayashi@clear-code.com>
1 parent e81c4fa commit 284fce2

File tree

5 files changed

+35
-64
lines changed

5 files changed

+35
-64
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
case $distribution in
2+
amazon)
3+
case $version in
4+
2023)
5+
curl -L -o rpmrebuild.noarch.rpm https://sourceforge.net/projects/rpmrebuild/files/latest/download
6+
sudo $DNF install -y ./rpmrebuild.noarch.rpm
7+
;;
8+
2)
9+
sudo amazon-linux-extras install -y epel
10+
sudo $DNF install -y rpmrebuild
11+
;;
12+
esac
13+
;;
14+
*)
15+
sudo $DNF install -y epel-release
16+
sudo $DNF install -y rpmrebuild
17+
# hotfix for rpmrebuild 2.20 bug
18+
# See https://sourceforge.net/p/rpmrebuild/bugs/18/
19+
pkg_version=$(rpm -q rpmrebuild)
20+
case $pkg_version in
21+
rpmrebuild-2.20*)
22+
curl -LO https://sourceforge.net/p/rpmrebuild/bugs/18/attachment/rpmrebuild-2.20-rpm2archive-bug.patch
23+
hotfix=$(realpath rpmrebuild-2.20-rpm2archive-bug.patch)
24+
(cd /usr/lib/rpmrebuild && sudo patch -p2 < $hotfix)
25+
;;
26+
esac
27+
;;
28+
esac

fluent-package/yum/systemd-test/update-to-next-version-service-status.sh

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -27,24 +27,8 @@ fi
2727
main_pid=$(eval $(systemctl show fluentd --property=MainPID) && echo $MainPID)
2828

2929
# Make a dummy pacakge for the next version
30-
case $distribution in
31-
amazon)
32-
case $version in
33-
2023)
34-
curl -L -o rpmrebuild.noarch.rpm https://sourceforge.net/projects/rpmrebuild/files/latest/download
35-
sudo $DNF install -y ./rpmrebuild.noarch.rpm
36-
;;
37-
2)
38-
sudo amazon-linux-extras install -y epel
39-
sudo $DNF install -y rpmrebuild
40-
;;
41-
esac
42-
;;
43-
*)
44-
sudo $DNF install -y epel-release
45-
sudo $DNF install -y rpmrebuild
46-
;;
47-
esac
30+
. $(dirname $0)/setup-rpmrebuild.sh
31+
4832
# Example: "1.el9"
4933
release=$(rpmquery --queryformat="%{Release}" -p $package)
5034
# Example: "1"

fluent-package/yum/systemd-test/update-to-next-version-with-auto-and-manual.sh

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7,25 +7,7 @@ set -exu
77
package="/host/${distribution}/${DISTRIBUTION_VERSION}/x86_64/Packages/fluent-package-[0-9]*.rpm"
88

99
# Make a dummy pacakge for the next version
10-
case $distribution in
11-
amazon)
12-
case $version in
13-
2023)
14-
curl -L -o rpmrebuild.noarch.rpm https://sourceforge.net/projects/rpmrebuild/files/latest/download
15-
sudo $DNF install -y ./rpmrebuild.noarch.rpm
16-
;;
17-
2)
18-
sudo amazon-linux-extras install -y epel
19-
sudo $DNF install -y rpmrebuild
20-
;;
21-
esac
22-
;;
23-
*)
24-
sudo $DNF install -y epel-release
25-
sudo $DNF install -y rpmrebuild
26-
;;
27-
esac
28-
10+
. $(dirname $0)/setup-rpmrebuild.sh
2911

3012
# Example: "1.el9"
3113
release=$(rpmquery --queryformat="%{Release}" -p $package)

fluent-package/yum/systemd-test/update-to-next-version-with-backward-compat-for-v4.sh

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,8 @@ sudo systemctl enable fluentd # Enable the unit name alias
3838
systemctl status --no-pager td-agent
3939

4040
# Make a dummy pacakge for the next version
41-
case $distribution in
42-
amazon)
43-
sudo amazon-linux-extras install -y epel
44-
;;
45-
*)
46-
sudo $DNF install -y epel-release
47-
;;
48-
esac
49-
sudo $DNF install -y rpmrebuild
41+
. $(dirname $0)/setup-rpmrebuild.sh
42+
5043
# Example: "1.el9"
5144
release=$(rpmquery --queryformat="%{Release}" -p $package)
5245
# Example: "1"

fluent-package/yum/systemd-test/update-to-next-version.sh

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -11,24 +11,8 @@ sudo systemctl enable --now fluentd
1111
systemctl status --no-pager fluentd
1212

1313
# Make a dummy pacakge for the next version
14-
case $distribution in
15-
amazon)
16-
case $version in
17-
2023)
18-
curl -L -o rpmrebuild.noarch.rpm https://sourceforge.net/projects/rpmrebuild/files/latest/download
19-
sudo $DNF install -y ./rpmrebuild.noarch.rpm
20-
;;
21-
2)
22-
sudo amazon-linux-extras install -y epel
23-
sudo $DNF install -y rpmrebuild
24-
;;
25-
esac
26-
;;
27-
*)
28-
sudo $DNF install -y epel-release
29-
sudo $DNF install -y rpmrebuild
30-
;;
31-
esac
14+
. $(dirname $0)/setup-rpmrebuild.sh
15+
3216
# Example: "1.el9"
3317
release=$(rpmquery --queryformat="%{Release}" -p $package)
3418
# Example: "1"

0 commit comments

Comments
 (0)