rhel sync: make sure errors go to stderr so we see them
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
This commit is contained in:
parent
9dde1370d0
commit
ff52cbd435
3 changed files with 9 additions and 8 deletions
|
@ -17,6 +17,7 @@ done
|
|||
|
||||
cd $RHEL7SYNCDIR
|
||||
|
||||
echoerr() { printf "%s\n" "$*" >&2; }
|
||||
##
|
||||
## Sync out RHEL-7 for appropriate arches
|
||||
for A in ${ARCHES}; do
|
||||
|
@ -36,14 +37,14 @@ for A in ${ARCHES}; do
|
|||
echo "Syncing ${R} for ${A}"
|
||||
dnf reposync -c ${RHEL7SYNCDIR}/${CONF} ${DNFOPTS} --repoid ${R} ${DNF_ARCH} --metadata-path ${YUMDIR}/${A}
|
||||
if [[ $? -ne 0 ]]; then
|
||||
echo "Something went wrong with reposync -c ${RHEL7SYNCDIR}/${CONF} ${DNFOPTS} --repoid ${R} ${DNF_ARCH} --metadata-path ${YUMDIR}/${A}"
|
||||
echoerr "Something went wrong with reposync -c ${RHEL7SYNCDIR}/${CONF} ${DNFOPTS} --repoid ${R} ${DNF_ARCH} --metadata-path ${YUMDIR}/${A}"
|
||||
continue
|
||||
fi
|
||||
## Try to create repo
|
||||
pushd ${RHEL7SYNCDIR}/${A}/${R} &> /dev/null
|
||||
createrepo_c -q --update --workers 6 .
|
||||
if [[ $? -ne 0 ]]; then
|
||||
echo "Something went wrong with createrepo ${A} ${R}"
|
||||
echoerr "Something went wrong with createrepo ${A} ${R}"
|
||||
continue
|
||||
fi
|
||||
popd &> /dev/null
|
||||
|
|
|
@ -11,7 +11,7 @@ DNFOPTS='--download-metadata -m --setopt=module_platform_id="platform:el8"'
|
|||
# Need to set the arches we are going to sync down
|
||||
ARCHES="aarch64 ppc64le s390x x86_64"
|
||||
|
||||
|
||||
echoerr() { printf "%s\n" "$*" >&2; }
|
||||
##
|
||||
# Do the deeds
|
||||
cd ${RHEL8SYNCDIR}
|
||||
|
@ -43,7 +43,7 @@ for A in ${ARCHES}; do
|
|||
echo "Syncing ${R} for ${A}"
|
||||
# Be verbose on errors.
|
||||
if [[ $? -ne 0 ]]; then
|
||||
echo "Something went wrong with reposync -c ${RHEL8SYNCDIR}/${CONF} --repoid ${R} -a ${A} -a noarch -p ${A}"
|
||||
echoerr "Something went wrong with reposync -c ${RHEL8SYNCDIR}/${CONF} --repoid ${R} -a ${A} -a noarch -p ${A}"
|
||||
fi
|
||||
# x86_64 is 'special' because we have to tell it for i686 also.
|
||||
if [[ ${A} == 'x86_64' ]]; then
|
||||
|
@ -52,7 +52,7 @@ for A in ${ARCHES}; do
|
|||
dnf reposync -c ${RHEL8SYNCDIR}/${CONF} ${DNFOPTS} --repoid=${R} -a ${A} -a noarch -p ${A} &> /dev/null
|
||||
fi
|
||||
if [[ $? -ne 0 ]]; then
|
||||
echo "Something went wrong with dnf reposync -c ${RHEL8SYNCDIR}/${CONF} --repoid ${R} -a ${A} -p ${A}"
|
||||
echoerr "Something went wrong with dnf reposync -c ${RHEL8SYNCDIR}/${CONF} --repoid ${R} -a ${A} -p ${A}"
|
||||
fi
|
||||
done
|
||||
done
|
||||
|
|
|
@ -11,7 +11,7 @@ DNFOPTS='--download-metadata -m --setopt=module_platform_id="platform:el9"'
|
|||
# Need to set the arches we are going to sync down
|
||||
ARCHES="aarch64 ppc64le s390x x86_64"
|
||||
|
||||
|
||||
echoerr() { printf "%s\n" "$*" >&2; }
|
||||
##
|
||||
# Do the deeds
|
||||
cd ${RHEL9SYNCDIR}
|
||||
|
@ -43,7 +43,7 @@ for A in ${ARCHES}; do
|
|||
echo "Syncing ${R} for ${A}"
|
||||
# Be verbose on errors.
|
||||
if [[ $? -ne 0 ]]; then
|
||||
echo "Something went wrong with reposync -c ${RHEL9SYNCDIR}/${CONF} --repoid ${R} -a ${A} -a noarch -p ${A}"
|
||||
echoerr "Something went wrong with reposync -c ${RHEL9SYNCDIR}/${CONF} --repoid ${R} -a ${A} -a noarch -p ${A}"
|
||||
fi
|
||||
# x86_64 is 'special' because we have to tell it for i686 also.
|
||||
if [[ ${A} == 'x86_64' ]]; then
|
||||
|
@ -52,7 +52,7 @@ for A in ${ARCHES}; do
|
|||
dnf reposync -c ${RHEL9SYNCDIR}/${CONF} ${DNFOPTS} --repoid=${R} -a ${A} -a noarch -p ${A} &> /dev/null
|
||||
fi
|
||||
if [[ $? -ne 0 ]]; then
|
||||
echo "Something went wrong with dnf reposync -c ${RHEL9SYNCDIR}/${CONF} --repoid ${R} -a ${A} -p ${A}"
|
||||
echoerr "Something went wrong with dnf reposync -c ${RHEL9SYNCDIR}/${CONF} --repoid ${R} -a ${A} -p ${A}"
|
||||
fi
|
||||
done
|
||||
done
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue