sys.exit(1)
mytimeout=180
if portage.settings.has_key("RSYNC_TIMEOUT"):
+ print "WARNING: usage of RSYNC_TIMEOUT is deprecated, use PORTAGE_RSYNC_OPTS instead"
try:
mytimeout=int(portage.settings["RSYNC_TIMEOUT"])
+ rsync_flags.append("--timeout=%d" % mytimeout)
except SystemExit, e:
raise # Needed else can't exit
except:
pass
- rsync_flags = [
- "--recursive", # Recurse directories
- "--links", # Consider symlinks
- "--safe-links", # Ignore links outside of tree
- "--perms", # Preserve permissions
- "--times", # Preserive mod times
- "--compress", # Compress the data transmitted
- "--force", # Force deletion on non-empty dirs
- "--whole-file", # Don't do block transfers, only entire files
- "--delete", # Delete files that aren't in the master tree
- "--delete-after", # Delete only after everything else is done
- "--stats", # Show final statistics about what was transfered
- "--timeout="+str(mytimeout), # IO timeout if not done in X seconds
- "--exclude='/distfiles'", # Exclude distfiles from consideration
- "--exclude='/local'", # Exclude local from consideration
- "--exclude='/packages'", # Exclude packages from consideration
- ]
+ if (not portage.settings.has_key("PORTAGE_RSYNC_OPTS")) \
+ or portage.settings["PORTAGE_RSYNC_OPTS"] == "":
+ print "PORTAGE_RSYNC_OPTS empty or unset, using hardcoded defaults"
+ rsync_flags = [
+ "--recursive", # Recurse directories
+ "--links", # Consider symlinks
+ "--safe-links", # Ignore links outside of tree
+ "--perms", # Preserve permissions
+ "--times", # Preserive mod times
+ "--compress", # Compress the data transmitted
+ "--force", # Force deletion on non-empty dirs
+ "--whole-file", # Don't do block transfers, only entire files
+ "--delete", # Delete files that aren't in the master tree
+ "--delete-after", # Delete only after everything else is done
+ "--stats", # Show final statistics about what was transfered
+ "--timeout="+str(mytimeout), # IO timeout if not done in X seconds
+ "--exclude='/distfiles'", # Exclude distfiles from consideration
+ "--exclude='/local'", # Exclude local from consideration
+ "--exclude='/packages'", # Exclude packages from consideration
+ ]
+ rsync_opts = ""
+ else:
+ # handle default opts later
+ print "using PORTAGE_RSYNC_OPTS instead of hardcoded defaults"
+ rsync_flags = []
+ rsync_opts = portage.settings["PORTAGE_RSYNC_OPTS"]
+ if portage.settings.has_key("PORTAGE_RSYNC_EXTRA_OPTS"):
+ rsync_opts = " ".join([rsync_opts, portage.settings["PORTAGE_RSYNC_EXTRA_OPTS"]])
+ # TODO: determine required options
+ for opt in ["--recursive","--times"]:
+ if not rsync_opts.find(opt) >= 0:
+ print yellow("WARNING:")+" adding required option %s not included in PORTAGE_RSYNC_OPTS" % opt
+ rsync_flags.append(opt)
+ for exclude in ["distfiles","local","packages"]:
+ opt = "--exclude='/"+exclude+"'"
+ if not rsync_opts.find(opt) >= 0:
+ print yellow("WARNING:")+" adding required option %s not included in PORTAGE_RSYNC_OPTS (override with --exclude='!')" % opt
+ rsync_flags.append(opt)
+
+ # TODO: determine options required for official servers
+ if syncuri.rstrip("/").endswith(".gentoo.org/gentoo-portage"):
+ if not rsync_opts.find("--timeout") >= 0:
+ rsync_flags.append("--timeout=180")
+ for opt in ["--compress", "--whole-file"]:
+ if not rsync_opts.find(opt) >= 0:
+ print yellow("WARNING:")+" adding required option %s not included in PORTAGE_RSYNC_OPTS" % opt
+ rsync_flags.append(opt)
if "--quiet" in myopts:
rsync_flags.append("--quiet") # Shut up a lot
rsync_flags.append("--checksum") # Force checksum on all files
if portage.settings.has_key("RSYNC_EXCLUDEFROM"):
+ print yellow("WARNING:")+" usage of RSYNC_EXCLUDEFROM is deprecated, use PORTAGE_RSYNC_EXTRA_OPTS instead"
if os.path.exists(portage.settings["RSYNC_EXCLUDEFROM"]):
rsync_flags.append("--exclude-from="+portage.settings["RSYNC_EXCLUDEFROM"])
else:
print "!!! RSYNC_EXCLUDEFROM specified, but file does not exist."
if portage.settings.has_key("RSYNC_RATELIMIT"):
+ print yellow("WARNING:")+" usage of RSYNC_RATELIMIT is deprecated, use PORTAGE_RSYNC_EXTRA_OPTS instead"
rsync_flags.append("--bwlimit="+portage.settings["RSYNC_RATELIMIT"])
- rsynccommand = "/usr/bin/rsync " + string.join(rsync_flags, " ")
+ rsynccommand = " ".join(["/usr/bin/rsync", " ".join(rsync_flags), rsync_opts])
+
+ if "--debug" in myopts:
+ print rsynccommand
servertimestampdir = portage.settings.depcachedir+"/"
servertimestampfile = portage.settings.depcachedir+"/timestamp.chk"
#exitcode=0
try:
- maxretries=int(portage.settings["RSYNC_RETRIES"])
+ if portage.settings.has_key("RSYNC_RETRIES"):
+ print yellow("WARNING:")+" usage of RSYNC_RETRIES is deprecated, use PORTAGE_RSYNC_RETRIES instead"
+ maxretries=int(portage.settings["RSYNC_RETRIES"])
+ else:
+ maxretries=int(portage.settings["PORTAGE_RSYNC_RETRIES"])
except SystemExit, e:
raise # Needed else can't exit
except:
# Australia: "rsync://rsync.au.gentoo.org/gentoo-portage"
#SYNC="rsync://rsync.gentoo.org/gentoo-portage"
#
-# RSYNC_RETRIES sets the number of times portage will attempt to retrieve
+# PORTAGE_RSYNC_RETRIES sets the number of times portage will attempt to retrieve
# a current portage tree before it exits with an error. This allows
# for a more successful retrieval without user intervention most times.
-#RSYNC_RETRIES="3"
-#
-# RSYNC_TIMEOUT sets the length of time rsync will wait before it times out
-# on a connection. Most users will benefit from this setting as it will
-# reduce the amount of 'dead air' they experience when they run across
-# the occasional, unreachable mirror. Dialup users might want to set this
-# value up around the 300 second mark.
-#RSYNC_TIMEOUT=180
-
+#PORTAGE_RSYNC_RETRIES="3"
+#
+# PORTAGE_RSYNC_EXTRA_OPTS can be used to feed additional options to the rsync
+# command used by `emerge --sync`. This will not change the default options
+# which are set by PORTAGE_RSYNC_OPTS (don't change those unless you know
+# exactly what you're doing).
+#PORTAGE_RSYNC_EXTRA_OPTS=""
+#
# Advanced Features
# =================
#
# Australia: "rsync://rsync.au.gentoo.org/gentoo-portage"
#SYNC="rsync://rsync.gentoo.org/gentoo-portage"
#
-# RSYNC_RETRIES sets the number of times portage will attempt to retrieve
+# PORTAGE_RSYNC_RETRIES sets the number of times portage will attempt to retrieve
# a current portage tree before it exits with an error. This allows
# for a more successful retrieval without user intervention most times.
-#RSYNC_RETRIES="3"
-#
-# RSYNC_TIMEOUT sets the length of time rsync will wait before it times out
-# on a connection. Most users will benefit from this setting as it will
-# reduce the amount of 'dead air' they experience when they run across
-# the occasional, unreachable mirror. Dialup users might want to set this
-# value up around the 300 second mark.
-#RSYNC_TIMEOUT=180
-
+#PORTAGE_RSYNC_RETRIES="3"
+#
+# PORTAGE_RSYNC_EXTRA_OPTS can be used to feed additional options to the rsync
+# command used by `emerge --sync`. This will not change the default options
+# which are set by PORTAGE_RSYNC_OPTS (don't change those unless you know
+# exactly what you're doing).
+#PORTAGE_RSYNC_EXTRA_OPTS=""
+#
# Advanced Features
# =================
#
# Australia: "rsync://rsync.au.gentoo.org/gentoo-portage"
#SYNC="rsync://rsync.gentoo.org/gentoo-portage"
#
-# RSYNC_RETRIES sets the number of times portage will attempt to retrieve
+# PORTAGE_RSYNC_RETRIES sets the number of times portage will attempt to retrieve
# a current portage tree before it exits with an error. This allows
# for a more successful retrieval without user intervention most times.
-#RSYNC_RETRIES="3"
-#
-# RSYNC_TIMEOUT sets the length of time rsync will wait before it times out
-# on a connection. Most users will benefit from this setting as it will
-# reduce the amount of 'dead air' they experience when they run across
-# the occasional, unreachable mirror. Dialup users might want to set this
-# value up around the 300 second mark.
-#RSYNC_TIMEOUT=180
-
+#PORTAGE_RSYNC_RETRIES="3"
+#
+# PORTAGE_RSYNC_EXTRA_OPTS can be used to feed additional options to the rsync
+# command used by `emerge --sync`. This will not change the default options
+# which are set by PORTAGE_RSYNC_OPTS (don't change those unless you know
+# exactly what you're doing).
+#PORTAGE_RSYNC_EXTRA_OPTS=""
+#
# Advanced Features
# =================
#
# Australia: "rsync://rsync.au.gentoo.org/gentoo-portage"
#SYNC="rsync://rsync.gentoo.org/gentoo-portage"
#
-# RSYNC_RETRIES sets the number of times portage will attempt to retrieve
+# PORTAGE_RSYNC_RETRIES sets the number of times portage will attempt to retrieve
# a current portage tree before it exits with an error. This allows
# for a more successful retrieval without user intervention most times.
-#RSYNC_RETRIES="3"
-#
-# RSYNC_TIMEOUT sets the length of time rsync will wait before it times out
-# on a connection. Most users will benefit from this setting as it will
-# reduce the amount of 'dead air' they experience when they run across
-# the occasional, unreachable mirror. Dialup users might want to set this
-# value up around the 300 second mark.
-#RSYNC_TIMEOUT=180
-
+#PORTAGE_RSYNC_RETRIES="3"
+#
+# PORTAGE_RSYNC_EXTRA_OPTS can be used to feed additional options to the rsync
+# command used by `emerge --sync`. This will not change the default options
+# which are set by PORTAGE_RSYNC_OPTS (don't change those unless you know
+# exactly what you're doing).
+#PORTAGE_RSYNC_EXTRA_OPTS=""
+#
# Advanced Features
# =================
#
# Australia: "rsync://rsync.au.gentoo.org/gentoo-portage"
#SYNC="rsync://rsync.gentoo.org/gentoo-portage"
#
-# RSYNC_RETRIES sets the number of times portage will attempt to retrieve
+# PORTAGE_RSYNC_RETRIES sets the number of times portage will attempt to retrieve
# a current portage tree before it exits with an error. This allows
# for a more successful retrieval without user intervention most times.
-#RSYNC_RETRIES="3"
-#
-# RSYNC_TIMEOUT sets the length of time rsync will wait before it times out
-# on a connection. Most users will benefit from this setting as it will
-# reduce the amount of 'dead air' they experience when they run across
-# the occasional, unreachable mirror. Dialup users might want to set this
-# value up around the 300 second mark.
-#RSYNC_TIMEOUT=180
-
+#PORTAGE_RSYNC_RETRIES="3"
+#
+# PORTAGE_RSYNC_EXTRA_OPTS can be used to feed additional options to the rsync
+# command used by `emerge --sync`. This will not change the default options
+# which are set by PORTAGE_RSYNC_OPTS (don't change those unless you know
+# exactly what you're doing).
+#PORTAGE_RSYNC_EXTRA_OPTS=""
+#
# Advanced Features
# =================
#
# Australia: "rsync://rsync.au.gentoo.org/gentoo-portage"
#SYNC="rsync://rsync.gentoo.org/gentoo-portage"
#
-# RSYNC_RETRIES sets the number of times portage will attempt to retrieve
+# PORTAGE_RSYNC_RETRIES sets the number of times portage will attempt to retrieve
# a current portage tree before it exits with an error. This allows
# for a more successful retrieval without user intervention most times.
-#RSYNC_RETRIES="3"
-#
-# RSYNC_TIMEOUT sets the length of time rsync will wait before it times out
-# on a connection. Most users will benefit from this setting as it will
-# reduce the amount of 'dead air' they experience when they run across
-# the occasional, unreachable mirror. Dialup users might want to set this
-# value up around the 300 second mark.
-#RSYNC_TIMEOUT=180
-
+#PORTAGE_RSYNC_RETRIES="3"
+#
+# PORTAGE_RSYNC_EXTRA_OPTS can be used to feed additional options to the rsync
+# command used by `emerge --sync`. This will not change the default options
+# which are set by PORTAGE_RSYNC_OPTS (don't change those unless you know
+# exactly what you're doing).
+#PORTAGE_RSYNC_EXTRA_OPTS=""
+#
# Advanced Features
# =================
#
+++ /dev/null
-# Copyright 1999-2006 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id: /var/cvsroot/gentoo-src/portage/cnf/make.conf.mac,v 1.2 2004/09/30 06:34:27 vapier Exp $
-# Contains local system settings for Portage system
-
-#Nothing needed here
# Australia: "rsync://rsync.au.gentoo.org/gentoo-portage"
#SYNC="rsync://rsync.gentoo.org/gentoo-portage"
#
-# RSYNC_RETRIES sets the number of times portage will attempt to retrieve
+# PORTAGE_RSYNC_RETRIES sets the number of times portage will attempt to retrieve
# a current portage tree before it exits with an error. This allows
# for a more successful retrieval without user intervention most times.
-#RSYNC_RETRIES="3"
-#
-# RSYNC_TIMEOUT sets the length of time rsync will wait before it times out
-# on a connection. Most users will benefit from this setting as it will
-# reduce the amount of 'dead air' they experience when they run across
-# the occasional, unreachable mirror. Dialup users might want to set this
-# value up around the 300 second mark.
-#RSYNC_TIMEOUT=180
-
+#PORTAGE_RSYNC_RETRIES="3"
+#
+# PORTAGE_RSYNC_EXTRA_OPTS can be used to feed additional options to the rsync
+# command used by `emerge --sync`. This will not change the default options
+# which are set by PORTAGE_RSYNC_OPTS (don't change those unless you know
+# exactly what you're doing).
+#PORTAGE_RSYNC_EXTRA_OPTS=""
+#
# Advanced Features
# =================
#
# Australia: "rsync://rsync.au.gentoo.org/gentoo-portage"
#SYNC="rsync://rsync.gentoo.org/gentoo-portage"
#
-# RSYNC_RETRIES sets the number of times portage will attempt to retrieve
+# PORTAGE_RSYNC_RETRIES sets the number of times portage will attempt to retrieve
# a current portage tree before it exits with an error. This allows
# for a more successful retrieval without user intervention most times.
-#RSYNC_RETRIES="3"
-#
-# RSYNC_TIMEOUT sets the length of time rsync will wait before it times out
-# on a connection. Most users will benefit from this setting as it will
-# reduce the amount of 'dead air' they experience when they run across
-# the occasional, unreachable mirror. Dialup users might want to set this
-# value up around the 300 second mark.
-#RSYNC_TIMEOUT=180
-
+#PORTAGE_RSYNC_RETRIES="3"
+#
+# PORTAGE_RSYNC_EXTRA_OPTS can be used to feed additional options to the rsync
+# command used by `emerge --sync`. This will not change the default options
+# which are set by PORTAGE_RSYNC_OPTS (don't change those unless you know
+# exactly what you're doing).
+#PORTAGE_RSYNC_EXTRA_OPTS=""
+#
# Advanced Features
# =================
#
# Australia: "rsync://rsync.au.gentoo.org/gentoo-portage"
#SYNC="rsync://rsync.gentoo.org/gentoo-portage"
#
-# RSYNC_RETRIES sets the number of times portage will attempt to retrieve
+# PORTAGE_RSYNC_RETRIES sets the number of times portage will attempt to retrieve
# a current portage tree before it exits with an error. This allows
# for a more successful retrieval without user intervention most times.
-#RSYNC_RETRIES="3"
-#
-# RSYNC_TIMEOUT sets the length of time rsync will wait before it times out
-# on a connection. Most users will benefit from this setting as it will
-# reduce the amount of 'dead air' they experience when they run across
-# the occasional, unreachable mirror. Dialup users might want to set this
-# value up around the 300 second mark.
-#RSYNC_TIMEOUT=180
-
+#PORTAGE_RSYNC_RETRIES="3"
+#
+# PORTAGE_RSYNC_EXTRA_OPTS can be used to feed additional options to the rsync
+# command used by `emerge --sync`. This will not change the default options
+# which are set by PORTAGE_RSYNC_OPTS (don't change those unless you know
+# exactly what you're doing).
+#PORTAGE_RSYNC_EXTRA_OPTS=""
+#
# Advanced Features
# =================
#
# Australia: "rsync://rsync.au.gentoo.org/gentoo-portage"
#SYNC="rsync://rsync.gentoo.org/gentoo-portage"
#
-# RSYNC_RETRIES sets the number of times portage will attempt to retrieve
+# PORTAGE_RSYNC_RETRIES sets the number of times portage will attempt to retrieve
# a current portage tree before it exits with an error. This allows
# for a more successful retrieval without user intervention most times.
-#RSYNC_RETRIES="3"
-#
-# RSYNC_TIMEOUT sets the length of time rsync will wait before it times out
-# on a connection. Most users will benefit from this setting as it will
-# reduce the amount of 'dead air' they experience when they run across
-# the occasional, unreachable mirror. Dialup users might want to set this
-# value up around the 300 second mark.
-#RSYNC_TIMEOUT=180
-
+#PORTAGE_RSYNC_RETRIES="3"
+#
+# PORTAGE_RSYNC_EXTRA_OPTS can be used to feed additional options to the rsync
+# command used by `emerge --sync`. This will not change the default options
+# which are set by PORTAGE_RSYNC_OPTS (don't change those unless you know
+# exactly what you're doing).
+#PORTAGE_RSYNC_EXTRA_OPTS=""
+#
# Advanced Features
# =================
#
# Australia: "rsync://rsync.au.gentoo.org/gentoo-portage"
#SYNC="rsync://rsync.gentoo.org/gentoo-portage"
#
-# RSYNC_RETRIES sets the number of times portage will attempt to retrieve
+# PORTAGE_RSYNC_RETRIES sets the number of times portage will attempt to retrieve
# a current portage tree before it exits with an error. This allows
# for a more successful retrieval without user intervention most times.
-#RSYNC_RETRIES="3"
-#
-# RSYNC_TIMEOUT sets the length of time rsync will wait before it times out
-# on a connection. Most users will benefit from this setting as it will
-# reduce the amount of 'dead air' they experience when they run across
-# the occasional, unreachable mirror. Dialup users might want to set this
-# value up around the 300 second mark.
-#RSYNC_TIMEOUT=180
-
+#PORTAGE_RSYNC_RETRIES="3"
+#
+# PORTAGE_RSYNC_EXTRA_OPTS can be used to feed additional options to the rsync
+# command used by `emerge --sync`. This will not change the default options
+# which are set by PORTAGE_RSYNC_OPTS (don't change those unless you know
+# exactly what you're doing).
+#PORTAGE_RSYNC_EXTRA_OPTS=""
+#
# Advanced Features
# =================
#
# Australia: "rsync://rsync.au.gentoo.org/gentoo-portage"
#SYNC="rsync://rsync.gentoo.org/gentoo-portage"
#
-# RSYNC_RETRIES sets the number of times portage will attempt to retrieve
+# PORTAGE_RSYNC_RETRIES sets the number of times portage will attempt to retrieve
# a current portage tree before it exits with an error. This allows
# for a more successful retrieval without user intervention most times.
-#RSYNC_RETRIES="3"
-#
-# RSYNC_TIMEOUT sets the length of time rsync will wait before it times out
-# on a connection. Most users will benefit from this setting as it will
-# reduce the amount of 'dead air' they experience when they run across
-# the occasional, unreachable mirror. Dialup users might want to set this
-# value up around the 300 second mark.
-#RSYNC_TIMEOUT=180
-
+#PORTAGE_RSYNC_RETRIES="3"
+#
+# PORTAGE_RSYNC_EXTRA_OPTS can be used to feed additional options to the rsync
+# command used by `emerge --sync`. This will not change the default options
+# which are set by PORTAGE_RSYNC_OPTS (don't change those unless you know
+# exactly what you're doing).
+#PORTAGE_RSYNC_EXTRA_OPTS=""
+#
# Advanced Features
# =================
#
# Australia: "rsync://rsync.au.gentoo.org/gentoo-portage"
#SYNC="rsync://rsync.gentoo.org/gentoo-portage"
#
-# RSYNC_RETRIES sets the number of times portage will attempt to retrieve
+# PORTAGE_RSYNC_RETRIES sets the number of times portage will attempt to retrieve
# a current portage tree before it exits with an error. This allows
# for a more successful retrieval without user intervention most times.
-#RSYNC_RETRIES="3"
-#
-# RSYNC_TIMEOUT sets the length of time rsync will wait before it times out
-# on a connection. Most users will benefit from this setting as it will
-# reduce the amount of 'dead air' they experience when they run across
-# the occasional, unreachable mirror. Dialup users might want to set this
-# value up around the 300 second mark.
-#RSYNC_TIMEOUT=180
-
+#PORTAGE_RSYNC_RETRIES="3"
+#
+# PORTAGE_RSYNC_EXTRA_OPTS can be used to feed additional options to the rsync
+# command used by `emerge --sync`. This will not change the default options
+# which are set by PORTAGE_RSYNC_OPTS (don't change those unless you know
+# exactly what you're doing).
+#PORTAGE_RSYNC_EXTRA_OPTS=""
+#
# Advanced Features
# =================
#
AUTOCLEAN="yes"
# Number of times 'emerge --sync' will run before giving up.
-RSYNC_RETRIES="3"
+PORTAGE_RSYNC_RETRIES="3"
# Number of seconds rsync will wait before timing out.
-RSYNC_TIMEOUT="180"
+#RSYNC_TIMEOUT="180"
+
+PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude='/distfiles' --exclude='/local' --exclude='/packages'"
# Minimal CONFIG_PROTECT
CONFIG_PROTECT="/etc"
it will increment it. For more information about nice levels and what
are acceptable ranges, see \fBnice\fR(1).
.TP
+\fBPORTAGE_RSYNC_EXTRA_OPTS\fR = \fI[rsync options string]\fR
+Additional rsync options to be used by \fBemerge --sync\fR.
+.br
+Defaults to no value.
+.TP
+\fBPORTAGE_RSYNC_OPTS\fR = \fI[rsync options string]\fR
+Default rsync options to be used by \fBemerge --sync\fR.
+.br
+\fBDon't change this unless you know exactly what you're doing!\fR
+.br
+Defaults to "--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude='/distfiles' --exclude='/local' --exclude='/packages'"
+.TP
+\fBPORTAGE_RSYNC_RETRIES\fR = \fI[NUMBER]\fR
+The number of times rsync should retry on failed connections before
+giving up.
+.br
+Defaults to 3.
+.TP
\fBPORTAGE_TMPDIR\fR = \fI[path]\fR
Defines the location of the temporary build directories.
.br
.br
Defaults to /.
.TP
-\fBRSYNC_EXCLUDEFROM\fR = \fI"/etc/portage/rsync_excludes"\fR
-This is a file that portage will pass to rsync when it updates the portage
-tree. Specific chucks of the tree may be excluded from the sync process.
-This may cause dependency failures if you are not careful. The file format
-is one pattern per line, blanks and ';' or '#' lines are comments. See
-\fBrsync\fR(1) for more details.
-.TP
-\fBRSYNC_RETRIES\fR = \fI[NUMBER]\fR
-The number of times rsync should retry on failed connections before
-giving up.
-.br
-Defaults to 3.
-.TP
-\fBRSYNC_TIMEOUT\fR = \fI[SECONDS]\fR
-The number of seconds rsync should remain idle before it determines the
-connection has timed out. Dialup users may need to set this value at or
-above 300 seconds.
-.br
-Defaults to 180 seconds.
-.TP
\fBRPMDIR\fR = \fI[path]\fR
Defines the location where created RPM packages will be stored.
.br