diff --git a/centos-mirror-tools/dl_rpms.sh b/centos-mirror-tools/dl_rpms.sh index 582b3e0f..54ff6281 100755 --- a/centos-mirror-tools/dl_rpms.sh +++ b/centos-mirror-tools/dl_rpms.sh @@ -242,7 +242,6 @@ download () { fi else echo "Already have $dest_dir/$rpm_name" - echo "already_there_srpm:$rpm_name" >> $LOG fi echo done diff --git a/centos-mirror-tools/utils.sh b/centos-mirror-tools/utils.sh index 6880f7c5..4d32cf4f 100644 --- a/centos-mirror-tools/utils.sh +++ b/centos-mirror-tools/utils.sh @@ -65,7 +65,14 @@ get_url() { fi else _url_cmd="$(get_yum_command $_name $_level)" - _ret="$($_url_cmd --url)" + + # When we add --url to the yum download command, + # --archlist is no longer enforced. Multiple + # url's might be returned. So use grep to + # filter urls for the desitered arch. + local arr=( $(split_filename $_name) ) + local arch=${arr[3]} + _ret="$($_url_cmd --url | grep "[.]$arch[.]rpm$")" fi echo "$_ret" } @@ -139,14 +146,17 @@ process_result() { mkdir -p $dest_dir fi - echo "url_srpm:$url" >> $LOG + echo "url_srpm:$url" if ! mv -f $sfile* $dest_dir ; then echo "FAILED to move $rpm_name" echo "fail_move_srpm:$rpm_name" >> $LOG + return 1 fi - echo "found_srpm:$rpm_name" >> $LOG + + echo "found_srpm:$rpm_name" echo $rpm_name >> $FOUND_SRPMS + return 0 }