and again
[bootstrapfs.git] / plc.d / packages
index d97fa54..2046fad 100755 (executable)
@@ -119,8 +119,10 @@ case "$1" in
        if [[ -n "$@" ]] ; then
            repositories="$@"
        else
-           # use all subdirs in install-rpms by default, except the slice repos
-           repositories=$(ls -d /var/www/html/install-rpms/* | grep -v /slice-)
+           # consider all subdirs in install-rpms by default, except the slice repos
+           # use find instead of ls - for the corner case where the dir. is empty
+           # (thanks Thomas Dreibholz for the heads up)
+           repositories=$(find /var/www/html/install-rpms -maxdepth 1 -mindepth 1 -type d \! -name 'slice-*' 2> /dev/null)
        fi
 
        # filter out PRESERVE'd repos
@@ -228,6 +230,22 @@ case "$1" in
 
        result "$MESSAGE"
        ;;
+    index)
+       # just rerun createrepo
+       shift
+       if [[ -z "$@" ]] ; then
+           # use all subdirs in install-rpms by default
+           repositories=/var/www/html/install-rpms/*
+       else
+           # else use argv
+           repositories=$@
+       fi
+
+       for repository in $repositories ; do
+           echo ============================== running createrepo in $repository
+           createrepo -g yumgroups.xml $repository
+       done
+       ;;
     clean)
        shift
        if [[ -z "$@" ]] ; then