builder.sh: refactor code to clone repositories in init_rpm_dir