other distros move to nodemanager that has a single specfile for all packages
[build.git] / partial-repo.sh
index 09771c0..06da266 100755 (executable)
@@ -1,5 +1,4 @@
 #!/bin/sh
-# $URL$
 
 COMMAND=$(basename $0)
 
@@ -10,21 +9,18 @@ function usage () {
 }
 
 [[ -n "$@" ]] || usage
+case "$1" in *-h*) usage ;; esac
 
 set -e 
 
-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)"
     mkdir -p PARTIAL-RPMS
-    rsync --archive --verbose $(find RPMS -type f | egrep '/(bootcd|bootstrapfs|noderepo)-.*-.*-.*-.*rpm') PARTIAL-RPMS/
-    echo "==================== building packages index in $repo .."
+    rsync --archive --verbose $(find RPMS -type f | egrep '/(bootcd|bootstrapfs|nodeimage|noderepo|slicerepo)-.*-.*-.*-.*rpm') PARTIAL-RPMS/
+    echo "==================== building packages index in $(pwd) .."
     createrepo PARTIAL-RPMS
     echo '==================== DONE'
-    cd - >& /dev/null
+    popd >& /dev/null
 done