version.init() somewhat broken

Tim Penhey tim.penhey at canonical.com
Thu Mar 21 21:42:24 UTC 2013


Me again...

There is an init() function in the version package to allow reading of a
file to provide an override of the version number.  However it doesn't
work (fully).

tim at jake:~/go/bin$ which juju
/home/tim/go/bin/juju
tim at jake:~/go/bin$ cat FORCE-VERSION
2.0.0
tim at jake:~/go/bin$ juju version
2.0.0-raring-amd64
tim at jake:~/go/bin$ popd
~/go/src/launchpad.net/juju-core
tim at jake:~/go/src/launchpad.net/juju-core$ juju version
1.9.12-raring-amd64
tim at jake:~/go/src/launchpad.net/juju-core$ `which juju` version
2.0.0-raring-amd64


The file is only read if the current working directory is the same as
the directory that contains the executable, or if the full path of the
executable is passed in.

Now it seems to me that the only reason this exists is for testing
purposes.  Are there other use-cases I don't understand?

Tim



More information about the Juju-dev mailing list