Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .rpm-lockfiles/verify-packages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,12 @@ if [[ -n "$BRANCH" ]]; then
for comp in gateway route-agent globalnet; do
mkdir -p "$LOCKFILES_DIR/$comp"
git show "$GIT_REF:.rpm-lockfiles/$comp/rpms.in.yaml" > "$LOCKFILES_DIR/$comp/rpms.in.yaml" 2>/dev/null || continue
git show "$GIT_REF:.rpm-lockfiles/$comp/submariner-rhel-10.repo" > "$LOCKFILES_DIR/$comp/submariner-rhel-10.repo" 2>/dev/null || true

# Extract repo filename from rpms.in.yaml
repo_file=$(grep -A1 "repofiles:" "$LOCKFILES_DIR/$comp/rpms.in.yaml" | grep "^ *-" | sed 's/.*- //' | head -1)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we rely on yq here?

Suggested change
repo_file=$(grep -A1 "repofiles:" "$LOCKFILES_DIR/$comp/rpms.in.yaml" | grep "^ *-" | sed 's/.*- //' | head -1)
repo_file=$(yq '.contentOrigin.repofiles[0]' "$LOCKFILES_DIR/$comp/rpms.in.yaml")

if [[ -n "$repo_file" ]]; then
git show "$GIT_REF:.rpm-lockfiles/$comp/$repo_file" > "$LOCKFILES_DIR/$comp/$repo_file"
fi
done
echo "Verifying packages for $BRANCH"
else
Expand Down
Loading