updated on Mon Jan 23 00:00:36 UTC 2012
[aur-mirror.git] / eix / emerge-sync
blob98ad3633e3eeb69423d49d25c2df5ed282eb5591
1 #!/bin/sh
3 PORTDIR="/usr/portage"
4 SYNC="rsync://mirror.averse.net/gentoo-portage"
6 . /etc/make.conf
8 error() {
9 local mesg=$1; shift
10 if [ -t 2 -a ! "$USE_COLOR" = "n" ]; then
11 printf "\033[1;31m==> ERROR:\033[1;0m\033[1;1m ${mesg}\033[1;0m\n" "$@" >&2
12 else
13 printf "==> ERROR: ${mesg}\n" "$@" >&2
17 check_root() {
18 if [ -z "$EUID" -a -x /usr/bin/id ]; then
19 EUID=`id -u`
20 UID=`id -ru`
22 if [ "$EUID" != "0" ]; then
23 error "must run as root."
24 exit 1
29 do_sync() {
30 rsync --recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --verbose $SYNC $PORTDIR
33 check_root
34 do_sync