Skip to content

Commit

Permalink
utils: fix reposync script
Browse files Browse the repository at this point in the history
CentOS Stream Copr repos started using $releasever in their repo files,
so we need to set it appropriately when mirroring the repo.
  • Loading branch information
mrc0mmand committed Sep 19, 2024
1 parent f905e1c commit afb0baa
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions utils/reposync.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@ sync_repo() {
local repo_link="${1:?}"
local repo_id="${2:?}"
local local_repo_id="${3:?}"
local release_ver="${4:?}"
local arches gpg_key_url gpg_key_name

IFS=" " read -ra arches <<<"${4:?}"
IFS=" " read -ra arches <<<"${5:?}"

rm -f repo-config.repo
curl -s -o repo-config.repo "$repo_link"
Expand All @@ -36,8 +37,9 @@ sync_repo() {
for arch in "${arches[@]}"; do
# Make a local copy of the original repository packages
dnf reposync --norepopath --newest-only --download-metadata \
--arch "${arch},noarch" --forcearch "$arch" \
--arch="${arch},noarch" --forcearch="$arch" \
--config="repo-config.repo" --repoid="$repo_id" \
--releasever="$release_ver" \
--download-path="$DOWNLOAD_LOCATION/$local_repo_id/$arch"
done

Expand All @@ -63,17 +65,17 @@ EOF
ORIGINAL_REPO="https://copr.fedorainfracloud.org/coprs/mrc0mmand/systemd-centos-ci-centos8/repo/centos-stream-8/mrc0mmand-systemd-centos-ci-centos8-centos-stream-8.repo"
ORIGINAL_REPO_ID="copr:copr.fedorainfracloud.org:mrc0mmand:systemd-centos-ci-centos8"
LOCAL_REPO_ID="mrc0mmand-systemd-centos-ci-centos8-stream8"
sync_repo "$ORIGINAL_REPO" "$ORIGINAL_REPO_ID" "$LOCAL_REPO_ID" "x86_64 aarch64 ppc64le"
sync_repo "$ORIGINAL_REPO" "$ORIGINAL_REPO_ID" "$LOCAL_REPO_ID" 8 "x86_64 aarch64 ppc64le"

# centos-9-stream
ORIGINAL_REPO="https://copr.fedorainfracloud.org/coprs/mrc0mmand/systemd-centos-ci-centos9/repo/centos-stream-9/mrc0mmand-systemd-centos-ci-centos9-centos-stream-9.repo"
ORIGINAL_REPO_ID="copr:copr.fedorainfracloud.org:mrc0mmand:systemd-centos-ci-centos9"
LOCAL_REPO_ID="mrc0mmand-systemd-centos-ci-centos9-stream9"
sync_repo "$ORIGINAL_REPO" "$ORIGINAL_REPO_ID" "$LOCAL_REPO_ID" "x86_64 aarch64 ppc64le s390x"
sync_repo "$ORIGINAL_REPO" "$ORIGINAL_REPO_ID" "$LOCAL_REPO_ID" 9 "x86_64 aarch64 ppc64le s390x"

# centos-9-stream patched kernel (temporary)
# FIXME: drop once https://issues.redhat.com/browse/RHEL-32384 is resolved
ORIGINAL_REPO="https://copr.fedorainfracloud.org/coprs/mrc0mmand/c9s-kernel-debug/repo/centos-stream-9/mrc0mmand-c9s-kernel-debug-centos-stream-9.repo"
ORIGINAL_REPO_ID="copr:copr.fedorainfracloud.org:mrc0mmand:c9s-kernel-debug"
LOCAL_REPO_ID="mrc0mmand-c9s-kernel-debug-stream9"
sync_repo "$ORIGINAL_REPO" "$ORIGINAL_REPO_ID" "$LOCAL_REPO_ID" "x86_64"
sync_repo "$ORIGINAL_REPO" "$ORIGINAL_REPO_ID" "$LOCAL_REPO_ID" 9 "x86_64"

0 comments on commit afb0baa

Please sign in to comment.