emerge --sync: search PATH for rsync binary
authorZac Medico <zmedico@gentoo.org>
Tue, 4 Dec 2012 06:00:29 +0000 (22:00 -0800)
committerZac Medico <zmedico@gentoo.org>
Tue, 4 Dec 2012 06:00:29 +0000 (22:00 -0800)
This allows to use rsync from prefix when necessary.

pym/_emerge/actions.py

index e5d4132480615d112d672bdce4c316218a257bb7..d0c3e23db21ced034905a22081f56a4440b9eb2a 100644 (file)
@@ -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)