4f10
[build.git] / mirroring / mirror.sh
index e718499..5fc0af9 100755 (executable)
@@ -6,7 +6,7 @@ DIRNAME=$(dirname $0)
 
 default_url="http://localhost/mirror/"
 default_distro="f8"
-all_distros="fc4 fc6 f7 f8 centos5"
+all_distros="f8 f9 f10 centos5"
 
 function check_distro () {
     local distro=$1; shift
@@ -30,7 +30,7 @@ function do_init () {
     dir=/etc/vservers/.distributions/$distro/yum.repos.d/
     if [ ! -d $dir ] ; then
        [ -n "$VERBOSE" ] && echo Creating dir $dir
-       mkdir -p -d $dir
+       mkdir -p $dir
     fi
     [ -n "$VERBOSE" ] && echo "Creating $repo"
     do_repo $distro > $repo
@@ -55,13 +55,13 @@ function do_display () {
     dir=/etc/vservers/.distributions/$distro/yum.repos.d/
     if [ -d $dir ] ; then
        echo "====================" Contents of $dir
-       find $dir -name '*.repo' | xargs head --verbose --lines=1000
+       ls $dir/*.repo 2> /dev/null | xargs head --verbose --lines=1000
     else
        echo "====================" $dir does not exist
     fi
 }
 
-function do_clear () {
+function do_clean () {
     local distro=$1; shift
     repo=/etc/vservers/.distributions/$distro/yum.repos.d/building.repo
     [ -n "$VERBOSE" ] && echo Removing $repo
@@ -79,14 +79,14 @@ function usage () {
     echo "Usage $COMMAND [options] <command>"
     echo "  a help to manage the yum.repos.d template in /etc/vservers/.distributions/<distro>"
     echo "Available commands"
-    echo "  display: shows content (default if missing)"
-    echo "  init: creates /etc/vservers/.distributions/<distro>/yum.repos.d/building.repo"
-    echo "       default is to use mirror root at $default_url"
-    echo "       use -u URL to specify another location"
+    echo "  display: shows content (default if <command> is missing)"
     echo "  diff: shows diff between current and what init would do"
+    echo "  init: creates /etc/vservers/.distributions/<distro>/yum.repos.d/building.repo"
     echo "  clean: removes building.repo"
     echo "  superclean: removes yum.repos.d altogether"
     echo "Options"
+    echo "  -u URL to specify another location"
+    echo "     default is to use mirror root at $default_url"
     echo "  -f <distro> : defaults to $default_distro"
     echo "  -a : runs on all distros $all_distros"
     echo "  -0 : turns off gpgcheck"
@@ -129,7 +129,7 @@ function main () {
                disp*) action=display ;;
                init*) action=init ;;
                diff*) action=diff ;;
-               clea*) action=clear ;;
+               clea*) action=clean ;;
                super*) action=superclean ;;
                *) usage ;;
            esac ;;