DescriptionUse pre-built jujud if found.
Instead of rebuilding jujud everytime we want to upload some tools, try to
find jujud next to the juju being executed.
When we are uploading tools, we are running the juju command. The
juju executable is normally (when we build it and in the package
version) next to the jujud executable. So, what we do is start with
os.Args[0] and try to find the full path for it. There are three
situations here:
1. arg[0] is an absolute path, if so, return it
2. arg[0] is a relative path, if so, join it to the current working
directory, clean that and return it
3. arg[0] is just the command, in which case, walk the path looking
for an executable file that matches.
Amazingly, there is no os.CopyFile, so you have to mangle it yourself.
https://code.launchpad.net/~thumper/juju-core/find-jujud/+merge/174918
Requires: https://code.launchpad.net/~thumper/juju-core/local-provider-bootstrap/+merge/174913
(do not edit description out of merge proposal)
Patch Set 1 #
Total comments: 14
Patch Set 2 : Use pre-built jujud if found. #
MessagesTotal messages: 6
|