diff --git a/reposync/runreposync.sh b/reposync/runreposync.sh index 51d4e5b2a541297f6d2272128c3022d743c064f4..417f4f171dfdc2e19660fc7411356830dacb0bed 100755 --- a/reposync/runreposync.sh +++ b/reposync/runreposync.sh @@ -19,23 +19,21 @@ error () { EOF } +echo "Inputs: REPOID=\"$REPOID\" REPOFILE=\"$REPOFILE\" REPOPATH=\"$REPOPATH\" CHECKSUM=\"$CHECKSUM\" RUN_REPOSYNC=\"$RUN_REPOSYNC\" RUN_CREATEREPO=\"$RUN_CREATEREPO\"" + echo "[${REPOID}]" > /etc/yum.repos.d/sync.repo echo $REPOFILE | base64 -d >> /etc/yum.repos.d/sync.repo REPOPATH="/repo/${REPOPATH}" -set -x - # Create REPOPATH even if the repo is empty [ ! -d $REPOPATH ] && /bin/mkdir -p ${REPOPATH} if [[ $RUN_REPOSYNC -eq 1 ]]; then - set +x # Record what's already there first PRECOUNT=`/usr/bin/find ${REPOPATH} -type f -name "*.rpm" ! -size 0 | /usr/bin/wc -l` PRELIST=`/usr/bin/find ${REPOPATH} -type f -name "*.rpm" ! -size 0 -exec /bin/basename {} \;` PRESIZE=`/usr/bin/du -bc Packages/*rpm *rpm source/SRPMS/*rpm source/SRPMS/Packages/*rpm 2>/dev/null | /usr/bin/tail -1 | /bin/sed "s/\stotal//g"` - set -x # Run reposync /usr/bin/reposync \ @@ -66,7 +64,6 @@ EOF # Remove 0 byte RPMs /usr/bin/find ${REPOPATH} -type f -size 0b -name "*.rpm" -exec rm -v {} \; - set +x # Now let's look at the new stuff POSTCOUNT=`/usr/bin/find ${REPOPATH} -type f -name "*.rpm" ! -size 0 | /usr/bin/wc -l` POSTLIST=`/usr/bin/find ${REPOPATH} -type f -name "*.rpm" ! -size 0 -exec /bin/basename {} \;` @@ -74,7 +71,6 @@ EOF # these are 'useable' but since the size changes, metadata must be regenerated to # take it into account. POSTSIZE=`/usr/bin/du -bc Packages/*rpm *rpm source/SRPMS/*rpm source/SRPMS/Packages/*rpm 2>/dev/null | /usr/bin/tail -1 | /bin/sed "s/\stotal//g"` - set -x fi if [[ ($PRECOUNT -eq $POSTCOUNT) && ($PRESIZE -ne $POSTSIZE) ]]; then @@ -84,9 +80,7 @@ EOF fi if [[ ($PRECOUNT -ne $POSTCOUNT) || ($PRESIZE -ne $POSTSIZE) ]]; then - set +x CHANGELIST=`/usr/bin/diff --changed-group-format='%>' --unchanged-group-format='' <(echo "$PRELIST") <(echo "$POSTLIST")` - set -x # Run createrepo if [[ $RUN_CREATEREPO -eq 1 ]]; then @@ -135,7 +129,6 @@ else # else of if [[ $PRECOUNT -ne $POSTCOUNT ]] fi -set +x for rpm in ${CHANGELIST}; do path=`/usr/bin/find ${REPOPATH} -type f -name "${rpm}"`