get_deploy_root: Avoid useless extra realpath call.
get_deploy_root: Avoid useless extra realpath call.

The comment that tabbott edited into my commit while wimpifying this
function is wrong on multiple levels.

Firstly, the way in which users might be “running our scripts” was
never relevant.  `__file__` is not the script that the user ran, it’s
zulip_tools.py itself.  What matters is not how the user ran the
script, but rather how zulip_tools was imported.  If zulip_tools was
imported as scripts.lib.zulip_tools, then `__file__` must end with
`scripts/lib/zulip_tools.py`, so running dirname three times on it is
fine.  In fact, in Python ≥ 3.4 (we don’t support anything older),
`__file__` in an imported module is always an absolute path, so it
must end with `scripts/lib/zulip_tools.py` in any case.

(At present, there’s one script that imports lib.zulip_tools, and the
installer runs scripts/lib/zulip_tools.py as a script, but those uses
don’t hit this function.)

Secondly, even if we do care about `__file__` being a funny relative
path, there’s still no reason to have two calls to `realpath`.
`realpath(dirname(dirname(dirname(realpath(…)))))` is equivalent to
`dirname(dirname(dirname(realpath(…)))), as the inner `realpath` has
already canonicalized symlinks at every level.

This version also deals with `__file__` being a funny relative
path (assuming none of scripts, lib, and zulip_tools.py are themselves
symlinks), while making fewer `lstat` calls than either of the above
constructions.

Signed-off-by: Anders Kaseorg <087231934ba8fcf78bc142ce37d193b895ac03c4@mit.edu>

tommyip/zulip,brainwane/zulip,brainwane/zulip,rht/zulip,zulip/zulip,rht/zulip,shubhamdhama/zulip,eeshangarg/zulip,shubhamdhama/zulip,kou/zulip,showell/zulip,eeshangarg/zulip,zulip/zulip,synicalsyntax/zulip,eeshangarg/zulip,zulip/zulip,shubhamdhama/zulip,tommyip/zulip,hackerkid/zulip,zulip/zulip,tommyip/zulip,tommyip/zulip,timabbott/zulip,zulip/zulip,rht/zulip,kou/zulip,hackerkid/zulip,hackerkid/zulip,eeshangarg/zulip,punchagan/zulip,rht/zulip,andersk/zulip,andersk/zulip,showell/zulip,synicalsyntax/zulip,showell/zulip,kou/zulip,rht/zulip,shubhamdhama/zulip,synicalsyntax/zulip,timabbott/zulip,timabbott/zulip,andersk/zulip,kou/zulip,brainwane/zulip,punchagan/zulip,shubhamdhama/zulip,timabbott/zulip,tommyip/zulip,kou/zulip,andersk/zulip,zulip/zulip,kou/zulip,punchagan/zulip,rht/zulip,showell/zulip,brainwane/zulip,eeshangarg/zulip,timabbott/zulip,brainwane/zulip,tommyip/zulip,andersk/zulip,hackerkid/zulip,synicalsyntax/zulip,hackerkid/zulip,hackerkid/zulip,showell/zulip,andersk/zulip,showell/zulip,showell/zulip,shubhamdhama/zulip,eeshangarg/zulip,punchagan/zulip,shubhamdhama/zulip,synicalsyntax/zulip,synicalsyntax/zulip,zulip/zulip,eeshangarg/zulip,punchagan/zulip,kou/zulip,andersk/zulip,brainwane/zulip,rht/zulip,synicalsyntax/zulip,tommyip/zulip,punchagan/zulip,brainwane/zulip,timabbott/zulip,hackerkid/zulip,timabbott/zulip,punchagan/zulip