/[gentoo-projects]/portage-utils/qsync
Gentoo

Contents of /portage-utils/qsync

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.8 - (show annotations) (download)
Sat Dec 4 11:09:51 2010 UTC (3 years, 8 months ago) by vapier
Branch: MAIN
Changes since 1.7: +7 -2 lines
check /etc/portage/make.conf too #346569 by Daniel Pielmeier

1 #!/bin/bash
2 # $Header: /var/cvsroot/gentoo-projects/portage-utils/qsync,v 1.7 2006/08/21 00:14:57 solar Exp $
3
4 get_portage_var() {
5 local var=$1 val
6 [[ -n ${!var} ]] && return 0
7 val=$( (
8 source /etc/make.globals
9 source /etc/make.conf
10 source /etc/portage/make.conf
11 echo ${!var}
12 ) 2>/dev/null )
13 [[ -n ${val} ]] && export ${var}=${val} && return
14 export ${var}=$(portageq envvar ${var})
15 [[ -z ${!var} ]] && export ${var}=$2
16 }
17 get_portage_var PORTDIR /usr/portage
18 get_portage_var RSYNC_TIMEOUT 300
19 get_portage_var RSYNC_EXCLUDEFROM
20 get_portage_var SYNC
21 [[ -z ${SYNC} ]] && echo could not get SYNC var && exit 1
22
23 add() { RSYNC_OPTS="${RSYNC_OPTS} $@" ; }
24 RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress
25 --force --whole-file --delete --delete-after --stats --timeout=${RSYNC_TIMEOUT}
26 --exclude=/distfiles --exclude=/local --exclude=/packages --progress"
27 [[ -n ${RSYNC_EXCLUDEFROM} ]] && add --exclude-from="${RSYNC_EXCLUDEFROM}"
28
29 METADATA_ONLY=0
30 while [[ -n $1 ]] ; do
31 x=$1
32 shift
33 case ${x} in
34 -v|--verbose) add --verbose ;;
35 -q|--quiet) add --quiet ;;
36 --metadata) METADATA_ONLY=1 ;;
37 --) break ;;
38 *) echo unknown opt "${x}" ; exit 1 ;;
39 esac
40 done
41
42 set -x
43 if [[ ${METADATA_ONLY} -eq 1 ]] ; then
44 #echo /usr/bin/rsync ${RSYNC_OPTS} "$@" ${SYNC}/profiles ${PORTDIR}
45 /usr/bin/rsync ${RSYNC_OPTS} "$@" ${SYNC}/metadata/ ${PORTDIR}/metadata/
46 else
47 /usr/bin/rsync ${RSYNC_OPTS} "$@" ${SYNC} ${PORTDIR} || exit 1
48 /usr/bin/rsync --progress -a ${PORTDIR}/metadata/cache/ /var/cache/edb/dep${PORTDIR}/
49 fi

  ViewVC Help
Powered by ViewVC 1.1.20