diff options
author | YAMAMOTO Takashi <yamamoto@valinux.co.jp> | 2013-10-07 14:43:53 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2013-10-07 18:08:37 +0900 |
commit | 913f2695d6886ab4b04a486af0647260e51e2e48 (patch) | |
tree | 64bb1605ca725581919a9fd559f6a257c53fb3bd | |
parent | d6a9890b0833044fef1b7e916cd355cec325303f (diff) |
fix setup from a tarball again
this makes the following work again.
DIR=$(mktemp -d)
git archive --format=tar HEAD | (cd ${DIR} && tar xf -)
cd ${DIR}
python ./setup.py install
PBR_VERSION environment variable didn't work as we expected
because it unconditionally overrides versions for other packages
even if there are other ways to get their versions. eg. PKG_INFO.
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
-rw-r--r-- | ryu/hooks.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/ryu/hooks.py b/ryu/hooks.py index 3883a7d2..6d8cf9ae 100644 --- a/ryu/hooks.py +++ b/ryu/hooks.py @@ -15,6 +15,7 @@ # License for the specific language governing permissions and limitations # under the License. +import os import sys from setuptools.command import easy_install from ryu import version @@ -60,3 +61,13 @@ def setup_hook(config): packaging.override_get_script_args = my_get_script_args easy_install.get_script_args = my_get_script_args + + # another hack to allow setup from tarball. + orig_get_version = packaging.get_version + + def my_get_version(package_name, pre_version=None): + if package_name == 'ryu': + return str(version) + return orig_get_version(package_name, pre_version) + + packaging.get_version = my_get_version |