From: Jakub Skoczen Date: Mon, 12 Jul 2010 14:00:15 +0000 (+0200) Subject: Rebuild repo only for non-empty dirs (once) X-Git-Url: http://sru.miketaylor.org.uk/?a=commitdiff_plain;h=e7e73dac59c07a386ff6dba729c13c5e59001baa;p=git-tools-moved-to-github.git Rebuild repo only for non-empty dirs (once) --- diff --git a/update-archive/update-yum-archve.sh b/update-archive/update-yum-archve.sh index 54b208a..9d49d26 100755 --- a/update-archive/update-yum-archve.sh +++ b/update-archive/update-yum-archve.sh @@ -48,6 +48,7 @@ for vdist in centos/5.5 rhel/5.5; do fi done for arch in $architectures; do + dirs_to_upd="${dirs_to_upd} ${ftpdir}/${d}/${arch}" for l in $d/$arch/Packages/*; do if test -L "$l"; then if test ! -f "$l"; then @@ -85,7 +86,6 @@ for vdist in centos/5.5 rhel/5.5; do has_packages=true fi done - dirs_to_upd="${dirs_to_upd} ${ftpdir}/${d}/${arch}" done fi fi @@ -97,17 +97,20 @@ rpm --addsign ${pkgs_to_sign} chgrp staff ${pkgs_to_sign} chmod g+w ${pkgs_to_sign} echo "Updating repository meta:" -echo ${dirs_to_upd} for rdir in ${dirs_to_upd}; do - createrepo --update ${rdir} - if test -f ${rdir}/repodata/repomd.xml.asc; then - rm ${rdir}/repodata/repomd.xml.asc + echo "Section ${rdir}" + if test -d $rdir && ls -A $rdir; then + createrepo --update ${rdir} + if test -f ${rdir}/repodata/repomd.xml.asc; then + rm ${rdir}/repodata/repomd.xml.asc + fi + gpg --detach-sign -u "Index Data" --armor ${rdir}/repodata/repomd.xml + else + echo "Empty." fi - gpg --detach-sign -u "Index Data" --armor ${rdir}/repodata/repomd.xml done # Local Variables: # mode:shell-script # sh-indentation: 2 # sh-basic-offset: 8 # End: -