-for repo in "$@" ; do
- if [ ! -d $repo/RPMS ] ; then
- echo could not find $repo/RPMS - ignored
- continue
- fi
-
- cd $repo
- echo "==================== Dealing with repo $repo"
+for rpms_dir in $(find "$@" -name RPMS) ; do
+ pushd $rpms_dir >& /dev/null
+ cd ..
+ echo "==================== Dealing with repo $(pwd)"