diff --git a/cp2lalis-mirror.sh b/cp2lalis-mirror.sh index 7e1e8c3..ab3c66a 100755 --- a/cp2lalis-mirror.sh +++ b/cp2lalis-mirror.sh @@ -12,19 +12,23 @@ for X in 7 8 fi for ARCH in $ARCH_LIST { - if [ "$ARCH" = "noarch" ]; then - for MARCH in $ARCHLIST - { - rsync -aP RPMS/$ARCH/*mga$X* $MIRRORPATH/$X/$MARCH/media/core/ - } - else - rsync -aP RPMS/$ARCH/*mga$X* $MIRRORPATH/$X/$ARCH/media/core/ - if [ $? -ne 0 ]; then - echo "error rsync : $LINENO" - exit 1 + if [ -d RPMS/$ARCH ];then + if [ "$ARCH" = "noarch" ]; then + for MARCH in $ARCHLIST + { + if [ -d $MIRRORPATH/$X/$MARCH/media/core/ ]; then + rsync -aP RPMS/$ARCH/*mga$X* $MIRRORPATH/$X/$MARCH/media/core/ + fi + } + else + rsync -aP RPMS/$ARCH/*mga$X* $MIRRORPATH/$X/$ARCH/media/core/ + if [ $? -ne 0 ]; then + echo "error rsync : $LINENO" + exit 1 + fi fi fi - nice -n 19 gendistrib --nobadrpm --blind --skipmissingdir --mediacfg $MIRRORPATH/$X/$ARCH/media/media_info/media.cfg $MIRRORPATH/$X/$ARCH + nice -n 19 gendistrib --nobadrpm --blind --skipmissingdir --mediacfg $MIRRORPATH/$X/$ARCH/media/media_info/media.cfg $MIRRORPATH/$X/$ARCH } } chmod a+rX -R .