diff --git a/mangle/generators/generate_prepopulate_from_epr b/mangle/generators/generate_prepopulate_from_epr index 5e5f757..c2c4e73 100755 --- a/mangle/generators/generate_prepopulate_from_epr +++ b/mangle/generators/generate_prepopulate_from_epr @@ -9,6 +9,12 @@ else exit 1 fi +if [ -f /usr/bin/dnf4 ]; then + SAFEDNF=/usr/bin/dnf4 +else + SAFEDNF=/usr/bin/dnf +fi + export RLVER=$MAJOR source common @@ -20,7 +26,7 @@ eln_repo_url="${ELN_KOJI_REPO}/${tag_template}/latest" pushd "${tmpdir}" || { echo "Could not change directory"; exit 1; } for y in "${ARCH[@]}"; do - repodatas=( $(dnf reposync --repofrompath ${tag_template},${eln_repo_url}/${y} --download-metadata --repoid=${tag_template} -p ${tag_template}/${y} --forcearch ${y} --norepopath --remote-time --assumeyes -u | grep repodata) ) + repodatas=( $($SAFEDNF reposync --repofrompath ${tag_template},${eln_repo_url}/${y} --download-metadata --repoid=${tag_template} -p ${tag_template}/${y} --forcearch ${y} --norepopath --remote-time --assumeyes -u | grep repodata) ) mkdir -p "${tag_template}/${y}/repodata" pushd "${tag_template}/${y}/repodata" || { echo "Could not change directory"; exit 1; } for z in "${repodatas[@]}"; do diff --git a/mangle/generators/generate_prepopulate_from_kpr b/mangle/generators/generate_prepopulate_from_kpr index c1632c7..417bca2 100755 --- a/mangle/generators/generate_prepopulate_from_kpr +++ b/mangle/generators/generate_prepopulate_from_kpr @@ -9,6 +9,12 @@ else exit 1 fi +if [ -f /usr/bin/dnf4 ]; then + SAFEDNF=/usr/bin/dnf4 +else + SAFEDNF=/usr/bin/dnf +fi + export RLVER=$MAJOR source common @@ -20,7 +26,7 @@ stream_repo_url="${STREAM_KOJI_REPO}/${tag_template}/latest" pushd "${tmpdir}" || { echo "Could not change directory"; exit 1; } for y in "${ARCH[@]}"; do - repodatas=( $(dnf reposync --repofrompath ${tag_template},${stream_repo_url}/${y} --download-metadata --repoid=${tag_template} -p ${tag_template}/${y} --forcearch ${y} --norepopath --remote-time --assumeyes -u | grep repodata) ) + repodatas=( $($SAFEDNF reposync --repofrompath ${tag_template},${stream_repo_url}/${y} --download-metadata --repoid=${tag_template} -p ${tag_template}/${y} --forcearch ${y} --norepopath --remote-time --assumeyes -u | grep repodata) ) mkdir -p "${tag_template}/${y}/repodata" pushd "${tag_template}/${y}/repodata" || { echo "Could not change directory"; exit 1; } for z in "${repodatas[@]}"; do diff --git a/mangle/generators/generate_prepopulate_from_pungi b/mangle/generators/generate_prepopulate_from_pungi index fa3771d..fdd54d0 100755 --- a/mangle/generators/generate_prepopulate_from_pungi +++ b/mangle/generators/generate_prepopulate_from_pungi @@ -10,6 +10,12 @@ else exit 1 fi +if [ -f /usr/bin/dnf4 ]; then + SAFEDNF=/usr/bin/dnf4 +else + SAFEDNF=/usr/bin/dnf +fi + # Verify the date format echo "${DATE}" | grep -Eq '[0-9]+\.[0-9]' grep_val=$? diff --git a/mangle/generators/generate_prepopulate_from_pungi_latest b/mangle/generators/generate_prepopulate_from_pungi_latest index 9f84f65..4eb19c3 100755 --- a/mangle/generators/generate_prepopulate_from_pungi_latest +++ b/mangle/generators/generate_prepopulate_from_pungi_latest @@ -9,6 +9,12 @@ else exit 1 fi +if [ -f /usr/bin/dnf4 ]; then + SAFEDNF=/usr/bin/dnf4 +else + SAFEDNF=/usr/bin/dnf +fi + export RLVER=$MAJOR source common diff --git a/mangle/generators/generate_prepopulate_from_self_lh b/mangle/generators/generate_prepopulate_from_self_lh index cdb5261..d5ce968 100755 --- a/mangle/generators/generate_prepopulate_from_self_lh +++ b/mangle/generators/generate_prepopulate_from_self_lh @@ -9,6 +9,12 @@ else exit 1 fi +if [ -f /usr/bin/dnf4 ]; then + SAFEDNF=/usr/bin/dnf4 +else + SAFEDNF=/usr/bin/dnf +fi + export RLVER=$MAJOR source common @@ -21,7 +27,7 @@ stream_repo_url="https://kojidev.rockylinux.org/kojifiles/repos/${tag_template}/ pushd "${tmpdir}" || { echo "Could not change directory"; exit 1; } for y in x86_64 aarch64 i386; do - repodatas=( $(dnf reposync --repofrompath ${str_template},${stream_repo_url}/${y} --download-metadata --repoid=${str_template} -p ${str_template}/${y} --forcearch ${y} --norepopath --remote-time --assumeyes -u | grep repodata) ) + repodatas=( $($SAFEDNF reposync --repofrompath ${str_template},${stream_repo_url}/${y} --download-metadata --repoid=${str_template} -p ${str_template}/${y} --forcearch ${y} --norepopath --remote-time --assumeyes -u | grep repodata) ) mkdir -p "${str_template}/${y}/repodata" pushd "${str_template}/${y}/repodata" || { echo "Could not change directory"; exit 1; } for z in "${repodatas[@]}"; do diff --git a/mangle/generators/generate_prepopulate_from_stream b/mangle/generators/generate_prepopulate_from_stream index f734912..22eb3ac 100755 --- a/mangle/generators/generate_prepopulate_from_stream +++ b/mangle/generators/generate_prepopulate_from_stream @@ -10,6 +10,12 @@ else exit 1 fi +if [ -f /usr/bin/dnf4 ]; then + SAFEDNF=/usr/bin/dnf4 +else + SAFEDNF=/usr/bin/dnf +fi + # Verify the date format echo "${DATE}" | grep -Eq '[0-9]+\.[0-9]' grep_val=$? @@ -31,7 +37,7 @@ pushd "${tmpdir}" || { echo "Could not change directory"; exit 1; } for x in "${REPO[@]}"; do echo "Working on ${x}" for y in "${ARCH[@]}"; do - repodatas=( $(dnf reposync --repofrompath ${x},${stream_compose_url}/${x}/${y}/os --download-metadata --repoid=${x} -p ${x}/${y} --forcearch ${y} --norepopath --remote-time --assumeyes -u | grep repodata) ) + repodatas=( $($SAFEDNF reposync --repofrompath ${x},${stream_compose_url}/${x}/${y}/os --download-metadata --repoid=${x} -p ${x}/${y} --forcearch ${y} --norepopath --remote-time --assumeyes -u | grep repodata) ) mkdir -p "${x}/${y}/repodata" pushd "${x}/${y}/repodata" || { echo "Could not change directory"; exit 1; } for z in "${repodatas[@]}"; do diff --git a/mangle/generators/generate_prepopulate_from_stream_10 b/mangle/generators/generate_prepopulate_from_stream_10 index ed3e933..f3bcab3 100755 --- a/mangle/generators/generate_prepopulate_from_stream_10 +++ b/mangle/generators/generate_prepopulate_from_stream_10 @@ -10,6 +10,12 @@ else exit 1 fi +if [ -f /usr/bin/dnf4 ]; then + SAFEDNF=/usr/bin/dnf4 +else + SAFEDNF=/usr/bin/dnf +fi + # Verify the date format echo "${DATE}" | grep -Eq '[0-9]+\.[0-9]' grep_val=$? @@ -27,11 +33,17 @@ current=$(pwd) tmpdir=$(mktemp -d) stream_compose_url="https://composes.stream.centos.org/stream-${MAJOR}/production/CentOS-Stream-${MAJOR}-${DATE}/compose" +if [ -f /usr/bin/dnf4 ]; then + SAFEDNF=/usr/bin/dnf4 +else + SAFEDNF=/usr/bin/dnf +fi + pushd "${tmpdir}" || { echo "Could not change directory"; exit 1; } for x in "${REPO[@]}"; do echo "Working on ${x}" for y in "${ARCH[@]}"; do - repodatas=( $(dnf reposync --repofrompath ${x},${stream_compose_url}/${x}/${y}/os --download-metadata --repoid=${x} -p ${x}/${y} --forcearch ${y} --norepopath --remote-time --assumeyes -u | grep repodata) ) + repodatas=( $($SAFEDNF reposync --repofrompath ${x},${stream_compose_url}/${x}/${y}/os --download-metadata --repoid=${x} -p ${x}/${y} --forcearch ${y} --norepopath --remote-time --assumeyes -u | grep repodata) ) mkdir -p "${x}/${y}/repodata" pushd "${x}/${y}/repodata" || { echo "Could not change directory"; exit 1; } for z in "${repodatas[@]}"; do diff --git a/mangle/generators/generate_versions_from_kpr b/mangle/generators/generate_versions_from_kpr index 25d45bc..537771c 100755 --- a/mangle/generators/generate_versions_from_kpr +++ b/mangle/generators/generate_versions_from_kpr @@ -20,7 +20,7 @@ stream_repo_url="${STREAM_KOJI_REPO}/${tag_template}/latest" pushd "${tmpdir}" || { echo "Could not change directory"; exit 1; } for y in "${ARCH[@]}"; do - repodatas=( $(dnf reposync --repofrompath ${tag_template},${stream_repo_url}/${y} --download-metadata --repoid=${tag_template} -p ${tag_template}/${y} --forcearch ${y} --norepopath --remote-time --assumeyes -u | grep repodata) ) + repodatas=( $($SAFEDNF reposync --repofrompath ${tag_template},${stream_repo_url}/${y} --download-metadata --repoid=${tag_template} -p ${tag_template}/${y} --forcearch ${y} --norepopath --remote-time --assumeyes -u | grep repodata) ) mkdir -p "${tag_template}/${y}/repodata" pushd "${tag_template}/${y}/repodata" || { echo "Could not change directory"; exit 1; } for z in "${repodatas[@]}"; do diff --git a/mangle/generators/generate_versions_from_ppr b/mangle/generators/generate_versions_from_ppr index 2394940..bf0f419 100755 --- a/mangle/generators/generate_versions_from_ppr +++ b/mangle/generators/generate_versions_from_ppr @@ -24,7 +24,7 @@ peridot_repo_url="${PERIDOT_REPO}/${PERIDOT_PROJECT_ID}/repo/${tag_template}" pushd "${tmpdir}" || { echo "Could not change directory"; exit 1; } for y in "${ARCH[@]}"; do - repodatas=( $(dnf reposync --repofrompath ${tag_template},${peridot_repo_url}/${y} --download-metadata --repoid=${tag_template} -p ${tag_template}/${y} --forcearch ${y} --norepopath --remote-time --assumeyes -u | grep repodata) ) + repodatas=( $($SAFEDNF reposync --repofrompath ${tag_template},${peridot_repo_url}/${y} --download-metadata --repoid=${tag_template} -p ${tag_template}/${y} --forcearch ${y} --norepopath --remote-time --assumeyes -u | grep repodata) ) mkdir -p "${tag_template}/${y}/repodata" pushd "${tag_template}/${y}/repodata" || { echo "Could not change directory"; exit 1; } for z in "${repodatas[@]}"; do diff --git a/mangle/generators/generate_versions_from_stream b/mangle/generators/generate_versions_from_stream index 318237a..aa162f6 100755 --- a/mangle/generators/generate_versions_from_stream +++ b/mangle/generators/generate_versions_from_stream @@ -30,7 +30,7 @@ pushd "${tmpdir}" || { echo "Could not change directory"; exit 1; } for x in "${REPO[@]}"; do echo "Working on ${x}" for y in "${ARCH[@]}"; do - repodatas=( $(dnf reposync --repofrompath ${x},${stream_compose_url}/${x}/${y}/os --download-metadata --repoid=${x} -p ${x}/${y} --forcearch ${y} --norepopath --remote-time --assumeyes -u | grep repodata) ) + repodatas=( $($SAFEDNF reposync --repofrompath ${x},${stream_compose_url}/${x}/${y}/os --download-metadata --repoid=${x} -p ${x}/${y} --forcearch ${y} --norepopath --remote-time --assumeyes -u | grep repodata) ) mkdir -p "${x}/${y}/repodata" pushd "${x}/${y}/repodata" || { echo "Could not change directory"; exit 1; } for z in "${repodatas[@]}"; do diff --git a/mangle/generators/generate_versions_from_stream_10 b/mangle/generators/generate_versions_from_stream_10 index 92e7d5a..f8983ef 100755 --- a/mangle/generators/generate_versions_from_stream_10 +++ b/mangle/generators/generate_versions_from_stream_10 @@ -31,7 +31,7 @@ pushd "${tmpdir}" || { echo "Could not change directory"; exit 1; } for x in "${REPO[@]}"; do echo "Working on ${x}" for y in "${ARCH[@]}"; do - repodatas=( $(dnf reposync --repofrompath ${x},${stream_compose_url}/${x}/${y}/os --download-metadata --repoid=${x} -p ${x}/${y} --forcearch ${y} --norepopath --remote-time --assumeyes -u | grep repodata) ) + repodatas=( $($SAFEDNF reposync --repofrompath ${x},${stream_compose_url}/${x}/${y}/os --download-metadata --repoid=${x} -p ${x}/${y} --forcearch ${y} --norepopath --remote-time --assumeyes -u | grep repodata) ) mkdir -p "${x}/${y}/repodata" pushd "${x}/${y}/repodata" || { echo "Could not change directory"; exit 1; } for z in "${repodatas[@]}"; do