summaryrefslogtreecommitdiff
path: root/storage/mroonga/packages/yum/update-repository.sh
blob: 630b6c87422d396351bba886c4d497b9d5a6b277 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/sh

script_base_dir=`dirname $0`

if [ $# != 2 ]; then
    echo "Usage: $0 DESTINATION DISTRIBUTIONS"
    echo " e.g.: $0 repositories/ 'fedora centos'"
    exit 1
fi

DESTINATION=$1
DISTRIBUTIONS=$2

run()
{
    "$@"
    if test $? -ne 0; then
	echo "Failed $@"
	exit 1
    fi
}

for distribution in ${DISTRIBUTIONS}; do
    for dir in ${DESTINATION}${distribution}/*/*; do
	# "--checksum sha" is for CentOS 5. If we drop CentOS 5 support,
	# we can remove the option.
	test -d $dir &&	run createrepo --checksum sha $dir
    done;
done