summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2012-12-03 22:00:29 -0800
committerZac Medico <zmedico@gentoo.org>2012-12-03 22:00:29 -0800
commit05a0f8f4dc30a08bc5b41655d9f5b8df40cd6d47 (patch)
treea01926667398869a7d6c98885bb8363a89a032dd
parent4551596377cf01904245611145be896314254582 (diff)
downloadportage-05a0f8f4dc30a08bc5b41655d9f5b8df40cd6d47.tar.gz
portage-05a0f8f4dc30a08bc5b41655d9f5b8df40cd6d47.tar.bz2
portage-05a0f8f4dc30a08bc5b41655d9f5b8df40cd6d47.zip
emerge --sync: search PATH for rsync binary
This allows to use rsync from prefix when necessary.
-rw-r--r--pym/_emerge/actions.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
index e5d413248..d0c3e23db 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -2095,7 +2095,8 @@ def action_sync(settings, trees, mtimedb, myopts, myaction):
"control (contains %s).\n!!! Aborting rsync sync.\n") % \
(myportdir, vcs_dir), level=logging.ERROR, noiselevel=-1)
return 1
- if not os.path.exists("/usr/bin/rsync"):
+ rsync_binary = portage.process.find_binary("rsync")
+ if rsync_binary is None:
print("!!! /usr/bin/rsync does not exist, so rsync support is disabled.")
print("!!! Type \"emerge net-misc/rsync\" to enable rsync support.")
sys.exit(1)
@@ -2321,7 +2322,7 @@ def action_sync(settings, trees, mtimedb, myopts, myaction):
if mytimestamp != 0 and "--quiet" not in myopts:
print(">>> Checking server timestamp ...")
- rsynccommand = ["/usr/bin/rsync"] + rsync_opts + extra_rsync_opts
+ rsynccommand = [rsync_binary] + rsync_opts + extra_rsync_opts
if "--debug" in myopts:
print(rsynccommand)