Files
ports/rep-gen
2018-01-09 21:49:40 +08:00

35 lines
517 B
Bash
Executable File

#!/bin/bash
#
# script for update REPO file using httpup-repgen
#
PORT_DIR=$(dirname $0)
if [ ! $(type -pa httpup-repgen) ]; then
echo "httpup not installed, aborting"
exit 1
fi
genrepo() {
while [ "$1" ]; do
if [ ! -d "$PORT_DIR/$1" ]; then
echo "Repository '$1' not exist!"
else
httpup-repgen "$PORT_DIR/$1"
fi
shift
done
}
if [ "$1" ]; then
genrepo "$@"
else
for repo in $(ls $PORT_DIR/); do
if [ -f "$PORT_DIR/$repo/REPO" ]; then
httpup-repgen "$PORT_DIR/$repo"
fi
done
fi
exit 0