From 0d444e5fff63dd0a101687ea0b9e4c9000c259b5 Mon Sep 17 00:00:00 2001 From: Kentaro Hayashi Date: Thu, 19 Mar 2026 13:44:24 +0900 Subject: [PATCH 1/2] Add helper script to check repodata consistency Signed-off-by: Kentaro Hayashi --- check-repository-repodata.sh | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100755 check-repository-repodata.sh diff --git a/check-repository-repodata.sh b/check-repository-repodata.sh new file mode 100755 index 0000000..253bd4b --- /dev/null +++ b/check-repository-repodata.sh @@ -0,0 +1,35 @@ +#!/usr/bin/bash + +# +# Usage: check-repository-metadata.sh VERSION PATH_TO_REPOSITORY +# +# check-repository-metadata.sh 6.0.0 ../fluent-package-release/lts/6 +# + +VERSION=$1 +REPOSITORY_DIR=$2 + +function usage() { + echo "Usage: check-repository-metadata.sh VERSION PATH_TO_REPOSITORY" +} + +if [ -z "$(command -v dnf)" ]; then + echo "ERROR: dnf command must be available" + exit 1 +fi + +if [ ! -d "$REPOSITORY_DIR" ]; then + echo "ERROR: $REPOSITORY_DIR does not exist" + usage + exit 1 +fi + +# Clean temporary files and dnf cache +rm -f *.rpm +dnf --disableplugin=system_upgrade clean all + +for path in $(find $REPOSITORY_DIR -name 'repodata'); do + relative_dir=${path%/*} + echo $relative_dir + LANG=C dnf --disableplugin=system_upgrade --releasever=$VERSION --disablerepo="*" --repofrompath wip,$relative_dir --enablerepo wip download fluent-package +done From 46071b75259527b9c29a77d7e9e0c38c8336c59b Mon Sep 17 00:00:00 2001 From: Kentaro Hayashi Date: Tue, 24 Mar 2026 14:03:48 +0900 Subject: [PATCH 2/2] Improve to specify the full package name https://github.com/fluent/fluentd.cncf.io/pull/21#issuecomment-4114900297 Signed-off-by: Kentaro Hayashi --- check-repository-repodata.sh | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/check-repository-repodata.sh b/check-repository-repodata.sh index 253bd4b..49d2ed1 100755 --- a/check-repository-repodata.sh +++ b/check-repository-repodata.sh @@ -5,6 +5,9 @@ # # check-repository-metadata.sh 6.0.0 ../fluent-package-release/lts/6 # +# Note: Requires dnf-plugins-core to be installed to use the download command +# +# dnf install dnf-plugins-core VERSION=$1 REPOSITORY_DIR=$2 @@ -31,5 +34,14 @@ dnf --disableplugin=system_upgrade clean all for path in $(find $REPOSITORY_DIR -name 'repodata'); do relative_dir=${path%/*} echo $relative_dir - LANG=C dnf --disableplugin=system_upgrade --releasever=$VERSION --disablerepo="*" --repofrompath wip,$relative_dir --enablerepo wip download fluent-package -done + rpm_file=$(find "$relative_dir" -maxdepth 1 -name "fluent-package-${VERSION}*.rpm" | head -n 1) + if [ -z "$rpm_file" ]; then + echo "Warning: No RPM file found in $relative_dir" + continue + fi + target_arch=$(basename "$relative_dir") + base_name=$(basename "$rpm_file") + pkg_name="${base_name%.${target_arch}.rpm}" + echo "Package name: ${pkg_name}" + LANG=C dnf --disableplugin=system_upgrade --releasever=$VERSION --disablerepo="*" --repofrompath wip,$relative_dir --enablerepo wip download $pkg_name +done \ No newline at end of file